Sandbox hosts

A sandbox host is a container or a virtual machine, and you can add multiple hosts to a sandbox. Learn more about:

  • Choosing between a container and a virtual machine (VM)

  • Provisioning a sandbox host

  • Customizing provisioning to add your own software packages and resources

Choosing between a container and a virtual machine

Instruqt supports using containers and VMs as sandbox hosts. Containers start faster, which means your learners start playing the track sooner. However, containers have a few restrictions, due to how containers work. Reasons to choose a virtual machine over a container include:

  • You need access to the Docker daemon to build and run container images

  • You require more than 8GB of system memory

If you want to install long-running system services (a database or a web server) you can choose both a container and a virtual machine. However, since most base container images do not have a process manager, the experience is better on a virtual machine.

Provisioning sandbox hosts

Before a learner can access the sandbox environment, Instruqt provisions all sandbox hosts. During provisioning, Instruqt starts the host and runs your setup scripts. You can install your own software packages and configuration on a sandbox host in two ways:

  • Using host-specific track setup scripts while the learner is waiting for the track to load

  • By creating custom container images or Compute Engine machine images.

To make sure you can make the most of both options, I want to walk you through the container and VM provisioning process first.

Container provisioning process

To provision a container, Instruqt performs these steps:

  1. Pull the image from a container registry (Docker Hub, gcr.io, or any other container registry)

  2. Start the container image to create a container

  3. Run the host-specific track setup script on the container (optional)

  4. Add the host to the sandbox

Virtual machine provisioning

To provision a VM, Instruqt performs these steps:

  1. Start a virtual machine using a machine image stored in Compute Engine storage (on Google Cloud).

  2. Run the host-specific track setup script on the virtual machine (optional)

  3. Add the host to the sandbox

Using track setup scripts to provision hosts

Track setup scripts run while the user is waiting for the track to load, and they are executed sequential on all sandbox host.

Using custom container images

Before creating your custom Docker image, make sure that the image you need is not already available on the Docker hub. To get started on building your own Docker image, head over to the Docker documentation.

When you intend on using your own Docker container images, make sure you either make them public or host them in a private Google Cloud Container Registry and grant access to the Instruqt service accounts. You can do so by granting the role roles/storage.objectViewer on the backing storage to the following Instruqt service accounts:

We do not support Windows based container images.

Public Compute Engine machine images

You can use most public Compute Engine images. Popular images include:

  • centos-cloud/centos-8

  • debian-cloud/debian-9

  • debian-cloud/debian-10

  • debian-cloud/debian-11

  • rhel-cloud/rhel-8

  • suse-cloud/sles-15

  • ubuntu-os-cloud/ubuntu-2004-lts

  • ubuntu-os-cloud/ubuntu-2104

Instruqt Compute Engine machine images

As part of our templates, we maintain two Compute Engine images:

  • instruqt/k3s-v1-20-4

  • instruqt/docker-2010

Using custom Compute Engine machine images

To create your own VM image, head over to the Packer documentation. If you need some inspiration, you can browse our GitHub organization and search for our packer repositories.

If you want to use your own virtual machine images you need to host them publicly, or grant Instruqt access. Grant the role roles/compute.imageUser to the Instruqt service account: [email protected]

If you need more guidance, read the Google Cloud documentation on sharing custom compute images between organizations.