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 APIs of macOS. With ARM chip-based Apple mac hardware, Apple has also introduced a new Virtualization.Framework. Anka supports creating and running macOS VMs on all ARM chip-based Apple M1/M2 Mac hardware. Anka runs on M1 Minis, Mac Studio Max, Mac Studio Ultra, and all Macbook M2 models.
Anka version 2.x.x runs on Intel Mac hardware, and Anka version 3.x.x runs on ARM M1/M2 Mac hardware. We are working to very soon release a unified Anka package that will support both the Intel and ARM-based Mac hardware.
There is a lot of excitement around the new M1/M2 mac hardware, and initial user feedback indicates much faster compilation times inside Anka macOS VMs than the Intel Mac hardware.
Let’s look at the steps to plan Anka iOS CI Infrastructure migration from Intel to Anka.
Build and Test VM Templates
Anka enables users to create their iOS CI build and test environments as macOS Anka VMs and store and manage them in the Anka Registry (similar to working with container images).
Anka Mac VM images for Intel and M1/M2 are different and are not interoperable. Users should create Build and Test Vms from scratch for M1/M2 using Anka version 3.x.x.
- Install Anka version 3.x.x on M1/M2 hardware and execute license activation steps.
- Create base macOS VMs using anka create command – In the current Anka version 3.x.x, anka create results in a macOS Anka VM, which requires additional manual steps to complete macOS setup. We are working to provide a fully automated macOS Anka VM creation similar to the Anka Intel experience in the next major Anka release.
- Using Packer to create M1 Anka VM Templates – This is currently not supported due to the manual steps required to complete the macOS setup. The next release of Anka will support this feature.
Refer to creating Anka VMs for M1 hardware documentation for detailed steps.
Sizing VM Templates
With Anka on Intel, hardware users could take the total vcpu (physical cores*2) count and determine vcpu parameters for the VMs. For example, on Intel i7 6-core mac minis, users can run 2 Anka VMs concurrently, each with 6vcpu (12 vCPU running concurrently).
VM sizing is different for Anka M1 VMs.
- M1 minis have only 16GB RAM, which is suboptimal to run two concurrent iOS CI VMs. We recommend that users run only 1 Anka VM with 8vcpu and 12GB RAM and test the performance of their iOS CI jobs. They can further finetune the vcpu count from 8 to 6 to 4 to determine the best performing configuration.
- If the requirement is to run two concurrent Anka VMs, use the Mac Studio Max hardware.
Based on reports on actual job executions from our users, compilation job performance inside Anka M1 Mac Vms is 40-60% faster than execution inside Anka Intel Mac VMs. So, while you can run only one job in one Anka VM on M1 mini, the avg_time_spent_processingjob is much lower. So, faster build execution may neutralize the anticipated negative impact of 1 VM per maM1 Mac mini on jobtime_in_queue. We recommend that the user execute test runs to determine the optimal configuration for their CI needs – 1 Anka VM per node(M1 mini) or 2 Anka VMs per node (Mac Studio Max).
Anka Build Controller And Registry supports a mixed cluster.
Starting from version 1.20.0, a single instance of Anka Build Controller/Registry supports both Intel and Anka VMs. There is no need to set up a separate instance of Controller and Registry for M1 hardware.
- Users can join M1 Anka nodes running Anka version 3.x.x or higher to their existing Anka Build Controller setup. The Controller includes logic to identify and run M1 images only on M1-based nodes.
- Users can push M1 VM images/templates to their existing Anka registry and manage all current Intel and new M1-based Anka VM templates in a single repository.
All existing CI plugins work AS IS and support a mixed cluster of Intel and M1 Mac hardware for iOS CI.
NOTE: Contact Veertu on slack or support email to discuss test licenses for M1.
AWS EC2 M1 Mac Anka Deployment
AWS provides EC2 M1 Mac (mac2.metal) instances which are M1 Mac mini hosts. You can deploy Anka on mac2.metal AWS instances. Use our community AMIs (anka-build-3.0.1.144-macos-12.5.1-arm64, anka-build-3.0.1.144-macos-12.4-arm64) to get started quickly. There are no Anka marketplace AMIs available for EC2 M1 Mac yet. We are working with AWS to make them available soon.
Anka Scan to scan security vulnerabilities in VM templates
As you plan your migration to M1, incorporate DevSecOps workflow in your iOS CI. Integrate the Anka Scan tool to monitor all files, apps, and packages in the Build VM templates for known security vulnerabilities.