Posts

Configuring Jenkins Pipeline for iOS CI to run on Anka Build macOS cloud

In this blog, we will describe steps to run Jenkins iOS CI jobs defined as pipelines on macOS slave VMs running on Anka Build Anka Build macOS cloud. One of our previous blog titled “configuring Jenkins iOS CI macOS cloud” covered the basic steps to configure Jenkins-Anka Build plugin and steps to use it in Jenkins iOS CI jobs defined through web UI. Jenkins pipeline provides an extensible set of tools for modeling simple-to-complex delivery pipelines “as code” via the Pipeline Domain Specific Language (DSL) syntax. When using it in combination with Anka Build macOS cloud, the steps are relatively straightforward.

Step 1 – Install and setup Anka Build Jenkins plugin.

Step 2 – Set Anka Build macOS private cloud IP details in the plugin.

Step 3 – Create Anka macOS VM Slave templates to use for your iOS CI jobs. In this step, you will define a label for each of these slave templates.

ANka Build plugin Slave template

Step 4 – Define your Jenkins pipeline – https://github.com/asafg6/jenkins2-pipeline-example. This example is a simple pipeline definition which executes Build and Test scripts/actions. The pipeline launches Anka macOS VMs (Jenkins slaves) on-demand on Anka Build cloud as per the label definition.

Sample Jenkins Pipeline Job

Using Anka Build Slave template label in Pipeline definition

Step 5 – When this pipeline executes, it launches one or multiple macOS VMs on-demand for job execution. Every build and test job gets a sterilized, consistent environment.

Pipeline jobs executing on Anka Build macOS cloud

If you are using other declarative CI tools or platforms like Gitlab CI or Buildkite, you can use anka command line tool interface for easy integration with agents/runners. In such scenarios, the agent/runners running on macOS hosts will be able to launch on-demand Anka macOS VMs from templates (pulled from Anka Registry) , to fulfill job requests. We will be covering these scenarios in our upcoming blogs.

Launching build/test environment for iOS CI jobs at AWS instance launch speeds

In this blog, we will describe how teams can configure a private (on-prem or hosted) cloud and instantaneously launch on-demand, isolated build/test instances to execute their iOS CI jobs, while still meeting the tough demands of the speed of overall execution of the CI jobs.

It’s no secret that speed of CI job execution directly impacts developer productivity and you see developer productivity teams making this one of their top priorities. There are multiple variables that impact the speed of execution of the CI jobs – provisioning time for the environment, seeding the environment for the CI job (config mgmt etc), performance in the environment and getting build/test artifacts in and out of the environment.

If you look outside of macOS dependent development, most of the CI process is happening either in private or public clouds. In these setups, (taking the example of AWS) launching an instance on-demand is super easy, completely extensible and fast. Just start one with an AMI and you have an isolated Linux instance available. Containers make it even easier and more replicable. However, the story is quite different for macOS dev environments for CI.

Existing virtualization approach to creating a macOS dev cloud on Mac hardware is based on the same solution available to virtualize Linux and Windows. However, since this technology is not optimized for a macOS cloud use case, it suffers from challenges of scalability and manageability and only supports specific mac hardware.

In the Anka Build solution, our goal was to make sure that these challenges are addressed and that it provides the same level of agility and scalability as one would get from using AWS. So, Anka Build packages a virtualization software that can run on any mac hardware, is built on top of macOS native Hypervisor Framework, exposes an extensible CLI.

Let’s look at the method of provisioning or launching macOS VMs on-demand in Anka Build.

Step 1 – Create your macOS Anka VM (this will be your template) and seed it with all your build/test dependencies using Anka CLI. This will ensure that no time is spent on preparing the dependencies in the environment for when a job runs.

Step 2 – Put this Anka VM (template) in an ‘Instant Start’ State. It’s called `suspend` state in Anka CLI. This will ensure that when your iOS CI job requests an environment, the macOS Anka VM will be available instantly for execution, without any boot time issues. It will also ensure that you always get the same, consistent instance for repeated execution of the same job.

Demo Video for Instant starting Anka macOS Vm from a suspended state.

Step 3 – Push the suspended Anka VM to Anka registry.  If you need different flavors of build/test instances for different types of CI jobs, then, create and push different versions of same Anka VM template to the registry and use them by referring to a specific tag in your jobs. You can also create additional Anka VM templates(for when you need different macOS version) and push them to the registry and use them for your CI jobs.

Step 4 – Install Anka Build mac application on all your build and test mac hardware and join them to Anka Build controller.

Step 5 – Integrate your CI system to Anka Build controller through one of our existing plugins(Jenkins) or through REST APIs. Anka Build controller will now launch one or multiple macOS VMs on-demand across your build and test mac hardware, based on your CI job requests and your jobs will execute instantaneously.

Step 6 – Trash the macOS Anka instances or keep them for troubleshooting. Get consistent, isolated instances for the next job execution.

Step 1 and Step 2 address the tough demands of developer productivity teams to provide faster provisioning time of the macOS build/test instances in a macOS cloud for CI and enables them to keep build and test queue moving along with increased speed, efficiency, and determinism.

Anka Public Beta

As the WWDC conference gets underway with exciting new updates for macOS, iOS developers, we are thrilled to announce the availability of the beta version of Anka. For the past few months, we have been working with private beta users of Anka and are extremely grateful for all the feedback we received, which helped us shape Anka.

Anka is now available as ‘Anka Run’ and ‘Anka Build’ beta products. Anka Run can be used by iOS and macOS developers to create and consume reproducible development environments on their dev machines. Anka Run will enable developers working on the same project, to build and test their code changes against the same set of external libraries, configuration, toolchain and environment variables. This will significantly increase developer productivity. Check out technology page for additional technical details.

Anka Build can be used by infrastructure admins to very quickly build a private cloud on Apple hardware and provision on-demand instances of their environments from preconfigured VM templates. Anka Build is an all-in-one solution to virtualize macOS, manage macOS VM templates and provision them on-demand for CI jobs. It removes the setup complexities associated with existing approaches while providing a fast-performing and responsive macOS private cloud. Check out technology page for additional details. Anka Run and Anka Build, when used together can significantly accelerate the velocity of macOS and iOS development.

How to Get Started with Anka

UPDATE – High Sierra macOS 10.13 beta is out and Anka supports it. Download developer beta version ‘.app’ and work with it inside an Anka VM. Here are the setup instructions.

There are multiple ways to get started with Anka. Start with first downloading and installing Anka Run beta. Download and install the Anka Run application package on a few developer machines. Setup Anka registry in a docker container using the dockerfile included in the Anka-registry package. Then, create macOS Anka VM on one of the mac machines running Anka Run application and configure that VM with your project dependencies. Push that VM to Anka registry. Then, ask your developers to pull it on their machines(running Anka Run) and use them for local build and tests.

Then, move on to configuring a private macOS cloud for your CI. Download and install the Anka Build application package on your macOS CI machines. Setup Anka Controller in a docker container using the dockerfile included in the Anka-controller package. Register Anka Build nodes to Anka Controller cloud, configure the controller to talk to the previously installed Anka registry and you have a private macOS build and test cloud!

Additionally, if you use Jenkins for your CI, then install the Anka Jenkins plugin on your Jenkins master server to run your jobs on Anka cloud. Send us your feedback and questions at ankabeta@veertu.com, share insights on your setup with others at @veertu_labs, and help us spread the word.

Introducing Anka

Today, Veertu Labs is thrilled to pull back the curtain on three Anka toolsets, our latest endeavors geared towards making macOS and iOS development infrastructure management simple and streamlined. Anka technology is a suite of three products that are built to bring the experience of working with containers to the complex macOS/iOS development process. We are inviting all macOS/iOS developers and as well as DevOps engineers to give Anka a try by joining our trial program (www.veertu.com). We’ll provide launch dates and general availability of these solutions soon as well. 

It’s no secret that container-based app development and deployment has significantly changed the landscape of developer operations. Why a container approach? Because containers are built to be extremely lightweight, easy to interact with and extremely portable. While macOS cannot yet be run inside a container,  (different than running Linux and windows containers on macOS), we have taken the concepts of container-based devops to iOS/macOS development with Anka. 

Anka’s core hypervisor technology enables creation and execution of extremely lightweight and responsive macOS VMs on Apple hardware. The performance of build and test operations is extremely critical in using virtual environments successfully. As such we developed proprietary paravirtual network and block drivers in our hypervisor for macOS VMs. Then, we built a container ecosystem around Anka, so developers and systems engineers can effectively work with it for iOS and macOS development. 

A Container Ecosystem

We built the container ecosystem with three components: Anka Build, Anka DevOps, and Anka Device. Anka Build enables systems engineers and developers to build an on-premise macOS private cloud on Apple hardware. Anka Build consists of Anka’s native virtualization technology, as well as the Anka Registry and Controller services for storing and managing the on-premise macOS private cloud.  Anka Build enables familiar workflows used with many large cloud providers by allowing you to create version-tagged macOS VMs and store them in the Anka Registry. With Anka Controller’s REST API, you can use stored VMs in Anka Registry to spin up fresh, isolated copies for development, build, or test.  

Anka DevOps is a combination of Anka Registry and the Anka client. Anka Registry stores your macOS virtual machines with proper versioning and optional tagging. Anka client is a lightweight program that runs on your developer machines, that can pull relevant build VMs and make them available for local, but managed development. 

Anka Device extends Anka Build and Anka DevOps to allow iOS on-device testing within the macOS private cloud. Plug in any iOS device to Apple hardware running the Anka Build or Anka DevOps toolset to make real iOS devices available for your iOS CI system or to individual developers on-demand; Anka Device allows for the setup and management of the devices centrally in a private device cloud. 

Anka Build, Anka Devops and Anka Device are the building blocks we think will completely transform infrastructure management for macOS or iOS development.

The pace of growth of iOS app development is astounding and at the same time, the complexity and capabilities of these apps, both B2C and B2B are also increasing significantly. The iOS development methodologies have to stay ahead of the curve to make life easy for developers and publishers.