Experimental solutions for deploying Tangle to Google Cloud.
- Storage for artifacts and logs:
- Google Cloud Storage buckets:
- Artifacts:
gs://<bucket-artifacts>/artifacts - Logs:
gs://<bucket-logs>/logs
- Artifacts:
- Google Cloud Storage buckets:
- Cluster for running executions:
- A Google Kubernetes Engine Cluster
- Executions Namespace: A Kubernetes Namespace (or the "default" namespace)
- Executions Service Account: A Kubernetes Service Account (or the "default" service account). Must have write access to the artifacts bucket.
- A Google Kubernetes Engine Cluster
- Database:
- A Google Cloud SQL database.
- (A local Sqlite database like
sqlite:///db.sqlitecan be used for local testing.)
- Backend deployment: Backend can be deployed to Kubernetes or Google Cloud Run Service. For testing purposes, the backend can be executed locally.
- Permissions and access:
- The Backend Service Account needs write permissions to the artifact and log buckets
- The Executions Service Account must have write access to the artifacts bucket.
- The Backend Service Account must have permissions to create pods in the Kubernetes Engine Cluster in the Executions Namespace
- The Backend Service must have write access to the Database.
- The backend needs working kubernetes configuration such that
kubectlcommands work automatically. (The backend does not need thekubectltool itself.)- This may require installing
gcloud components install gke-gcloud-auth-plugin - Kubernetes config file may be created using
gcloud container clusters get-credentials CLUSTER_NAME --region us-central1 --project PROJECT_ID
- This may require installing
- Configuration:
- The admin deploying the Tangle service must modify the
start.pyscript to specify the storage bucket URIs, database URI and Kubernetes configuration.
- The admin deploying the Tangle service must modify the
- Authentication:
- ! The backend API Server MUST be put behind auth proxy! The API Sever allows all users to access read-only API routes. So the API Server must not be open to public Internet.
- ! The admin deploying the Tangle service must modify the
get_user_detailsfunction in thestart.pyscript to properly extract the user auth from the HTTP requests (IAM/IAP). Documentation: https://docs.cloud.google.com/run/docs/tutorials/identity-platform, https://docs.cloud.google.com/python/docs/getting-started/authenticate-users
git clone https://github.com/TangleML/tangle_deployment_gcp.git
cd tangle_deployment_gcp
git clone https://github.com/TangleML/tangle-ui.git ui_build --branch stable_local_build
# ! Edit start.py to configure the storage bucket URIs, database URI and Kubernetes configuration
uv run start.py