This tutorial describes how to configure W&B Launch to use Docker on a local machine for both the launch agent environment and for the queue’s target resource. By the end, you have a working Docker-based launch queue and a local launch agent ready to run ML jobs. Using Docker to run jobs and as the launch agent’s environment on the same local machine is useful if your compute is installed on a machine that doesn’t have a cluster management system (such as Kubernetes). You can also use Docker queues to run workloads on workstations.Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-docs-2661.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
This setup is common for users who run experiments on their local machine, or who SSH into a remote machine to submit launch jobs.
docker run [IMAGE-URI] command. W&B interprets the queue configuration as additional arguments passed to the docker run command.
Configure a Docker queue
A queue configuration for a Docker target resource defines how Launch translates queue options into adocker run command.
The launch queue configuration (for a Docker target resource) accepts the same options defined in the docker run CLI command.
The agent receives options defined in the queue configuration. The agent then merges the received options with any overrides from the launch job’s configuration to produce a final docker run command that runs on the target resource (in this case, a local machine).
Two syntax transformations take place:
- Define repeated options in the queue configuration as a list.
- Define flag options in the queue configuration as a boolean with the value
true.
docker run command:
MY_EXISTING_ENV_VAR, that variable is available in the container. This is useful if you want to use other config keys without publishing them in the queue configuration.
The --gpus flag of the docker run command lets you specify GPUs that are available to a Docker container. For more information about the --gpus flag, see the Docker documentation.
- Install the NVIDIA Container Toolkit to use GPUs within a Docker container.
-
If you build images from a code or artifact-sourced job, you can override the base image used by the agent to include the NVIDIA Container Toolkit.
For example, within your launch queue, you can override the base image to
tensorflow/tensorflow:latest-gpu:
Create a queue
To create a queue that uses Docker as the compute resource, follow these steps:- Navigate to the Launch page.
- Click the Create Queue button.
- Select the Entity you want to create the queue in.
- Enter a name for your queue in the Name field.
- Select Docker as the Resource.
- Define your Docker queue configuration in the Configuration field.
- Click the Create Queue button.
Configure a launch agent on a local machine
Configure the launch agent with a YAML config file namedlaunch-config.yaml. By default, W&B checks for the config file in ~/.config/wandb/launch-config.yaml. You can optionally specify a different directory when you activate the launch agent.
You can use the W&B CLI to specify core configurable options for the launch agent (instead of the config YAML file): maximum number of jobs, W&B entity, and launch queues. See the
wandb launch-agent command for more information.Core agent config options
The following tabs demonstrate how to specify the core config agent options with the W&B CLI and with a YAML config file:- W&B CLI
- Config file
Docker image builders
You can configure the launch agent on your machine to build Docker images. By default, your machine’s local image repository stores these images. To enable your launch agent to build Docker images, set thebuilder key in the launch agent config to docker:
launch-config.yaml
builder key in the launch agent config to noop:
launch-config.yaml