Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

2.3 KB
Raw Blame
serviceAccount: projects/aerial-vehicle-466722-p5/serviceAccounts/[email protected]

substitutions:
  _REGION: us-central1
  _RUN_SA: avatar-reconstruction-sa@aerial-vehicle-466722-p5.iam.gserviceaccount.com
  _SERVICE: model-video2motion
  _REPO: model-video2motion
  _GCS_BUCKET: three-ws-avatar-reconstructions
  # One always-on instance, instance-based billing. Processing happens in a
  # FastAPI BackgroundTask AFTER the 202 returns, so request-based billing
  # throttles it to near-zero CPU (a 30s clip took 3.5 h wall in prod vs 3 min
  # unthrottled — measured 2026-07-19). min 1 keeps the instance from being
  # reaped mid-job between polls; max 1 keeps the in-memory task store
  # authoritative (polls always land on the instance running the job).
  _MIN_INSTANCES: "1"
  _MAX_INSTANCES: "1"

steps:
  - id: build
    name: gcr.io/cloud-builders/docker
    dir: workers/model-video2motion
    args:
      - build
      - --tag
      - ${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPO}/server:$SHORT_SHA
      - --tag
      - ${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPO}/server:latest
      - --cache-from
      - ${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPO}/server:latest
      - .

  - id: push
    name: gcr.io/cloud-builders/docker
    args:
      - push
      - --all-tags
      - ${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPO}/server

  - id: deploy
    name: gcr.io/google.com/cloudsdktool/cloud-sdk:slim
    entrypoint: gcloud
    args:
      - run
      - deploy
      - ${_SERVICE}
      - --image=${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPO}/server:$SHORT_SHA
      - --region=${_REGION}
      - --service-account=${_RUN_SA}
      - --platform=managed
      - --port=8080
      - --cpu=8
      - --memory=16Gi
      - --min-instances=${_MIN_INSTANCES}
      - --max-instances=${_MAX_INSTANCES}
      - --timeout=900
      - --no-cpu-throttling
      - --allow-unauthenticated
      - --set-env-vars=GCS_BUCKET=${_GCS_BUCKET},MAX_CONCURRENT=2,MAX_SECONDS=90
      - --set-secrets=API_KEY=avatar-reconstruction-key:latest

images:
  - ${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPO}/server:$SHORT_SHA
  - ${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPO}/server:latest

options:
  machineType: E2_HIGHCPU_8
  logging: CLOUD_LOGGING_ONLY

timeout: 3600s