Skip to content

Deploying DeploymentScaler

This guide covers deploying DeploymentScaler to Cloud Run worker-pools in different environments.


Prerequisites

  • GitHub Access: Write permissions to trigger GitHub Actions
  • GCP Access: Cloud Run Admin role for target project
  • gcloud CLI: Installed and authenticated with beta components

Deployment Steps

1. Build Docker Image

Trigger the GitHub Action to build and push the DeploymentScaler Docker image:

Location: .github/workflows/docker_iris.yml ⧉

Via GitHub UI:

  1. Click "Run workflow"
  2. Select branch (usually main)
  3. Select target GCP project
  4. Ensure "Build deployment_scaler image" is checked
  5. Click "Run workflow" button

What it does:

  • Builds Docker image for DeploymentScaler
  • Pushes to Google Artifact Registry
  • Tags as latest and with commit SHA

2. Deploy to Cloud Run Worker-Pool

Once the Docker image is built, deploy to the target environment using gcloud:

Development Environment

gcloud beta run worker-pools deploy deployment-scaler \
  --project devel-466814 \
  --region us-central1 \
  --image us-central1-docker.pkg.dev/devel-466814/inference/deployment_scaler:latest

Production Environment

gcloud beta run worker-pools deploy deployment-scaler \
  --project production-492618 \
  --region europe-west3 \
  --image us-central1-docker.pkg.dev/production-492618/inference/deployment_scaler:latest

Verification

1. Check Deployment Status

# Production
gcloud beta run worker-pools describe deployment-scaler \
  --project production-492618 \
  --region europe-west3 \
  --format="get(status.conditions)"

Rollback

If the deployment fails or has issues, rollback to the previous revision:

# List revisions
gcloud beta run worker-pools revisions list \
  --worker-pool deployment-scaler \
  --project production-492618 \
  --region europe-west3

# Rollback to previous revision
gcloud beta run worker-pools update-traffic deployment-scaler \
  --to-revisions <PREVIOUS_REVISION>=100 \
  --project production-492618 \
  --region europe-west3

Troubleshooting

Deployment Fails

Check image exists:

gcloud artifacts docker images list \
  us-central1-docker.pkg.dev/production-492618/inference/deployment_scaler \
  --project production-492618


Configuration Updates

To update environment variables or other configuration:

gcloud beta run worker-pools update deployment-scaler \
  --project production-492618 \
  --region europe-west3 \
  --set-env-vars "LYC_SCALER_HEARTBEAT_INTERVAL=30s,LYC_MAX_DEPLOYMENTS=100"

Important: Configuration changes trigger a new deployment.