GCP
Set up and deploy a Granica Admin Server on Google Cloud Platform using Terraform.
Prerequisites
If you are working in Cloud Shell you must be logged in as Admin. If you are running from your laptop you will need GCloud command line credentials that give administrator access.
- Create your own GCP Project (by default you will have admin access for this project).
- A GKE pod secondary range sized per Subnet sizing requirements.
Subnet sizing requirements
Granica runs its data plane (Spark executors for Crunch, plus platform services) on Kubernetes, and pod-IP capacity is bounded by the IP range that pods draw from. Size that range at least to the minimum below:
| Prefix | Usable IPs | Suitability for Crunch |
|---|---|---|
/20 | ~4,000 | Recommended — full fan-out, large headroom |
/21 | ~2,000 | Good |
/22 | ~1,000 | Minimum for a Crunch fan-out |
/23 and smaller | ≤500 | Not recommended — pods fail to get IPs and Crunch stalls or fails |
GKE uses alias IP ranges: pods draw from a secondary pod range, while nodes use the subnet's primary range. Size the pod secondary range per the table above; size the node (primary) range for peak node count and the services secondary range for the number of Kubernetes services.
The real requirement scales with peak concurrent nodes/pods × IPs reserved per node, so large workloads need more. Below /22, Spark executors cannot obtain pod IPs and Crunch stalls or fails. There is no pre-flight capacity check today, so the shortfall only surfaces at runtime. Prefer a larger range over working around it.
Instructions
1. Enable GCP APIs
gcloud services enable storage.googleapis.com
gcloud services enable iam.googleapis.com
gcloud services enable cloudresourcemanager.googleapis.com
gcloud services enable networkmanagement.googleapis.com
gcloud services enable container.googleapis.com
gcloud services enable logging.googleapis.com
gcloud services enable pubsub.googleapis.com
gcloud services enable compute.googleapis.com
gcloud services enable sqladmin.googleapis.com
gcloud services enable servicenetworking.googleapis.com2. Install Terraform
git clone https://github.com/tfutils/tfenv.git ~/.tfenv
mkdir ~/bin
ln -s ~/.tfenv/bin/* ~/bin/
export PATH="$HOME/.tfenv/bin:$PATH"
tfenv install 1.13.4
tfenv use 1.13.4
terraform --version
git clone https://github.com/granica-ai/granica-setup.git
cd granica-setup/gcp3. Create a GCS bucket for Terraform state
gcloud storage buckets create gs://<bucket-name> --location <region>4. Configure backend.conf
bucket = "<name of bucket that will host admin server tf state>"
prefix = "<prefix to store state>"5. Configure terraform.tfvars
project_id = "your-gcp-project-id"
region = "us-central1"
zone = "us-central1-a"
package_url = "https://granica.ai/granica.rpm"
server_name = "CHANGE_ME"6. Deploy the admin server
terraform init -backend-config=backend.conf
terraform apply7. Log in to the admin server
gcloud compute ssh granica-admin-server-{server_name} --project=<project-id> --zone=<zone> --tunnel-through-iapUse the
gcloudcommand printed at the end ofterraform applyto SSH into the admin server.
Once connected:
sudo su - granica # Use the granica user to run granica commands
# The Granica RPM takes around 10-15 minutes to install.
# Monitor progress:
tail -f /var/log/dnf.rpm.log
# For more debug output:
tail -f /var/log/startup-script.log
granica --help
granica deploy --var-file config.tfvars
# Cluster deployment takes around 10-15 minutes.AWS
Set up and deploy a Granica Admin Server on AWS using Terraform.
Azure
Set up and deploy a Granica Admin Server on Microsoft Azure using Terraform.