Archetype can be built and run on its own, or with a variety of different drivers. This file details how to bootstrap each one.
- Google Cloud SDK (
gcloud) installed and authenticated - Access to a GCP project with Cloud Run enabled
- A Google Cloud Storage bucket named
archetype_web_cardscontaining your ACX game files
From the repository root directory (not the drivers/ directory):
# Build the image using Cloud Build
gcloud builds submit --config cloudbuild.yaml
# Deploy to Cloud Run
gcloud run deploy archetype \
--image gcr.io/PROJECT_ID/archetype \
--platform managed \
--region us-west1 \
--allow-unauthenticatedReplace PROJECT_ID with your actual GCP project ID (e.g., my-project-123).
How it works:
gcloud builds submitusescloudbuild.yamlto build the Docker image usingdrivers/Dockerfilegcloud run deploydeploys the pre-built image to Cloud Run
Note: The build context must be the repository root because the Dockerfile references both src/ (the main codebase) and drivers/cloud_run/ (the Python Flask app).
Once deployed, Cloud Run will provide an endpoint URL. To interact with a game:
# Set your endpoint (Cloud Run will show this after deployment)
ENDPOINT=https://archetype-HASH-REGION.a.run.app
# Send a command to update a game
curl -X POST $ENDPOINT/update/dtj-spacebits.acx -F command=look
# Other example commands
curl -X POST $ENDPOINT/update/your-game.acx -F command="take sword"
curl -X POST $ENDPOINT/update/your-game.acx -F command="go north"The endpoint expects:
- Path parameter: The name of the ACX file in your
archetype_web_cardsGCS bucket - Form parameter
command: The game command to execute
To build and test the Docker image locally before deploying:
# From the repository root
docker build -f drivers/Dockerfile -t archetype .
# Run locally (requires GCS credentials mounted)
docker run -p 8080:8080 \
-v ~/.config/gcloud:/root/.config/gcloud \
-e GOOGLE_APPLICATION_CREDENTIALS=/root/.config/gcloud/application_default_credentials.json \
archetype