Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scalable Continuous Integration for iOS

Scalable Continuous Integration for iOS

SwiftLeeds 2024 talk.

https://swiftleeds.co.uk/

Alberto De Bortoli

December 03, 2024
Tweet

More Decks by Alberto De Bortoli

Other Decks in Programming

Transcript

  1. 🙋 Alberto De Bortoli 🇮🇹 Based in London 💼 IC

    at JET 10 years 📱 iOS ♾ DevOps 🍕 JustEatTakeaway.com 
 About me
  2. Agenda 🤌 What is a Continuous Integration & Delivery system?

    🛍 Existing CI/CD solutions 😏 Focus on a setup using AWS EC2 + GitHub Actions 🤖 Implementation using DevOps tools 🤔 Final considerations
  3. CI/CD system A system that executes tasks on your code

    to allow integration and deployment of software… …continuously (if you’re lucky)
  4. CI/CD system 🚢 Continuous Delivery Deploy the software so it

    can be used (internally and/or publicly) • Build • Archive • Upload to QA/staging/ production distribution channels 🤖 Continuous Integration Make sure the changes proposed are safe to merge into the default branch • Run validations • Run tests • Generate artifacts
  5. • Ready out-of-the-box • Workers are virtualized • Usually provide

    related tools/products • Xcode Cloud special snow fl ake • Appropriate for small-mid apps CI/CD solutions Server + Workers
  6. CI/CD solutions Server only • Powerful and fl exible build

    systems • Usually require a high degree of customisation facebook/buck
  7. 👍 IaC Infrastructure as Code • Predictable • Reviewable •

    Auditable • Replicable • Point&Click in the UI • Error-prone • Intuitive 👎 ClickOps
  8. AMI creation in Packer AWS credential required export AWS_ACCESS_KEY_ID=“your_access_key"
 export

    AWS_SECRET_ACCESS_KEY=“your_secret_key" Or set them in ~/.aws/credentials
  9. Secrets are best saved in Secrets Manager 🤫 Set up

    permissions to access Secrets Manager via IAM 🕵 Pass the secret ID (ARN) via user data when creating the EC2 instance 🏁 Use AWS ec2-macos-init to handle user data for startup operations 🍏 🔌 Connect to GitHub Actions… need a join token
  10. Recap Dedicated host EC2 AMI (image) EC2 instance EC2 AMI

    (image) EC2 instance Dedicated host
  11. Console in GHA The operations we want to automate: 1.

    The creation of the AMI 2. The deployment and decommission of the infrastructure 3. The allocation/release of the dedicated hosts
  12. Console in GHA The operations we want to automate: 1.

    The creation of the AMI 2. The deployment and decommission of the infrastructure 3. The allocation/release of the dedicated hosts
  13. Console in GHA The operations we want to automate: 1.

    The creation of the AMI 2. The deployment and decommission of the infrastructure 3. The allocation/release of the dedicated hosts
  14. Console in GHA The operations we want to automate: 1.

    The creation of the AMI 2. The deployment and decommission of the infrastructure 3. The allocation/release of the dedicated hosts
  15. Taking it further 🤔 • Automate scaling • Consider smart

    scaling • CloudWatch monitoring • IaC all the things • Optimise your code and pipelines 🫵
  16. Costs 💸 • Back-of-the-envelope calculations Orka on AWS Anka on

    AWS In-house infra In-house infra w/ smart scaling Mac minis on premise 5 M1 instances per month ~ $3-4k > $3k ~ $2,300 ~ $1,650 🤯 Maintenance pain Virtually none Moderate Initial setup pain,
 joy and satisfaction thereafter High
  17. One size does not fit all Any budget restriction? Buy

    vs Build? What’s the expected workload? How many pull requests & CD jobs per hour? Codebase size? How many apps/tools/repos? Need a CI/CD at all? Dev-hosted runners? In-house HW? Full third-party platform? Just workers? Existence of a DevOps team? Any in-house knowledge Anybody with the desire to skill up in DevOps? Number of teams? Would Virtualisation help?