j-chim Claude Opus 4.7 (1M context) commited on
Commit
051fa16
·
1 Parent(s): 154e1d8

Bake DuckDB envs into runner stage

Browse files

The builder stage had DATA_BACKEND/LOCAL_PIPELINE_OUTPUT/etc., but Docker
multi-stage doesn't carry ENVs across stages and this Space has no Space
Variables set. So at request time lib/duckdb-data.ts threw the
"DATA_BACKEND=duckdb requires LOCAL_PIPELINE_OUTPUT" guard and every
model/eval/developer endpoint returned empty — hence "No model cards
found" / "Evaluation not found" on the deployed Space.

Parquet files are already at /app/.cache/hf-data/duckdb/v1/ via the
COPY --from=builder /app/.cache step; this commit just teaches the
runner where to look.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. Dockerfile +10 -1
Dockerfile CHANGED
@@ -49,7 +49,16 @@ RUN pnpm run build
49
  FROM node:18-bullseye-slim AS runner
50
  WORKDIR /app
51
 
52
- ENV NODE_ENV=production
 
 
 
 
 
 
 
 
 
53
 
54
  # minimal packages for certificates (if needed by model download / https)
55
  RUN apt-get update && apt-get install -y ca-certificates --no-install-recommends && rm -rf /var/lib/apt/lists/*
 
49
  FROM node:18-bullseye-slim AS runner
50
  WORKDIR /app
51
 
52
+ # Runtime needs the same DuckDB-mode envs that the builder used. HF Space
53
+ # Variables aren't set on this Space, and Docker multi-stage doesn't carry
54
+ # ENVs across stages — without these, lib/duckdb-data.ts throws
55
+ # "DATA_BACKEND=duckdb requires LOCAL_PIPELINE_OUTPUT" at request time and
56
+ # every model/eval/developer endpoint returns empty.
57
+ ENV NODE_ENV=production \
58
+ DATA_BACKEND=duckdb \
59
+ LOCAL_PIPELINE_OUTPUT=/app/.cache/hf-data \
60
+ HF_DATA_LOCAL_DIR=/app/.cache/hf-data \
61
+ HF_DATA_OFFLINE=1
62
 
63
  # minimal packages for certificates (if needed by model download / https)
64
  RUN apt-get update && apt-get install -y ca-certificates --no-install-recommends && rm -rf /var/lib/apt/lists/*