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.

3.1 KB
Raw Blame
substitutions:
  _REGION: us-central1
  _RUN_SA: avatar-reconstruction-sa@aerial-vehicle-466722-p5.iam.gserviceaccount.com
  _SERVICE: model-hunyuan3d-21
  _REPO: model-hunyuan3d-21
  _GCS_BUCKET: three-ws-avatar-reconstructions
  _WEIGHTS_BUCKET: three-ws-model-weights
  # min=0: this L4 build is the FALLBACK for the 2.1 lane; the warm primary is
  # model-hunyuan3d-21-rtx (see cloudbuild.hunyuan21rtx.yaml), which runs on
  # RTX PRO 6000 where the project quota is 1000 GPUs vs 3 L4s. A pinned L4
  # here starved trellis/model-rig/triposg rollouts of the 3-GPU regional budget.
  # max=1: one L4 fits exactly one in-flight generation.
  _MIN_INSTANCES: "0"
  _MAX_INSTANCES: "1"

steps:
  - id: build
    name: gcr.io/cloud-builders/docker
    dir: workers/model-hunyuan3d
    args:
      - build
      - --file
      - Dockerfile.hunyuan21
      - --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
      - --gpu=1
      - --gpu-type=nvidia-l4
      - --no-gpu-zonal-redundancy
      - --no-cpu-throttling
      - --cpu=8
      - --memory=32Gi
      - --min-instances=${_MIN_INSTANCES}
      - --max-instances=${_MAX_INSTANCES}
      - --timeout=900
      - --allow-unauthenticated
      - --add-volume=name=weights,type=cloud-storage,bucket=${_WEIGHTS_BUCKET}
      - --add-volume-mount=volume=weights,mount-path=/weights
      - --set-env-vars=^;^GCS_BUCKET=${_GCS_BUCKET};HUNYUAN3D_MODEL=2.1;WEIGHTS_DIR=/weights/hunyuan3d-2.1;WEIGHTS_GCS_URI=gs://${_WEIGHTS_BUCKET}/hunyuan3d-2.1;WEIGHTS_LOCAL_DIR=/tmp/hunyuan3d-2.1;DINO_DIR=/weights/dinov2-giant;DINO_GCS_URI=gs://${_WEIGHTS_BUCKET}/dinov2-giant;DINO_LOCAL_DIR=/tmp/dinov2-giant;U2NET_HOME=/weights/u2net;MAX_CONCURRENT=1
      - --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_32
  logging: CLOUD_LOGGING_ONLY

# The project's default compute service account was deleted (see
# docs/ops/gcp-production.md) — every Cloud Build must pin the build SA
# explicitly or the submit fails with "Unknown service account".
serviceAccount: projects/aerial-vehicle-466722-p5/serviceAccounts/[email protected]

# The custom_rasterizer CUDA compile + the bpy/torch install push the build well
# past the 10-minute default.
timeout: 3600s