This repository contains a Terraform script to deploy the resources required by a Valohai Hybrid setup in GCP.
- Install Terraform
- Install gcloud
- Initialize gcloud with
gcloud init
Make sure you've activated the following APIs in your GCP Project:
Before running the template you'll need the following information from Valohai:
queue_address
that will be used for your queuevalohai_email
of the account Valohai will use to assume the generated service account in your GCP.
You'll need to generate default authentication credentials that Terraform can use from your workstation with gcloud auth application-default login
. Look for the "Credentials saved to file" line to see where the file was saved. You'll need it in the next step.
You can read more about GCP authentication and Terraform here.
Review the variables.tfvars
file and add your project and region details.
- Run
terraform init
to initialize a working directory with Terraform configuration files. - Run
terraform plan -out="valohai-init" -var-file=variables.tfvars
to create an execution plan and see what kind of changes will be applied to your GCP Project. - Finally execute
terraform apply "valohai-init"
to configure the resources needed for a Valohai Hybrid GCP Installation.
After you've created all the resources, you'll need to share the outputs with Valohai (external-ip
and project
)
To remove all of the created Valohai resources empty your valohai-data
Google Cloud Storage bucket and run terraform destroy -var-file=variables.tfvars
.