This example is a minimal example of what is needed to deploy an instance of Weights & Biases that uses a Domain hosted in Route53.
As with the main version of this module, this example assumes the following resources already exist:
- A valid Cloud DNS for the provided domain
- Valid W&B Local license (You get one at here)
- You can download terraform by following one of the methods here[https://www.terraform.io/downloads]
- The required version of terraform for this module is v1.1.7 or greater
- If you operate with multiple terraforms,
tfenv
is a great tool that allows switching between different terraform versions
- If you already have an existing domain, you could create a sub-domain for that domain and use that for W&B.
- If you don't have an existing domain, please see below on how to create one
- Navigate to Cloud DNS from the GCP console
- Then, click on
Create Zone
- Enter your Zone name and DNS name
- Click
Create
- Once you’ve created a zone & DNS in the above step, click on that Zone name
- Click on
Add Record Set
- Add your sub-domain in the DNS name field
- You can choose to leave the defaults for Resource Record Set, TTL and Routing Policy
- Add the IPv4 Address (you’ll get this as an output of
terraform apply
) - Then click
Create
Note: The domain and subdomain association might take a few minutes to reflect.
- Once you login to the GCP dashboard, you should see an option similar to the following image
- Click on the Project name, in this case it’s WandB Sandbox
- This will open a dialog similar to this
- You can find the ID of the project here, in this case
playground-111
- Firstly, identify the region you’d like to deploy the W&B application
- A list of all the regions and zones available in GCP can be found here[https://cloud.google.com/compute/docs/regions-zones]
- Once you’ve identified the region and the zone, make sure to input the name in the same format into the
terraform.tfvars
file below
- First authorize your google account by running the command
gcloud auth login
- This would take you to the browser to select the google account to authenticate with GCP
- Once the google account is selected and authorized, you should see a message similar to:
You are now logged in as [[email protected]]. Your current project is [playground-111]. You can change this setting by running: $ gcloud config set project PROJECT_ID Updates are available for some Cloud SDK components. To install them, please run: $ gcloud components update To take a quick anonymous survey, run: $ gcloud survey
- Clone the Github repository to get access to the W&B’s google terraform module
- As a next step, navigate to the examples directory in the terraform-google-wandb repo
- Then,
cd public-dns-with-cloud-dns
- Then,
- Now, create a file called
terraform.tfvars
under the current directory terraform.tfvars
should have the following variables included,Refer to sections above to see how you can obtain these values An exampleproject_id = "<id-of-the-project-in-gcp>" region = "<gcp-region-to-deploy>" zone = "<gcp-zone-to-deploy>" namespace = "<unique-name-for-the-namespace>" license = "<W&B-license-key>" subdomain = "<subdomain-for-accessing-the-UI>" domain_name = "<domain-for-accessing-the-UI>" allowed_inbound_cidrs = ["<allowed ip ranges>"]
terraform.tfvars
file would look like this,project_id = "playground-111" region = "us-west4" zone = "us-west4-a" namespace = "venky-unique-3" license = "W&B-license-key goes here" subdomain = "venky" domain_name = "wandb.ml" allowed_inbound_cidrs = ["0.0.0.0/0"]
- First step is to initialize the terraform module in the current directory, you can do that by running
terraform init
This initializes all the required modules to successfully deploy the W&B infrastructure
- If you are running into an error like
Error: Failed to query available provider packages
just run the following command:
terraform init -upgrade
This makes sure all the terraform initialization version requirements are satisfied by downloading the latest terraform module versions
- Once the terraform is initialized and you have all the values set in the
terraform.tfvars
, you should be able to apply the terraform by running the following command:
terraform apply
- This will output a plan of all the resources to be created by terraform in your GCP account
- The terminal prompts to enter
yes
, if you intend to continue - Once you input
yes
the terraform creation process begins - It takes ~10 minutes to create all the resources