Configuration - Docker mode

The configuration file of a Ponos agent in Docker mode is an extension of the generic Ponos agent. Only the docker section is added.

docker.network

Docker network used to launch Arkindex tasks in Docker containers.

docker.dns

Docker DNS used to launch Arkindex tasks in Docker containers.

docker.volumes

Docker volumes used to launch Arkindex tasks in Docker containers.

docker.volumes.src

Source directory of the volume.

docker.volumes.dest

Destination directory of the volume.

docker.volumes.on

Filters Arkindex tasks by Unix shell-style wildcard for which the volume must be added. By default, the volume is added to all Arkindex tasks. Otherwise the volume is only added to the Arkindex task whose slug matches the value.

docker.volumes.mode

Mode of the volume. Use ro for read-only volumes and rw for read-write volumes. Defaults to rw.

docker.registries

Docker registries to authenticate when setting up the agent.

docker.registries.url

URL of the registry to authenticate.

docker.registries.username

Username of the registry to authenticate.

docker.registries.password

Password of the registry to authenticate.

docker.fake_gpus

Fake GPUs to declare to Arkindex when setting up the agent.

docker.fake_gpus.id

ID of the fake GPU to declare. Should be in a valid format GPU-<uuid> or <uuid>.

docker.fake_gpus.name

Name of the fake GPU to declare.

docker.fake_gpus.ram_total

RAM total of the fake GPU to declare.

docker.cache_usage

Whether to check the local cache to reuse Docker images available on host. Defaults to false.

Configures the preference for using a locally cached Docker image over pulling one from the registry:

cache_first

If a locally cached Docker image exists, use it. Otherwise, pull from the registry.

This could cause cache invalidation issues: if a new version of a :latest Docker image is published, this agent will not use it until the image is removed from the cache.

This is recommended for local development, as it skips the step of pushing a locally built image to a registry before testing it.

remote_first (default)

Pull from the registry first. If this fails and a locally cached Docker image exists, use it.

This is recommended in production to avoid any downtime when a registry encounters issues.

require_pull

Always pull from the registry. If this fails, no locally cached image will be used, even if it does exist on the host.

This guarantees that the task will always run with the most up-to-date Docker image from the registry, at the cost of cascading any Docker registry or network issues down to Ponos tasks.

docker.shared_process_volume

Whether to store process data of Arkindex tasks using a Docker volume. Defaults to false.

Example

Below is an example of a YAML configuration file to start a Ponos agent in a Docker mode.

# Generic Ponos agent
...

# Ponos agent in a Docker mode
docker:
   network: arkindex_default # Defaults to `None`
   dns: # Defaults to `[]`
      - dns_server
   volumes: # Defaults to `[]`
      - src: /path/to/ark/ml-classifiers # Required
        dest: /arkindex/classifiers # Required
        "on": ml_* # Defaults to `None`
        mode: ro # Defaults to `rw`
   registries: # Defaults to `[]`
      url: https://docker.registry.com # Required
      username: teklia # Required
      password: Sup3rS3cret # Required
   fake_gpus: # Defaults to `[]`
      - id: GPU-26581030-aeb7-4eb7-9193-3e1b60ddf11a # Required
        name: Fake GPU # Required
        ram_total: 42 # Required
   cache_usage: require_pull # defaults to `remote_first`
   shared_process_volume: true # Defaults to `false`