Fix lake extension bake user; disable the daemon healthcheck in the stack
All checks were successful
PR build (required check) / changes (pull_request) Successful in 5s
secrets-guard / encrypted (pull_request) Successful in 6s
shell-lint / shellcheck (pull_request) Successful in 6s
PR build (required check) / build-frontend (pull_request) Has been skipped
PR build (required check) / validate-observability (pull_request) Has been skipped
PR build (required check) / build-backend (pull_request) Successful in 43s
PR build (required check) / gate (pull_request) Successful in 2s

Two first-prod-stack-deploy findings: DuckDB extensions install to the
invoking user's ~/.duckdb, so the root-time httpfs bake left the uid-10001
lake unable to LOAD it (every /query 500'd); and the stack file never
disabled the image healthcheck for the daemon, so Swarm killed the healthy
gateway every ~100s (compose already disabled it). Bake now runs as the
runtime user; the stack matches compose. Prod mitigated live with
--no-healthcheck pending this landing.
This commit is contained in:
Emi Griffith 2026-07-23 20:46:23 -07:00
parent 4e3c7e82c6
commit ec0bb42258
2 changed files with 11 additions and 3 deletions

View file

@ -33,9 +33,6 @@ RUN apt-get update \
# Install deps first so this layer caches across code-only changes. # Install deps first so this layer caches across code-only changes.
COPY requirements.txt /tmp/requirements.txt COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt RUN pip install --no-cache-dir -r /tmp/requirements.txt
# Bake DuckDB's httpfs extension so the lake role's S3 reads need no runtime
# extension download (tasks may roll while egress is degraded).
RUN python -c "import duckdb; duckdb.connect().execute('INSTALL httpfs')"
# The daemon binary lands before the app tree: it changes far less often than # The daemon binary lands before the app tree: it changes far less often than
# the Python code, so this layer usually cache-hits and only the COPY below # the Python code, so this layer usually cache-hits and only the COPY below
@ -56,6 +53,10 @@ RUN useradd --system --create-home --uid 10001 thermograph \
&& chown -R thermograph:thermograph /app /state && chown -R thermograph:thermograph /app /state
USER thermograph USER thermograph
# Bake DuckDB's httpfs extension AS THE RUNTIME USER — extensions install to
# the invoking user's ~/.duckdb, and a root-time bake leaves uid 10001 unable
# to LOAD it (seen live: prod lake /query 500'd on exactly this).
RUN python -c "import duckdb; duckdb.connect().execute('INSTALL httpfs')"
WORKDIR /app WORKDIR /app
ENV PORT=8137 \ ENV PORT=8137 \

View file

@ -208,6 +208,13 @@ services:
# endpoints on a timer), so the daemon holds no state and logs to stdout. # endpoints on a timer), so the daemon holds no state and logs to stdout.
volumes: volumes:
- /etc/thermograph/stack.env:/host/thermograph.env:ro - /etc/thermograph/stack.env:/host/thermograph.env:ro
# The image HEALTHCHECK curls /healthz on ${PORT} — right for the app,
# meaningless for the daemon (it serves nothing). Without this override
# Swarm marks the task unhealthy and restarts it forever (seen live on the
# first prod stack deploy: gateway up, killed ~100s later, 0/1 loop). The
# compose file already disables it; the stack file must too.
healthcheck:
disable: true
networks: networks:
- internal - internal
deploy: deploy: