W&B recommends fully managed deployment options such as W&B Multi-tenant Cloud or W&B Dedicated Cloud deployment types. W&B fully managed services are simple and secure to use, with minimum to no configuration required.
mandatory
components:
- VPC
- Cloud SQL for MySQL
- Cloud Storage Bucket
- Google Kubernetes Engine
- KMS Crypto Key
- Load Balancer
- Memory store for Redis
- Pub/Sub messages system
Pre-requisite permissions
The account that will run the terraform need to have the roleroles/owner
in the GCP project used.
General steps
The steps on this topic are common for any deployment option covered by this documentation.-
Prepare the development environment.
- Install Terraform
- We recommend creating a Git repository with the code that will be used, but you can keep your files locally.
- Create a project in Google Cloud Console
- Authenticate with GCP (make sure to install gcloud before)
gcloud auth application-default login
-
Create the
terraform.tfvars
file. Thetvfars
file content can be customized according to the installation type, but the minimum recommended will look like the example below.The variables defined here need to be decided before the deployment because. Thenamespace
variable will be a string that will prefix all resources created by Terraform. The combination ofsubdomain
anddomain
will form the FQDN that W&B will be configured. In the example above, the W&B FQDN will bewandb-gcp.wandb.ml
-
Create the file
variables.tf
For every option configured in theterraform.tfvars
Terraform requires a correspondent variable declaration.
Deployment - Recommended (~20 mins)
This is the most straightforward deployment option configuration that will create allMandatory
components and install in the Kubernetes Cluster
the latest version of W&B
.
-
Create the
main.tf
In the same directory where you created the files in the General Steps, create a filemain.tf
with the following content: -
Deploy W&B
To deploy W&B, execute the following commands:
Deployment with REDIS Cache
Another deployment option usesRedis
to cache the SQL queries and speedup the application response when loading the metrics for the experiments.
You need to add the option create_redis = true
to the same main.tf
file specified in the recommended Deployment option section to enable the cache.
Deployment with External Queue
Deployment option 3 consists of enabling the externalmessage broker
. This is optional because the W&B brings embedded a broker. This option doesn’t bring a performance improvement.
The GCP resource that provides the message broker is the Pub/Sub
, and to enable it, you will need to add the option use_internal_queue = false
to the same main.tf
specified in the recommended Deployment option section
Other deployment options
You can combine all three deployment options adding all configurations to the same file. The Terraform Module provides several options that can be combined along with the standard options and the minimal configuration found inDeployment - Recommended
Manual configuration
To use a GCP Storage bucket as a file storage backend for W&B, you will need to create a:Create PubSub Topic and Subscription
Follow the procedure below to create a PubSub topic and subscription:- Navigate to the Pub/Sub service within the GCP Console
- Select Create Topic and provide a name for your topic.
- At the bottom of the page, select Create subscription. Ensure Delivery Type is set to Pull.
- Click Create.
pubsub.admin
role on this subscription. For details, see https://cloud.google.com/pubsub/docs/access-control#console.
Create Storage Bucket
- Navigate to the Cloud Storage Buckets page.
- Select Create bucket and provide a name for your bucket. Ensure you choose a Standard storage class.
- access to the bucket you created in the previous step
storage.objectAdmin
role on this bucket. For details, see https://cloud.google.com/storage/docs/access-control/using-iam-permissions#bucket-add
Your instance also needs the
iam.serviceAccounts.signBlob
permission in GCP to create signed file URLs. Add Service Account Token Creator
role to the service account or IAM member that your instance is running as to enable permission.- Enable CORS access. This can only be done using the command line. First, create a JSON file with the following CORS configuration.
- Make sure you have
gcloud
installed, and logged into the correct GCP Project. - Next, run the following:
Create PubSub Notification
Follow the procedure below in your command line to create a notification stream from the Storage Bucket to the Pub/Sub topic.You must use the CLI to create a notification stream. Ensure you have
gcloud
installed.- Log into your GCP Project.
- Run the following in your terminal:
Configure W&B server
- Finally, navigate to the W&B
System Connections
page athttp(s)://YOUR-W&B-SERVER-HOST/console/settings/system
. - Select the provider
Google Cloud Storage (gcs)
, - Provide the name of the GCS bucket

- Press Update settings to apply the new settings.
Upgrade W&B Server
Follow the steps outlined here to update W&B:- Add
wandb_version
to your configuration in yourwandb_app
module. Provide the version of W&B you want to upgrade to. For example, the following line specifies W&B version0.48.1
:
Alternatively, you can add the
wandb_version
to the terraform.tfvars
and create a variable with the same name and instead of using the literal value, use the var.wandb_version
- After you update your configuration, complete the steps described in the Deployment option section.