Off-the-shelf Docker images

If you want to use an off-the-shelf public docker  image, use one of the generic docker profiles. The most common are:

  1. docker-batch: for batch computation that does not need a network connection.
  2. docker-network: for a task  that requires an internet access.
  3. docker-network-ssh: for tasks that need to be accessed through ssh.
  4. docker-cluster: for tasks that run on a cluster of multiple nodes  .

Use a public image on the Docker Hub

To specify a docker image, simply fill in the following constants:

Then specify the command to run in the container with the constant DOCKER_CMD (ENTRYPOINT of the image will be honored but CMD of the image will be replaced by DOCKER_CMD).

You can run any docker images available on the Docker Hub. We’ll take the example of the Hello World docker image that we will run using the Python SDK  - see Launching a computation with a SDK for more information:

import qarnot

conn = qarnot.connection.Connection(client_token='<<<MY_SECRET_TOKEN>>>')

task = conn.create_task('Hello World from Docker Hub', 'docker-batch')

task.constants['DOCKER_REPO'] = 'hello-world'
task.constants['DOCKER_TAG'] = 'latest'

task.run()
print(task.stdout())

Related Articles

To start using docker images on Qarnot please read the following guides: