Using Anka Build to run your Android project’s CI/CD

android-on-host-example

Using Anka Build to run your Android project’s CI/CD builds and tests is a relatively simple process. However, time after time, we hear the same concerns from our customers about emulators not working or having poor performance. This is understandable as, at the time of writing this blog, we’re still working on supporting the use of the host GPU and Metal APIs inside Anka VMs. Running your emulators using CPU is possible but has limited performance.

Therefore, we’d like to show you how to run your project’s build and unit tests inside of an Anka VM, then pass the project to the host to run your emulator tests. We’ve created an example repo for you to review at https://github.com/veertuinc/android-emulator-on-host-example



Repository Overview

  • The base of the project is from android’s testing samples repo.
  • The GitHub Action workflow file includes the commands used to run your Android build and tests both inside of the VM and out on the host.
  • The vm-watcher.bash example script helps us run a detached process on the host that waits for the VM to be deleted (happens when the job completes/fails/is canceled) and then cleans up the emulator that we also ran detached on the host.

Veertu’s Anka Build Virtualization software has come a long way since our announcement in 2017. We’ve been consistently adding the most customer-requested features and keeping our software up to date and compatible with the latest Apple macOS releases. GPU and Metal support is one of the features we’re excited to add in the future, but until then, we know this pattern of using Anka Build to run your Android project’s CI/CD will suffice.

If you’re new to Anka software, you can get started by signing up for a trial on our site: https://veertu.com/getting-started-anka-trials/

Upgrading to Big Sur Beta in your Anka Build VM

big-sur-beta-window

We are excited to share a patch for our Anka Build Virtualization (v2.2.3) software that supports upgrading to Big Sur Beta in your Anka Build VM. Upgrading to Big Sur Beta is relatively easy and can be done using the standard beta installation process you would expect.

We highly suggest that you avoid patching/testing on your production servers
Our testing at the time of writing this is with Big Sur beta2. It’s possible that other beta releases of Big Sur will not work with our patch.
  1. Install our Big Sur beta patch on an Anka Build Virtualization Node running version 2.2.3.
  2. Ensure your VM Template/Tag has enough disk space to handle the Big Sur beta downloaded installer:
    • anka modify {TemplateName} set hard-drive -s ##GB && anka run -n {TemplateName} diskutil apfs resizeContainer disk1 0
  3. Start your VM with anka start {TemplateName} and then launch the Anka viewer with anka view {TemplateName}. Alternatively, you can VNC into the running VM.
  4. Enroll in the Apple Beta Software Program and follow their instructions to download the Big Sur installer inside of your Anka VM.
  5. Proceed with the normal upgrade process to Big Sur beta.
    • The upgrade process reboots the VM and can potentially get stuck on a black screen. When this happens, stop the VM with Anka command line anka stop {TemplateName} and start it again with anka start -v {TemplateName}.

At this point, you should now have an Anka VM running a beta version of Big Sur. Unfortunately, upgrading to Big Sur Beta doesn’t guarantee that all features will be functioning as expected as Big Sur, and Anka support for it, are in flux. We are continuing to work on General Availability (GA) support of Big Sur.

If you’re new to Anka software, you can get started by signing up for a trial on our site: https://veertu.com/getting-started-anka-trials/

Anka Build Getting Started with Jenkins

We’re excited to announce our Anka Build Getting Started with Jenkins script which is now available in the Anka Build Getting Started repository. If you’re already familiar with our Announcing the Anka Build Getting Started Repository blog post, you’ll know that we aim to provide scripts to help set up and run Anka Build software. This repository has scripts which are excellent for installing the Anka Build Virtualization CLI, the Anka Build Cloud Controller & Registry, and generating VM Templates and Tags.

As promised in our first blog, we want to provide scripts for running not only the Anka Build software, but even CI/CD platforms, all within the same machine.

Within the getting started repository, we have included what you need to:

  • Run a Jenkins LTS container with example jobs and all of the configurations you need to start running jobs right away using: ./JENKINS/install-jenkins-on-docker.bash
  • Generate your first VM Template and the necessary Jenkins Tag using: ./ANKA_BUILD_CLOUD/create-template.bash && /ANKA_BUILD_CLOUD/create-tags.bash 10.15.5 –jenkins

Once set up, you’ll be able to navigate to the Jenkins URL we create for you (http://anka.jenkins:8092). You’ll find example jobs using both Freestyle/Static Slave Templates and Dynamic Labelling jobs that pull a Jenkinsfile from a GitHub repo. If you’ve already used the Anka scripts to create the necessary VM Templates, the example jobs will start a VM locally and execute the job commands inside.

getting-started-repo-jenkins

If you’re curious, go over and check out the Anka Build Getting Started with Jenkins script at https://github.com/veertuinc/getting-started.

Our existing getting started documentation can be found at https://ankadocs.veertu.com/docs/getting-started.

Using the Anka VM GitHub Action with Anka Build

GitHub Actions has quickly become a favorite for most organizations and projects as they are already using GitHub repositories for code version control. It’s also easy to use and simple to get up and running. Here at Veertu, we’re committed to providing integrations and plugin for the various CI/CD platforms and tools that exist. This is why we’re excited to announce our own beta Anka VM GitHub Action! You can find it on the official GitHub Action Marketplace.

Within the Anka VM GitHub Action, we’ve included what we believe are the features needed for the majority of use-cases in modern CI/CD systems:

  • Ability to set both the Anka Template name or UUID and Anka Template Tag you wish to use, per step.
  • Pass options to anka run (inherit environment variables from the host into VM, wait for networking, time to sync, use a different working directory inside of the VM, and disable host <-> guest mounting) and anka start (attach your USB devices to the VM) commands.
  • Artifact uploading
  • STDOUT and STDERR are combined into an output that you can parse for subsequent steps/tests.
  • Proper job cancellation and failure handling/cleanup with Post steps.

It’s important to note that our Anka VM GitHub Action cannot be used with the GitHub hosted macOS hardware. GitHub hosted macOS hardware does not include or license the Anka Virtualization product. Fortunately, GitHub provides self-hosted runner software you can install onto your local or CI/CD macOS machine that will process jobs for your project’s repo or for the entire organization in GitHub. You then install the Anka Build Cloud and license it on that same machine. Visit https://veertu.com/anka-build-trial/ to obtain your free trial of Anka Build Cloud.

Check out our documentation on using the Anka VM GitHub Action or the GitHub Marketplace readme. We also have a video walkthrough available:

We expect customer and internal testing over the coming months to expose weaknesses and missing features. While it is in beta, please contact support@veertu.com or open a GitHub issue with any comments or concerns.

Anka Build Getting Started with TeamCity

We’re excited to announce a new Anka Build Getting Started with TeamCity script which is now available in our Anka Build Getting Started repository. If you’re already familiar with our Announcing the Anka Build Getting Started Repository blog post, you’ll know that we aim to provide scripts to help set up and run Anka Build software. This repo is excellent for installing the Anka Virtualization CLI, the Anka Cloud Controller & Registry, and generating VM Templates and Tags. However, they are only the foundational pieces.

As promised in our first blog, we want to provide scripts for running not only the Anka Build software, but even CI/CD platforms, all within the same machine.

Within the getting started repository, we included what you need to:

  • Setup a TeamCity docker container which includes the necessary plugins and an example pipeline using ./TEAMCITY/install-teamcity-server-on-docker.bash
  • Generate your first VM Template and the necessary Jenkins Tag using: ./ANKA_BUILD_CLOUD/create-template.bash && /ANKA_BUILD_CLOUD/create-tags.bash 10.15.5 –jenkins (if necessary, be sure to change 10.15.5 to the version you chose).

Once set up, you’ll be able to navigate to the TeamCity URL we create for you (http://anka.teamcity:8094), login, and then view or run the example pipeline. If you’ve already used the Anka scripts to create the necessary VM Templates, the example pipeline will start a VM locally and execute the build commands inside.

getting-started-repo-teamcity

If you’re curious, go over and check out the Anka Build Getting Started with TeamCity script at https://github.com/veertuinc/getting-started.

Our existing getting started documentation can be found at https://ankadocs.veertu.com/docs/getting-started/.

Announcing the Anka Build Getting Started Repository

Developer Relations at Veertu Inc is proud to announce the launch of our Anka Build Getting Started repository in Github. This repo contains various examples and scripts that automate the installation and configuration of Veertu’s Anka Build Software on your local macOS machine. This is a great way to set up a test environment and review the various components of Anka Build for macOS and iOS CI/CD. It is also useful for understanding techniques for Infrastructure as Code / Configuration Management.

The first release of the Anka Build Getting Started repository includes what you need to:

  • Install the Anka Virtualization CLI package with ./ANKA/install-anka-virtualization.bash ${LICENSE}
  • Install the Anka Build Cloud Controller & Registry with ./ANKA/BUILD/install-build-cloud-on-mac.bash
  • Generate macOS VM Templates and Tags with ./ANKA/create-template.bash

getting-started-repo

Future releases will include scripts for our supported CI/CD platforms (Jenkins, GitLab, etc). For example, you will be able to quickly set up Jenkins within a docker container that includes all of the necessary plugins and example jobs you need for testing. All of this within your local machine.If you’re curious, go over and check out the repository at https://github.com/veertuinc/getting-started.

Our existing getting started documentation can be found at https://ankadocs.veertu.com/docs/getting-started/.

Performance testing with new Anka release and 2018 minis

Anka macOS virtualization is now at version 2.1.2 with support for Catalina. Since our earlier releases starting from 1.x.x, we have been quietly making changes to improve the performance of iOS and macOS build and test jobs inside Anka VMs. Some of these changes are significant items shared in the release notes, and at other times, the changes are mostly optimizations in the Anka virtualization components. Here are some findings from the latest round of testing with version 2.1.2 and the new 2018 mini hardware.

Anka Version 2.1.2 on 2018 6-Core Mac minis

  • Project – Kickstarter iOS-OSS
  • Xcode – Version 10.3
  • macOS – Catalina (inside Anka VM and on the native hardware)


  • We used command line xcodebuild utility for the builds and ran clean after every execution on both native hardware and inside Anka VM.

    Build and test on 2018, 6-core mac mini, 32GB RAM took 263.6s.

    Build and test inside Anka VM with 12 vCPU, and 28 GB RAM took 282s. Performance degradation inside Anka VM is 7% compared to running it on native hardware. Generally, the performance degradation inside Anka VM compared to the native mac is less than 10%. If you tested with an older version of the Anka package(version 1.x), we recommend that you rerun the same tests with version 2.1.2 on the new 2018, minis. You will see a significant performance jump in running jobs inside Anka VMs.

    Share your findings with us in our slack channel, and we can assist with additional performance optimization tricks.

    Mac pro, mac mini or new mac mini for iOS CI?

    With the rapid growth in the iOS apps market, iOS development teams are moving their build and test setup from under their desks to managed, multi-machine environments. With the increase in team size, app count and complexity also comes business requirements to make building and to test the apps more consistent, predictable, and efficient. iOS development teams are looking for CI build and test infrastructure, which can scale dynamically and provide predictable results with minimal management. Cloud-powered by virtualization technology solves this problem.

    Anka Build solution enables the configuration of such a macOS cloud on mac hardware. The next question is which mac hardware to use for configuring private macOS cloud for iOS CI? There seem to be some preconceived assumptions that machines with large CPU core count are ideally suited for this.

    We ran a set of tests and discovered that the best rackable Mac hardware to configure private cloud for iOS CI is the 2018 mac mini machine. The 2018 mac minis give the most performance for virtualized build environments, which is one of the critical demands of iOS developers.

    These tests were done using the opensource https://github.com/kickstarter/ios-oss project. The results are very self-explanatory. We plan to run the same tests when the new Mac Pro becomes available.

    Model1 Anka VM running2 Concurrent Anka VM running
    2018, 6 core/32GB Mac Mini2m2.754s (12vCPU)2m58s(6vCPU)
    12 core/64GB Mac Pro6m3.718s(12vCPU)6m19s(6vCPU)
    8m41.625s(24vCPU)8m47s(12vCPU)
    2014, 2 core mac mini8m13.372s(4vCPU)NA
    2012, 4 core/16GB mac mini4m38.090s(8vCPU)7m56s(4vCPU)

    How to create your own real device cloud for iOS CI with Anka Build

    Anka Build enables you to configure your private macOS cloud. You can create and run macOS VMs on-demand for iOS CI and manage it as infrastructure-as-a-code. Additionally, with Anka Build Enterprise Tier, you can also configure a real device cloud to augment your simulator based CI testing.

    Anka Build enables you to work with real devices inside Anka macOS VMs through the USB interface. After connecting and claiming the real device on the mac host/node machines, dynamically attach the device to provisioned Anka VMs through the Anka Build Cloud Controller REST API interface. Check out detailed steps in our documentation.Register for a trial at www.veertu.com.

    Privileged user access macOS environments – locally delivered and centrally managed

    A large number of organizations every year suffer breach into their internal data or their customer’s data due to employee access. While employee access to sensitive data can’t be entirely blocked out, it’s possible to manage it as privileged access. There are a lot of solutions available to provide employees secondary windows privileged access work environments. However, there are not any solutions for macOS.

    Almost all of the existing solution takes the approach of completely locking down users’ primary macOS work environment to the extent that impacts their productivity. As an example, Macbooks of iOS developers in financial enterprises are generally entirely locked down and affects their ability to download any early/beta versions of third party software for R&D purposes. As more and more employees migrate from Windows-based systems to Macs, there exists a gap in delivering secondary privileged access macOS work environments for these users. Anka Secure fills this gap.

    Anka Secure is built on top of Anka macOS native virtualization engine and uses it to create and run lightweight macOS VMs on user’s mac workstations. It exposes services to prepare privileged users/groups, manages their access with VM policies, and delivers the privileged access secondary macOS work environment(VMs) on end-users mac workstations. The privileged access macOS VM based work environments run locally on the user’s primary mac workstations. This approach provides a local secure, sandbox, privileged macOS environments with best user experience and performance.

    Who can benefit from Anka Secure :
    1. Technical and customer support who have access to privileged data from their mac workstations.
    2. Developers in enterprises with access to corporate developer/application certificates and other privileged data from their MacBooks.
    3. iOS developers working in secure enterprise setup and need isolated secondary mac environments for research purposes on their MacBooks.
    4. Environments for Malware and other sensitive analysis and testing tasks for macOS.
    Discover more and try it at https://veertu.com/anka-secure/.