Using Anka Controller

Anka Controller is the central management system of Anka Build and provides a simple and extensible interface for provisioning and managing on-demand macOS VMs on a cluster of mac hardware (Anka Build nodes).

Using Anka Controller

After the successful installation of Anka Controller, Controller must be configured to communicate with Anka Registry, the Anka nodes, and your CI system.

By default, Anka Controller setup doesn’t use TLS. To configure TLS on the controller, you can contact support@veertu.com for additional setup instructions.

Now, connect your Anka nodes (any Apple hardware running the Anka Build application package) with the Controller by running this command ankacluster join on the Anka Build nodes.

$ ankacluster join --help
NAME:
   ankacluster join - join a cluster

USAGE:
   ankacluster join [command options] http://controller-address[:port]

OPTIONS:
   --queue-address value  queue-address[:port] (optional)
   --max-vm-count value   Maximum number of VMs this node is allowed to run (optional) (default: 2)
   --tls                  Use tls for communicating with the queue (optional)
   --keystore value       Path to certificate and keystore (PEM, PKCS12) (optional)
   --keystore-pass value  Password for certificate and keystore (optional)
   --cacert value         Path to CA bundle file (PEM/X509) (optional)

In the command, http://controller-address[:port] is the Controller IP. If your controller is configured on port 80, then leave the [:port] empty. Else, specify the port no. --max-vm-count value variable can be used to set a max limit of concurrent VMs that can be run on the node. For example if you are using mac minis for your build or test jobs, you want to limit to 2 concurrent VMs.

Controller REST APIs

Use the REST APIs to integrate Anka Build cloud with your CI system. For Jenkins, use the Anka Jenkins Plugin.

To provision and start VMs

Start VM  instance (will start N count of instances of a particular type across the node cluster)
url= "/api/v1/vm", 
method="POST"
body="VM UUID, tag, version, count, node_id"  (node_id, count, tag, and version are optional. If not provided, the latest version will be used, otherwise whatever tag is specified will be pulled on the nodes. By default count is 1. If node_id is not specified the VM could be scheduled on available node in the cluster)
Returns: Operation Result, Arrary of instance UUIDs
Example Body: {"vmid":"226d946b-2467-11e7-84b7-a860b60fd826", “count”=”2”, "node_id"="a8:60:b6:1b:c5:99"}

To terminate VM

Terminate instance
url= "/api/v1/vm?id={instance_id}"", 
method="DELETE"
body=none
Returns: Operation result

To list the instances

List instances 
url= "/api/v1/vm"
method="GET"
body=none
Returns: Operation result, List of initiated instance UUIDs 

To show information for an instance

Show instance info
url= "/api/v1/vm?id={instance_id}"
method="GET"
body=none
Returns: Operation result, State, VM and connectivity info

To list all build nodes connected/joined to the controller

List nodes 
url= "/api/v1/node"
method="GET"
body=none
Returns: Operation result, List of nodes IDs

To show information for a build node

Show node
url= "/api/v1/node?id={node_id}"
method="GET"
body=none
Returns: Operation result, State and Info of the node

To list all VM templates accessible to controller from the registry

List registry VMs 
url= "/api/v1/registry/vm"
method="GET"
body=none
Returns: Operation result, List of registry VM UUIDs and names

To show information on a specific VM template

Show registry VM 
url= "/api/v1/registry/vm?id={vm_id}"
method="GET"
body=none
Returns: Operation result, VM UUID, name and tag list