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.9 KB
Raw Blame
# Builds run as the pinned three-ws-build service account: the project's default
# compute service account was deleted, so an unpinned submit fails with
# "Unknown service account".
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: stylize-service
  _REPO: stylize-service
  _GCS_BUCKET: three-ws-avatar-reconstructions
  # Kept warm (not scale-to-zero): this worker backs the forge's interactive
  # stylize tool (/api/forge-stylize, MCP stylize_model), where a job itself runs
  # in under ten seconds, so a container cold start on top of it is the dominant
  # user-facing stall. CPU-only, no GPU, cheap to keep resident against the GCP
  # credit pool. 2026-07-16.
  _MIN_INSTANCES: "1"
  _MAX_INSTANCES: "3"

steps:
  - id: build
    name: gcr.io/cloud-builders/docker
    dir: workers/stylize
    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=300
      # /process answers 202 and finishes the job in a FastAPI BackgroundTask,
      # so the work runs entirely outside a request. Under Cloud Run's default
      # throttling the container gets almost no CPU there, and the job also
      # holds one of only MAX_CONCURRENT=2 semaphore slots while it crawls, so a
      # caller that stops polling can wedge the instance for everyone. The same
      # filter has been logged at 8.13s and at 224.89s on this service; the
      # sibling remesh worker measured the same mechanism at 160s versus 51,173s
      # before it was given always-on CPU.
      - --no-cpu-throttling
      - --allow-unauthenticated
      - --set-env-vars=GCS_BUCKET=${_GCS_BUCKET},MAX_CONCURRENT=2
      - --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