This repository provides a tutorial on deploying a Ritual Infernet node to Google Cloud. We will deploy the hello-world
container located under projects/hello-world/container
. See here for the smart contracts of the hello-world container
This example focuses on deploying a local container. Modifications have been made to procure/prepare_files.sh and procure/gcp/scripts/node.tpl to work with local Docker container files.
If you have published your Infernet Docker container image, follow the original instructions.
- Install Terraform
- Before you begin, ensure you have enabled the Compute Engine API on your Google Cloud project.
Navigate to the GCP directory and create a service account using the script provided:
cd procure/gcp
chmod 700 create_service_account.sh
./create_service_account.sh
Make a copy of the example configuration file terraform.tfvars.example
:
cd procure/gcp
cp terraform.tfvars.example terraform.tfvars
Update the following settings in the terraform.tfvars
file:
-
service_account_email: Replace the
project
in[email protected]
with your Google Cloud project ID. You can check the service account email from your Google Cloud project. -
project: Change this to your Google Cloud project ID.
-
ip_allow_ssh: Add
35.235.240.0/20
(Google Cloud IAP) to allow access to the VM instance SSH in the browser. -
region and zone: Check your available zones and regions in Google Cloud "Compute Engines". The ones listed in the example might not be available for your project.
-
router.image: The starter scripts in procure/gcp/scripts/node.tpl use the Ubuntu Focal stable version. Ensure your image supports Ubuntu Focal stable installation. Choose an image that can install Ubuntu Focal stable, such as
ubuntu-minimal-2004-focal-v20240519
. -
nodes: List your node settings here. The node configuration name should match the name. For example, if you define a node named "my-node-123", the node configuration name should be
my-node-123.json
.
Follow the remaining instructions to complete the deployment process.
# Initialize
cd procure
make init provider=gcp
# Print deployment plan
make plan provider=gcp
# Deploy
make apply provider=gcp
For any issues or further guidance, refer to the original instructions.