Anka registry provides an easy way to store, version, and distribute macOS VMs that are used for CI and development. Once you've completed creation and setup of your VMs, use anka registry
command to work with the registry.
Store your build and test VM templates in the registry.
Then, you can pull them, modify them and push them again with a different tag to the Registry. This way you can maintain versions. Pull specific VM template and tag to a different machine running Anka package.
Registry operations are available through Anka Client command line and through Registry REST APIs.
View all of the available registry commands by running anka registry --help
.
> sudo anka registry --help
Usage: anka registry [OPTIONS] COMMAND [ARGS]...
Configure and control the Anka Cloud Registry
Options:
-r, --remote TEXT Set the registry name (instead of 'default')
-a, --registry-path TEXT Set the registry URL (instead of 'default')
-c, -i, --cert, --pem PATH Path to your node certificate (if certificate authentication is enabled)
-k, --key PATH Path to your node certificate key if the client/node certificate doesn't contain one
--cacert, --root-cert PATH Path to a CA Root certificate
--insecure Skip TLS verification
--help Display usage information
Commands:
add Add a registry
check-download-size Return the size of the template and tag
delete Remove the registry from your configuration
describe Show a VM template description and tags
list List VMs in registry
list-repos List registries you have configured
pull Pull the specified VM template (and latest...
push Push a VM template (and tag) to the Cloud...
set Set default registry
anka registry add <givesomename> <registryURLwithport>
You can add/define multiple registries to a node. The last one added is treated as current. To change current use the set command.
anka registry set <previouslydefiniedname>
anka registry push -d <description> -t <tag> {vmNameOrUUID}
anka registry pull -t <tag> {vmNameOrUUID}
anka registry pull -s -t <tag> {vmNameOrUUID}
For example, let's say you have V1, V2 tags in the Registry for a VM. You pull V2. Then, you pull V1 with -s flag. It will optimize the local disk space usage by deleting all V2 related tag/version files.
anka registry push NEW_VM -v EXISTING_VM_IN_REGISTRY -t NEW_TAG
For example, let's say you have a VM1, with latest tag t2. Now, you want to push a completely independent VM2 as the next tag to VM1. You will use anka registry push VM2 -v VM1 -t NEW_TAG
.
anka registry list
Note
This is a new API introduced in version 1.7.0
Old path /registry/vm still works for backward compatibility.
Description: List all VMs stored in the Registry.
Path: /registry/v2/vm
Method: GET
Optional Query Parameters
Parameter | Type | Description |
---|---|---|
id | string | Return a specific Template. Passing this parameter will show more information about the Template's tags |
Returns:
Template format
Version format
CURL Example
# List example
curl "http://anka.registry.net:8089/registry/vm"
{
"message" : "",
"body" : [
{
"id" : "0bf1a7e8-be95-43d9-a0c8-68c6aed0f2dd",
"name" : "jenkins-slave",
"size" : 16427892736
},
{
"id" : "1820b42d-6581-46af-bf42-f64caa1e9633",
"name" : "catalina",
"size" : 20643704832
},
{
"id" : "2fa0f10e-e91e-4665-8d42-00a39b9707de",
"name" : "Catalina-Xcode-11",
"size" : 17834520576
}
],
"status" : "OK"
}
# Get Single Template
curl "http://anka.registry.net:8089/registry/vm?id=00510971-5c37-4a60-a9c6-ea185397d9b4"
{
"message" : "",
"body" : {
"name" : "android-2",
"id" : "00510971-5c37-4a60-a9c6-ea185397d9b4",
"size" : 18795192320,
"versions" : [
{
"config_file" : "00510971-5c37-4a60-a9c6-ea185397d9b4.yaml",
"state_files" : [
"c19ba955c706475e9aeade79f174a925.ank"
],
"number" : 0,
"size" : 18795192320
"description" : "",
"nvram" : "nvram",
"images" : [
"83e3eb9a2b694ddbb90f535ffae4cbb8.ank",
"fae1423d7c99419c92109c326162c2dd.ank",
"51f90db935494831a831dae51c9743e0.ank",
"2be4266d24704db2bacbbd258d0d6288.ank",
"2d07e328bfc449b58f74b3e08f8d049d.ank",
"06ad0ac5-af7a-11e8-884c-c4b301c47c6b.ank",
"237a78ab78254cde9f04f2cecaec21b7.ank",
"7ae0e540-cae2-11e8-b0c8-c4b301c47c6b.ank",
"916cd0f1087345659b70275bb8cc3101.ank",
"239bb374545141ceb481d495ec01683e.ank",
"4ef1b52304264ac2bacaa34903b7af9c.ank",
"d2da3f9b4faa49b1804af2adccf5bccd.ank",
"dd94fbf0-c6ed-11e8-920b-c4b301c47c6b.ank",
"daba8902e1d24636bc424ac44252a090.ank",
"d97298f5-a06c-11e8-964c-c4b301c47c6b.ank",
"85ab1ffd-af80-11e8-bd5e-c4b301c47c6b.ank"
],
"tag" : "t1"
}
]
},
"status" : "OK"
}
Description: Delete a specific VM and all associated tags
Path: /registry/vm
Method: DELETE
Required Query Parameters:
Parameter | Type | Description |
---|---|---|
id | string | The Template's id. |
Returns:
CURL Example
curl -X DELETE "http://anka.registry.net:8089/registry/vm?id=00510971-5c37-4a60-a9c6-ea185397d9b4"
{
"status":"OK",
"body": null,
"message":""
}
Description: Show vm configuration file for a specific version or tag (or latest if none specified) of a VM template
Path: /registry/vm/info
Method: GET
Required Query Parameters
Parameter | Type | Description |
---|---|---|
id | string | Return the VM with that ID. |
Optional Query Parameters
Parameter | Type | Description | Default |
---|---|---|---|
tag | string | The specific Tag to get info for | Latest |
version | int | The number of the version to get info for, 0 indexed | Latest |
Returns:
Object format
CURL Example
curl "http://anka.registry.net:8089/registry/vm/info?id=2fa0f10e-e91e-4665-8d42-00a39b9707de"
{
"message" : "",
"status" : "OK",
"body" : {
"nvram" : true,
"state_file" : "668e52df4d454f0fbc14cc69a15c5006.ank",
"display" : {
"frame_buffer" : {
"height" : 768,
"pci_slot" : 29,
"vnc_ip" : "0.0.0.0",
"width" : 1024,
"password" : "admin"
}
},
"version" : 1,
"usb" : {
"pci_slot" : 7,
"host" : 0,
"tablet" : 1
},
"network_cards" : [
{
"mode" : "shared",
"pci_slot" : 28,
"mac_address" : "56:45:45:3c:db:02",
"port_forwarding_rules" : [
{
"host_port" : 0,
"protocol" : "tcp",
"rule_name" : "ssh1",
"guest_port" : 22,
"host_ip" : "0"
}
]
}
],
"hard_drives" : [
{
"pci_slot" : 4,
"controller" : "ablk",
"file" : "239bb374545141ceb481d495ec01683e.ank"
}
],
"cpu" : {
"cores" : 2
},
"name" : "appium-base",
"ram" : "2G",
"uuid" : "2fa0f10e-e91e-4665-8d42-00a39b9707de",
"firmware" : {
"type" : "uefi"
}
}
}
Description: Revert a VM to a certain Tag or version number. Delete the latest version if none is specified.
Path: /registry/revert
Method: DELETE
Required Query Parameters
Parameter | Type | Description |
---|---|---|
id | string | The Template id. |
Optional Query Parameters
Parameter | Type | Description | Default |
---|---|---|---|
tag | string | The Tag to revert to. Newer versions will also be deleted | Latest |
version | int | The number of the version to revert to, 0 indexed | Latest |
Returns:
CURL Example
# Delete latest version
curl -X DELETE "http://anka.registry.net:8089/registry/revert?id=00510971-5c37-4a60-a9c6-ea185397d9b4"
{
"body" : null,
"message" : "",
"status" : "OK"
}
# Revert to the first version of the template
curl -X DELETE "http://anka.registry.net:8089/registry/revert?id=a3cc47f0-3a73-11e9-b515-c4b301c47c6b&number=0"
{
"status" : "OK",
"body" : null,
"message" : ""
}
# Revert to a specific Tag
curl -X DELETE "http://anka.registry.net:8089/registry/revert?id=a3cc47f0-3a73-11e9-b515-c4b301c47c6b&tag=p120190904183122"
{
"status" : "OK",
"body" : null,
"message" : ""
}
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.