Welcome! This tutorial guides you through setting up your Anka Build Cloud on Linux using Docker and Docker-Compose.
While it's possible to run Docker on mac, it's not recommended. An Anka Controller & Registry package exists.
curl -L -o AnkaVirtualization.pkg https://veertu.com/downloads/anka-virtualization-latest
sudo installer -pkg AnkaVirtualization.pkg -tgt /
❯ anka version
Anka version 2.X.X (build XXX)
For Anka CLI commands and options, see the Command Reference.
Preferences -> Software Update -> Advanced
, make sure Download new updates when available
is checked but Install macOS updates
is not. While you're still within Software Update
, click Update Now
but do not install the next version (Restart) until after you've created the Anka VM or the Install .app under /Applications will be deleted.softwareupdate
: sudo softwareupdate --fetch-full-installer --full-installer-version 10.15.6
./create-vm-template.bash --no-anka-create
sudo anka create --ram-size 8G --cpu-count 4 --disk-size 80G \
--app /Applications/Install\ macOS\ Catalina.app 10.15.6
You can find detailed instructions for
anka create
here.
You can continue on to Step 2 while you wait for this to finish.
Perform the following steps on the machine intended to run the Controller & Registry.
FULL_FILE_NAME=$(echo $(curl -Ls -r 0-1 -o /dev/null -w %{url_effective} https://veertu.com/downloads/ankacontroller-registry-docker-latest) | cut -d/ -f4)
PARTIAL_FILE_NAME=$(echo $FULL_FILE_NAME | awk -F'.tar.gz' '{print $1}')
mkdir -p $PARTIAL_FILE_NAME
cd $PARTIAL_FILE_NAME
curl -Ls https://veertu.com/downloads/ankacontroller-registry-docker-latest -o $FULL_FILE_NAME
tar -xzvf $FULL_FILE_NAME
You can also manually download the file called “Cloud Controller & Registry (Run on Linux Instance)” from the Anka Build Download page.
We'll need to do two things:
First, edit the docker-compose.yml
.
Under anka-controller > environment
, find the variable ANKA_REGISTRY_ADDR.
Next to it, replace ***EDIT_ME*** with the URL of your Registry:
. . .
anka-controller:
build:
context: .
dockerfile: anka-controller.docker
ports:
- "80:80"
# To change the port, change the above line: - "CUSTOM_PORT:80"
###### EDIT HERE FOR TLS ########
# volumes:
# Path to ssl certificates directory
# - ****EDIT_ME****:/mnt/cert
depends_on:
- etcd
# - beanstalk
- anka-registry
restart: always
environment:
# Address of anka registry. this address will be passed to your build nodes
ANKA_REGISTRY_ADDR: ****EDIT_ME****
# Local Anka registry address
# This address is used by the Controller.
. . .
It should look like:
ANKA_REGISTRY_ADDR: http://<ip>:8089
Under anka-registry > volumes
, find the line that says # - ****EDIT_ME****:/mnt/vol.
First, uncomment this line by removing the # sign from the head of the line. Then replace ****EDIT_ME**** with the path on your machine where you want the Registry files to be saved:
. . .
anka-registry:
build:
context: .
dockerfile: anka-registry.docker
ports:
- "8089:8089"
# To change the port change the above line: - "CUSTOM_PORT:8089"
restart: always
volumes:
###### EDIT HERE ########
# Path to registry data folder.
# VM data files and logs will be saved in this folder
# - ****EDIT_ME****:/mnt/vol
# Path to ssl certificates directory
# - ****EDIT_ME****:/mnt/cert
. . .
It should look like:
- /var/anka:/mnt/vol
If you're running these containers on mac, you need to also change etcd's local volume destination from
/var/etcd-data
to a writable location on your mac.
Ensure you're in the same directory as the
docker-compose.yml
.
docker-compose up -d
This command builds your containers and runs the services defined as a daemon.
To stop the docker containers, run:
docker-compose down
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
aa1de7c150e7 test_anka-controller "/bin/bash -c 'anka-…" About a minute ago Up About a minute 0.0.0.0:80->80/tcp test_anka-controller_1
0ac3a6f8b0a1 test_anka-registry "/bin/bash -c 'anka-…" About a minute ago Up About a minute 0.0.0.0:8089->8089/tcp test_anka-registry_1
03787d28d3a3 test_etcd "/usr/bin/etcd --dat…" About a minute ago Up About a minute test_etcd_1
Anka Controller should be listening on port 80 (HTTP). Try pointing your browser to the machine's IP or hostname. You can use localhost
or 127.0.0.1
if you're on the Controller machine.
Your new dashboard should look like the picture below
Let's take a look at what is now running on your machine:
Make configurations by editing docker-compose.yml
. Most of the stuff you can configure is listed there but commented out.
Check out the variables under the environment
section of each service. A full reference is available.
Containers are writing logs to stderr, making them available to Docker.
To see the Controller's logs:
docker logs --tail 100 -f test_anka-controller_1
To see the Registry's logs:
docker logs --tail 100 -f test_anka-registry_1
The log level can be modified from the default 0 value. The higher the number, the more verbose the logging. (reference)
Great! Now that we have our Anka Controller & Registry up and running, let's add Nodes!
Perform the following steps on the Node where you created your first VM Template.
We now need to configure the Registry on this machine so we can push/upload the local VM Template we created earlier. Uploading the Template to the Registry makes it possible to download and run it from other nodes.
Assuming you haven't changed the default port configuration, your Registry is serving requests on port 8089
.
sudo anka registry add <registry name here> http://<ip>:8089
Verify the configuration:
sudo anka registry list-repos
++
++
<registry name you set> (default)
+--------+------------------+
| host | <the ip you set> |
+--------+------------------+
| scheme | http |
+--------+------------------+
| port | 8089 |
+--------+------------------+
Then, confirm the registry list command doesn't throw any failures:
sudo anka registry list
sudo anka registry push 10.15.X -t base
After the push completes, you should see your new Template in the “Templates” section of the controller UI.
sudo ankacluster join http://<ip>
Password:
Testing connection to controller...: Ok
Testing connection to the registry...: Ok
Ok
Cluster join success
<ip>
with the IP of the machine hosting your controller:The command may hang for a few moments and then display Cluster join success
. Please report any errors you find to support@veertu.com.
Go to your Controller dashboard and click on the Instances tab:
Click on Create Instance(s), and the Create New Instances view displays:
Select the VM Template and click Start. The Create New Instances view closes and returns you to the Instances view. You should now see the Instance in a Scheduling or Pulling State:
After the Scheduling and Pulling finishes, the VM starts on one of the Nodes and shows a Started State in the Controller UI:
You can now confirm the Instance is running from inside the Node:
anka --machine-readable
sudo anka --machine-readable list | jq
{
"status": "OK",
"body": [
{
"status": "suspended",
"name": "catalina",
"stop_date": "2020-04-01T21:30:59.798697Z",
"creation_date": "2020-04-01T00:00:13.656296Z",
"version": "base",
"uuid": "10c720eb-dcce-46f7-baa3-28bacef0ec0f"
},
{
"status": "running",
"name": "mgmtManaged-catalina-1585776660490226000",
"stop_date": "2020-04-01T21:36:11.742662Z",
"creation_date": "2020-04-01T21:31:01.055250Z",
"version": "",
"uuid": "dcbeb319-421a-4d30-8466-194eb7fa5f75"
}
],
"message": ""
}
/usr/bin/anka-controller
/var/log/anka-controller
. It's also possible to get the logs through docker logs
command./usr/bin/anka-registry
/var/log/anka-registry
. It's also possible to get the logs through docker logs
command./mnt/vol
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.