Ephemeral VMs and CI Orchestration on AWS EC2 Mac with Anka

Amazon EC2 Mac instances provide a way for iOS development teams to configure iOS CI infrastructure on AWS without the hassles of hosting and managing the mac hardware themselves. These EC2 Mac instances offer a usage-based pricing model (minimum 24-hour threshold), unlimited scalability of mac hardware with minimal management overhead, worldwide access for distributed development teams, up-to-16K-IOPs, up-to-16-TiB and flexible VolumeSize to whichever Amazon EBS size you want. Anka Build enables you to set up an orchestration layer to provision Ephemeral macOS VMs on a cluster of EC2 Mac Instances.

We expect that most iOS development teams will be looking at migrating their on-premise or hosted iOS mac infrastructure to AWS mac cloud EC2 instances. There are, however, some open questions that need to be sorted out.

  1. How do you achieve identical macOS build server environments for all build and test jobs?
  2. How do you automatically provision macOS build servers on-demand?
  3. How do you automatically register on-demand provisioned macOS build servers as workers/agents/runners in the CI system?
  4. How do you overcome the EC2 macOS build server startup time of 5 – 8 minutes?
  5. How do you manage the on-demand availability and scalability needs with 50 – 120 minutes it takes to clean up the EC2 mac metal host and start a new macOS build server on it?
  6. How do you optimize the overall cost?
 

You can resolve these questions by running ephemeral and immutable macOS build server containers on top of a cluster of AWS EC2 Mac instances. We recommend running the macOS virtualization layer and orchestration provided by Anka Build on top of the Amazon EC2 Mac instances.

Get started with an Anka Build trial license key. We have scripts that will set up the complete orchestration. You can find them under our Getting Started repo’s AWS folder. There are two scripts available:

prepare-build-cloud.bash

  • Running this script will create everything necessary inside of AWS to run an Anka Build Cloud. This includes a security group, elastic IP, etc.

prepare-anka-node.bash

  • Running this script will create everything necessary inside of AWS to run a mac1.metal instance and then install Anka inside. You’ll be prompted for the Anka license to use if the ANKA_LICENSE env variable is not set.

Both scripts can be run locally from your macOS hardware with an existing AWS credential.

Identical macOS build server environments for all build and test jobs

Using Anka macOS virtual machines on top of EC2 Mac instances gives you the ability to have identical build environments across all builds and test jobs. Automate creating macOS base virtual machine images(templates) with packer, store and manage them in Anka Registry(running in your AWS VPC). Manage the build software dependencies inside the macOS environment by creating tags on top of base images.

Anka Controller(orchestrator) will start identical macOS build environments from base image+tag for CI build jobs.

Automatically provision macOS build servers on demand.

When your CI system runs iOS jobs, Anka Controller(running in your AWS VPC) gets all those requests and starts concurrent macOS virtual machines across a cluster of EC2 Mac instances from a specific base image+tag. Anka Controller terminates the virtual machines when the jobs are completed. You can run multiple macOS build VMs on each EC2 Mac instance with minimal performance degradation. Anka Controller can start multiple macOS VMs from different base images on the same EC2 Mac Instance. So, you can run concurrent builds in a Catalina and Big Sur VM or two different Xcode versions on the same EC2 Mac instance.

Automatically register on-demand provisioned macOS build servers as workers/agents/runners in the CI system.

Anka Controller(Orchestrator) provides plugins or integrations for most CI systems and enables automatic registration of macOS virtual machines as workers/agents/runners.

Jenkins – Install the Anka Plugin to directly start macOS VMs from Jenkins jobs on AWS EC2 Mac instances.

TeamCity – Install the Anka Plugin to directly start macOS VMs from TeamCity jobs on AWS EC2 Mac instances.

GitLab CI – Install the Anka GitLab CI runner to directly start macOS VMs from GitLab CI on AWS EC2 Mac instances.

BuildKite – Use the Anka BuildKite integration to start macOS VMs from BuildKite on AWS EC2 Mac instances.

GitHub Actions – use the Anka GitHub Actions integration to start macOS VMs from BuildKite on AWS EC2 Mac instances.

You can use the Anka Controller APIs to integrate and start macOS VMs on AWS EC2 Mac instances for any other CI system.

 

Overcome the EC2 macOS build server startup time of 5 – 8 minutes

Anka Controller starts macOS VMs on EC2 Mac instances from VM template images in 1-2 seconds. The VMs are connected to the CI system in a few seconds and ready to execute jobs.

Get around the 50 – 120 minutes it takes to clean up the EC2 mac metal host and start a new macOS build server.

You can easily scale and increase the number of available macOS build servers by starting new macOS VMs across the EC2 mac instance cluster.

Optimize the overall cost

Anka on EC2 Mac instances enables you to orchestrate starting multiple macOS build servers on each EC2 Mac Instance. You can increase your available capacity for CI.

 

Share this post

anka-or-1
Anka vs Orka in 2024
It has been several years since we made our first side by side comparison between Anka and Orka. A lot has changed, and we believe it’s important to make sure the information out there is accurate. We’ll be specifically addressing a newer...
Read More
networking-performancev1
Unlocking Superior macOS VM Network Performance: Introducing Anka's new networking mode for Apple Silicon
Large and complex enterprises using Anka have many different demands, and we have worked to continue to develop innovative technology to meet these demands. Enterprise infrastructure hardware is often on the cutting edge, and they need advanced capabilities...
Read More
gitlab-with-anka
Anka Cloud Gitlab Executor
Veertu’s Anka and the new Anka Cloud Gitlab Executor Veertu’s Anka is a suite of software tools built on the macOS virtualization platform. It enables the execution of single or multi-use macOS virtual machines (VMs) in a manner similar to Docker....
Read More
mac-scan-v1
Real-Time CVE Scanning of your macOS Build Systems
It’s common that an organization’s macOS build system will download thousands, sometimes tens of thousands of third-party dependencies every hour. When building and testing iOS applications, it typically downloads and installs third-party...
Read More
anka-on-silicon-v1
The ONLY Fully Automated Apple Silicon macOS VM Creation Solution
Starting in Anka 3.1 we announced that Anka is now able to fully automate the macOS installation processes, disabling SIP, and enabling VNC — all previously manual steps users had to perform inside o the VM. At the time of writing this article,...
Read More
anka_click
Scripting macOS UI User Actions With Anka Click
Starting in Anka 3.2, we’ve introduced a solution for scripting macOS UI user actions. You may ask, “Why would I want to do that?”. Well, often macOS configuration and applications do not have a CLI allowing you to perform certain actions...
Read More
mac-scan-fullscan-shells-v3
Real-time, continuous scan of file downloads on macOS for security vulnerabilities
Today, we are announcing the Beta availability of the Mac Scan solution. Mac Scan software runs on macOS systems (bare metal, virtual, EC2 Mac) and scans downloads in real time for security vulnerabilities. There are multiple scenarios why you would...
Read More
Screen Shot 2022-10-17 at 10.13
Anka 3.1- Fully automated VM macOS installation & The Behavior-Driven macOS UI Automation Framework
We are very happy to announce the General Availability of Anka 3.1 for Apple Silicon / ARM macs. In this release, we are taking our approach to iOS CI automation one step further by introducing a Behavior-Driven macOS UI Automation Framework in Anka,...
Read More
ankam1v2
Migrating from Anka on Intel to Anka on M1 Mac for iOS CI
In this blog, we will cover the key topics for migrating from Anka on Intel to Anka on M1/M2 Macs. Anka is an IaaC solution from Veertu to set up an agile Container like CI for iOS CI using macOS VMs. Anka for Intel uses Apple’s Hypervisor.Framework virtualization...
Read More
ami-scanner-featured-v2
World's first Security Vulnerability scanner for EC2 Mac AMIs
We are excited to announce the General Availability of the world’s first security vulnerability scanner for EC2 Mac AMIs. EC2 Mac AMI Scan scans Intel and Apple Silicon macOS EC2 AMIs, detects security vulnerabilities in third-party packages, dependencies,...
Read More