Install Anbox Cloud
With this quick start guide and some tools from Canonical, you’ll have a Anbox Cloud running on the cloud of your choice in minutes!
What you’ll need
For the quickstart into Anbox Cloud you will need the following things:
- An Ubuntu 18.04 LTS or 20.04 LTS environment to run the commands (or another operating system which supports snaps - see the snapcraft documentation)
- Account credentials for one of the following public clouds:
- Your Ubuntu Advantage for Applications token. If you don’t have yours yet, get it from https://ubuntu.com/advantage or speak to your Canonical representative
WARNING: The Ubuntu Advantage for Infrastructure token every user gets for free for personal use does NOT work and will result in a failed deployment!
NOTE: If you don’t meet these requirements, there are additional ways of installing the Anbox Cloud. Please. see the more general Custom installation page for details.
Juju is a tool for deploying, configuring, and operating complex software on public or private clouds.
It can be installed with a snap:
$ sudo snap install juju --classic
Find Your Cloud
Juju has baked in knowledge of many public clouds such as AWS, Azure and Google. You can see which ones are ready to use by running this command:
$ juju clouds
Most clouds require credentials so that the cloud knows which operations are authorised, so you will need to supply these for Juju. If you choose to use AWS, for example, you would run:
$ juju add-credential aws
For a different cloud, just substitute in the name from the previous list output by Juju. The data you need to supply will vary depending on the cloud.
Add a Controller
The Juju controller is used to manage the software deployed through Juju, from deployment to upgrades to day-two operations. One Juju controller can manage multiple projects or workspaces, which in Juju are known as ‘models’.
$ juju bootstrap aws my-controller
Add a Model
The model holds a specific deployment. It is a good idea to create a new one specifically for each deployment.
$ juju add-model anbox-cloud
Remember that you can have multiple models on each controller, so you can deploy multiple versions of Anbox Cloud, or other applications.
Ubuntu Advantage Subscription
Every deployment of Anbox Cloud needs to be attached to the Ubuntu Advantage service Canonical provides. This provides your deployment with the correct licenses you’re granted as part of your license agreement with Canonical next to other services available through your subscription like Livepatch.
You can get your Ubuntu Advantage for Applications token at https://ubuntu.com/advantage after logging in. Please record the token as you will need it for every deployment of Anbox Cloud.
WARNING: The free Ubuntu Advantage for Infrastructure token every user gets for free for personal use does NOT work and will result in a failed deployment!
In preparation for the next steps, please create an overlay file named
ua.yaml for the deployment process via Juju which should like this:
applications: ams: options: ua_token: <your token> ams-node-controller: options: ua_token: <your token> lxd: options: ua_token: <your token> anbox-stream-agent: options: ua_token: <your token> anbox-stream-gateway: options: ua_token: <your token>
You will use the overlay file in the next steps.
Deploy Anbox Cloud
Deploy the Anbox Cloud bundle to the Juju model. This will add instances to the model and deploy the required applications. The core version provides the minimized version of Anbox Cloud which is enough for smaller scale use cases, e.g. application testing or automation or if you generally don’t want to use the Anbox Cloud streaming stack.
$ juju deploy cs:~anbox-charmers/anbox-cloud-core --overlay ua.yaml
If you’re interested in deploying Anbox Cloud with its streaming stack included, you need to use the
cs:~anbox-charmers/anbox-cloud bundle instead and specify which GPU instance type should be used.
Hint: You can find the same machine definition in the actual anbox-cloud bundle.
Creating an overlay for the Juju bundle allows you to specify the exact instance types instead of letting Juju figure them out iself:
machines: '0': series: bionic constraints: "instance-type=m4.xlarge root-disk=40G" '1': series: bionic constraints: "instance-type=m4.xlarge root-disk=40G" '2': series: bionic constraints: "instance-type=g3s.xlarge root-disk=50G" '3': series: bionic constraints: "instance-type=m4.xlarge root-disk=40G"
This will use the g3s.xlarge instance type on AWS which includes an Nvidia Tesla M60 GPU.
With that overlay we can now deploy Anbox Cloud with the streaming stack included.
$ juju deploy cs:~anbox-charmers/anbox-cloud --overlay ua.yaml --overlay overlay.yaml
Monitor the Deployment
Juju is now busy creating instances, installing software and connecting the different parts of the cluster together, which can take several minutes. You can monitor what’s going on by running:
$ watch -c juju status --color
Perform necessary reboots
In some cases a reboot of the LXD machines is necessary, for example when deploying on AWS and the Ubuntu 18.04 GA kernel is selected which is based on the upstream 4.15 release. As Anbox Cloud requires a Ubuntu kernel with a minimum version of 5.0 the kernel needs to be changed. The LXD charm already takes care of installing a newer kernel but the final reboot as to be performed manually.
If you need to reboot, you can see in the output of the
juju status command:
$ juju status ... Unit Workload Agent Machine Public address Ports Message lxd/0* active idle 3 10.75.96.23 reboot required to activate new kernel ...
To reboot the machine hosting LXD you can perform the following command
$ juju ssh lxd/0 -- sudo reboot
When the machine is back running you have to manually clear the status of the LXD units
$ juju run-action --wait lxd/0 clear-notification
Once done the reboot operation is finished.
Start using Anbox Cloud!
Congratulations! You have Anbox Cloud up and running - now let’s use it! The link below takes you to the operations guide, detailing some of the common things you’ll want to do next:
Note: This guide gets you up and running with Anbox Cloud quickly. If you want to explore how to customise your install, please see the Installation page for a more detailed guide.
Last updated a month ago.