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.7 KB
Raw Blame
# Cloud Build pipeline: build the longcat-video-avatar image and publish it to
# Artifact Registry.
#
# There is deliberately NO Cloud Run deploy step. Do not add one back without
# first re-checking the arithmetic in README.md ("Why this is not on Cloud
# Run"). In short, as of 2026-08-11:
#
#   * the resident weight set for --use_int8 --use_distill --model_type
#     avatar-v1.5 is about 45 GB (UMT5 text encoder 22.7 GB + INT8 DiT 15.9 GB +
#     distillation LoRA 2.5 GB + whisper-large-v3 3.1 GB + VAE 0.5 GB), and
#     upstream's pipeline .to(device) puts all of it on one GPU;
#   * Cloud Run's L4 has 24 GB of VRAM, so it cannot hold that;
#   * Cloud Run's other GPU, the RTX PRO 6000 Blackwell, has 96 GB but is
#     compute capability sm_120, for which the torch 2.6.0+cu124 and
#     flash-attn 2.7.4.post1 wheels this stack pins ship no kernels.
#
# The image this config produces runs on a single 80 GB GPU (A100-80GB or
# H100-80GB, sm_80/sm_90). README.md has the docker run command.
#
# Substitution variables (override via --substitutions or trigger config):
#   _REGION  Artifact Registry / build region (default: us-central1)
#   _REPO    Artifact Registry repository name (default: longcat-video-avatar)
#
# Manual submit (SHORT_SHA is only populated for trigger builds, and an empty tag
# fails the push):
#   gcloud builds submit --config workers/longcat/cloudbuild.yaml \
#     --region us-central1 --project aerial-vehicle-466722-p5 \
#     --substitutions=SHORT_SHA=manual$(date +%s)

# 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
  _REPO: longcat-video-avatar

# The Artifact Registry repository is a one-time prerequisite, not a build step:
# three-ws-build@ deliberately lacks artifactregistry.repositories.create, so a
# self-provisioning step fails the build before it starts. Created on 2026-08-11;
# the command is in README.md under "Prerequisites for a first deploy".

steps:
  # ── Build ──────────────────────────────────────────────────────────────────
  # The Dockerfile runs the worker's three test suites as build gates, so a
  # green build here also means the unit tests passed.
  - id: build
    name: gcr.io/cloud-builders/docker
    dir: workers/longcat
    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
      - .

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

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
  diskSizeGb: 200

# The CUDA base image, the cu124 torch wheels and the ONNX/audio stack push this
# past Cloud Build's 10-minute default. Measured at 10m45s on E2_HIGHCPU_32 with
# a completely cold cache (build f270edeb, 2026-08-11); 3600s leaves headroom for
# a slower upstream day.
timeout: 3600s