Prerequisites
Before you use W&B Launch ensure you have satisfied these prerequisites.
- Enable the W&B Launch feature flag.
- Create a queue.
- Activate a launch agent.
The steps required to create a queue and activate a launch agent depend on whether or not your queue will use a cloud compute resource (such as Kubernetes on EKS) or use a local Docker container that uses your machine's hardware.
Based on your use case, read the following to sections to satisfy W&B Launch prerequisites for setting up a cloud resources or setting up a local Docker container for testing.
Prerequisites for both cloud and local testing
Enable Launch
Before you get started, ensure you enable the W&B Launch UI and install Docker. Follow these steps to enable W&B Launch:
- Navigate to your settings page at https://wandb.ai/settings .
- Scroll to the Beta Features sections. Toggle the
W&B Launch
option.
Install Docker
See the Docker documentation for more information on how to install Docker. Make sure Docker is running on your local machine.
Set up cloud compute resource
Set up a cloud compute resource and a launch agent to communicate with the cloud resource. To do this, create a queue that is configured to use a cloud resource.
Create a queue
A queue is where you add W&B Jobs to. Launch Queues possess one or more W&B Jobs that are executed when you start a W&B Launch agent. A Launch Queue can use any resource configuration that is defined within a given W&B Entity. Queues give your team members access to specific types of compute resources so they can easily launch jobs at scale.
- Navigate to the W&B App at https://wandb.ai/home.
- Select Launch within the Applications section of the left sidebar.
- Choose Create queue.
- Select the queue's entity from the Entity dropdown menu.
- Provide a name for the queue in the Queue name field
- Specify a compute resource from the Resource dropdown menu. Within the modal, specify the compute configuration in the Configuration editor.
W&B currently supports compute configuration for Kubernetes on EKS. For more information on configuration details, contact sales at https://wandb.ai/site/local-contact.
You must use Amazon’s Elastic Container Registry (ECR) to use Kubernetes on EKS. Additionally, you will also need an Amazon Simple Storage Service (S3) bucket if you want to build your own Docker container.
Activate a launch agent
A launch agent listens the queue and executes jobs added to the queue. If certain criteria are met, the launch agent builds an image for the environment and sends the job to the desired compute runner.
The following tabs provide information on how to activate a launch agent with basic, standard control settings and with more control options with a config file.
- Basic
- EKS
Activate a launch agent in your terminal with the wandb launch-agent
command:
wandb launch-agent -q <queue-name>
Provide a name for your queue for the queue
flag (-q
). For more information on optional flags, see the CLI Reference Guide.
For more control options a config file can be placed at ~/.config/wandb/launch-config.yaml
(or the path can be specified with the config flag).
base_url: https://api.wandb.ai # TODO: set wandb base url
entity: <entity-name>
max_jobs: -1 # TODO: set max concurrent jobs here
queues:
- default # TODO: set queue name here
environment:
type: aws
region: us-east-1 # TODO: set aws region here
registry:
type: ecr
repository: # TODO: set ecr repository name here
builder:
type: kaniko
build-context-store: s3://my-bucket/... # TODO: set your build context store here
Environment Flags and Options
type
: specified the environment type, options:local
andaws
.region
: only used with AWS environment, AWS region.
Registry Flags and Options:
type
: specifies the registry type, options:local
(default) andecr
(ECR requiresaws
environment).repository
: only used with ECR, the name of the underlying repository.
Builder Flags and Options:
type
: specifies type: options:docker
,noop
,kaniko
- defaults to docker builder
noop
provides no build capabilities, used for launching image sourced jobskaniko
only used inEKS
build-context-store
: only used with kaniko (EKS)
Local testing with Docker
Set up a queue for local testing with Docker.
The following section describes how to create a "Starter queue". This is a queue that W&B created for local testing purposes only. This means that you do not need to manually configure the queue.
The "Starter queue" uses a Docker image to run the job locally on your machine. Ensure you have Docker installed and running. See the Docker documentation for instructions on how to install Docker based on your operating system.
Create a starter queue
The following procedure demonstrates how to create a starter queue:
- Navigate to your W&B Project Page.
- Select the Jobs Tab from the W&B App Project page.
- The Jobs Page displays a list of jobs that were created from previously executed W&B Runs. tip
If you do not see a job you will need to create one first. See the Create a job page for more information.
- Select the Launch button next to the name of the Job name. A modal will appear.
- Within the modal select Starter queue From the Queue dropdown.
Activate a launch agent
Launch queues require an active agent. To start an agent for a local process you will need to execute a CLI command in your local machine’s terminal.
- Navigate to the W&B App at https://wandb.ai/home.
- Select Launch within the Applications section of the left sidebar.
- Select View queue next to the name of your queue.
Select the Add an agent button at the top of your screen.
A modal will appear with a W&B CLI command. Copy this and paste this command into your terminal.
Within your terminal, you will see the agent begin to poll for queues. Your terminal should look similar to the following image: