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.

fix(longcat): make the pin check run on Cloud Build's non-BuildKit docker builder

nirholasb08b720c2bc0
diff --git a/workers/longcat/Dockerfile b/workers/longcat/Dockerfile
index e4e7df383..400e3634a 100644
--- a/workers/longcat/Dockerfile
+++ b/workers/longcat/Dockerfile
@@ -56,17 +56,12 @@ RUN pip install -c /app/constraints.txt -r /app/requirements-model.txt
COPY requirements.txt /app/requirements.txt
RUN pip install -c /app/constraints.txt -r /app/requirements.txt
-# Fail the build, not the first job, if a transitive resolution replaced the
-# CUDA torch build or moved numpy to 2.x.
-RUN python - <<'PY'
-import numpy, torch, transformers, diffusers
-assert torch.__version__.startswith("2.6.0"), f"torch drifted to {torch.__version__}"
-assert "cu124" in torch.__version__ or torch.version.cuda == "12.4", (
- f"expected a cu124 torch build, got {torch.__version__} / cuda {torch.version.cuda}"
-)
-assert numpy.__version__.startswith("1.26"), f"numpy drifted to {numpy.__version__}"
-print("pins ok:", torch.__version__, numpy.__version__, transformers.__version__, diffusers.__version__)
-PY
+# Fail the build, not the first job, if a transitive resolution replaced the CUDA
+# torch build or moved numpy to 2.x. A copied script rather than a RUN heredoc:
+# Cloud Build's docker builder does not enable BuildKit, and RUN heredocs need
+# the 1.4+ Dockerfile frontend.
+COPY check_pins.py /app/check_pins.py
+RUN python /app/check_pins.py
# ── App code ───────────────────────────────────────────────────────────────────
WORKDIR /app
diff --git a/workers/longcat/README.md b/workers/longcat/README.md
index d3a15dfb2..20b58dcde 100644
--- a/workers/longcat/README.md
+++ b/workers/longcat/README.md
@@ -177,7 +177,9 @@ GPUs and neither works:
use context parallelism, which splits activations but replicates weights on
every rank, so 2 x L4 does not help either.
- **NVIDIA RTX PRO 6000 Blackwell, 96 GB.** Enough memory, wrong architecture:
- it is compute capability sm_120, and the `torch==2.6.0+cu124` and
+ it is compute capability 12.0 per
+ [NVIDIA's own table](https://developer.nvidia.com/cuda-gpus) (where A100 is 8.0
+ and H100 is 9.0), and the `torch==2.6.0+cu124` and
`flash-attn==2.7.4.post1` wheels this stack pins ship kernels only up to
sm_90. The shipped `base_model_int8/config.json` sets
`enable_flashattn2: true`, so flash-attn is a hard runtime import, not an
diff --git a/workers/longcat/check_pins.py b/workers/longcat/check_pins.py
new file mode 100644
index 000000000..0af2fb896
--- /dev/null
+++ b/workers/longcat/check_pins.py
@@ -0,0 +1,46 @@
+"""Build-time assertion that the installed stack is the one this image pins.
+
+Run by the Dockerfile right after the pip installs. audio-separator brings its
+own torch and numpy requirements, and without this gate a transitive resolution
+that swapped the cu124 wheel for a CPU-only build would only surface at
+inference time, as "Torch not compiled with CUDA enabled", after a 40-minute
+build had already reported success.
+"""
+
+from __future__ import annotations
+
+import sys
+
+import diffusers
+import numpy
+import torch
+import transformers
+
+failures = []
+
+if not torch.__version__.startswith("2.6.0"):
+ failures.append(f"torch drifted to {torch.__version__}, expected 2.6.0")
+if "cu124" not in torch.__version__ and torch.version.cuda != "12.4":
+ failures.append(
+ f"expected a cu124 torch build, got {torch.__version__} (cuda {torch.version.cuda})"
+ )
+if not numpy.__version__.startswith("1.26"):
+ failures.append(f"numpy drifted to {numpy.__version__}, expected 1.26.x")
+if not transformers.__version__.startswith("4.41"):
+ failures.append(f"transformers drifted to {transformers.__version__}, expected 4.41.x")
+if not diffusers.__version__.startswith("0.35"):
+ failures.append(f"diffusers drifted to {diffusers.__version__}, expected 0.35.x")
+
+if failures:
+ for line in failures:
+ print(f"PIN DRIFT {line}", file=sys.stderr)
+ sys.exit(1)
+
+print(
+ "pins ok:",
+ f"torch {torch.__version__}",
+ f"cuda {torch.version.cuda}",
+ f"numpy {numpy.__version__}",
+ f"transformers {transformers.__version__}",
+ f"diffusers {diffusers.__version__}",
+)