diff --git a/CHANGELOG.md b/CHANGELOG.md index d21e99130..30b922f68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project are documented in this file. The format is b ### Fixed +- **Docker updates reuse the runtime image layers again**: the runtime stage declared `ARTEX_VERSION` and `ARTEX_REVISION` before its first `RUN`, and a declared build argument is part of the cache key of every later `RUN`. `update.sh` writes the new commit into `.env`, so each update reinstalled apt packages, bbot, Playwright and the rest of the stage (6 to 11 minutes per update) and left another copy of about 8 GB of layers in the build cache. The arguments and the `LABEL` that uses them now come at the end of the stage. The Go, Next.js and npm caches are also kept between builds as BuildKit cache mounts, so a code change recompiles only what changed: an update rebuild drops to well under a minute. - **An `exact_ip` task allow rule grants sandbox egress**: the egress allowlist read task allow rules of kind `ip`, which the rule tables never store, so an `exact_ip` allow rule granted nothing. A task scoped to one private address (`10.0.0.5`) could not reach it from the sandbox, directly or through a name resolving only to it. `exact_ip` allow rules now join the allowed CIDRs as a host prefix, like `cidr` allow rules. - **`GET /api/tasks/{id}/scope` reports scope approval**: the query behind it did not select `approved_by_operator` or `expanded`, so every row came back with `approved_by_operator: false` and `expanded: false`, including operator-approved rows that grant sandbox egress. The rows now carry both columns as stored, for the task's own scope and for its source tasks' scope. - **The OpenAI Responses format no longer defaults to `gpt-5`**: OpenAI shuts `gpt-5` down on 2026-12-11 and lists `gpt-6.2-sol` as its replacement, so `ARTEX_LLM_PROVIDER=openai-responses` without `ARTEX_LLM_MODEL` (or a profile saved through the API without a model) would start failing then. The default is now `gpt-6.2-sol`; a model set in the profile or in `ARTEX_LLM_MODEL` is kept as is. A gateway set with `ARTEX_LLM_BASE_URL` that does not serve `gpt-6.2-sol` needs `ARTEX_LLM_MODEL` set explicitly. diff --git a/Dockerfile b/Dockerfile index d4a654bed..68d732ceb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,11 @@ FROM --platform=$BUILDPLATFORM node:22-bookworm-slim@sha256:be979e5523c76fa4d5ca ENV NEXT_TELEMETRY_DISABLED=1 WORKDIR /src/web COPY web/package.json web/package-lock.json ./ -RUN npm ci --ignore-scripts +# Cache mounts keep npm, Next.js and Go caches between builds, so an update +# recompiles only what changed. They are not part of the image. +RUN --mount=type=cache,target=/root/.npm npm ci --ignore-scripts COPY web/ ./ -RUN npm run build:static +RUN --mount=type=cache,target=/src/web/.next/cache npm run build:static # ------------------------------------------------------------- Go binary --- # Pinned to the exact Go release go.mod requires. The official image sets @@ -39,7 +41,8 @@ ARG TARGETOS ARG TARGETARCH # Same flags as the release binaries job (ARTEX_COMPRESS=0, -trimpath, # -X main.version), driven through build.sh so there is one build path. -RUN ARTEX_SKIP_FRONTEND=1 \ +RUN --mount=type=cache,target=/root/.cache/go-build \ + ARTEX_SKIP_FRONTEND=1 \ ARTEX_SKIP_NPM_CI=1 \ ARTEX_COMPRESS=0 \ ARTEX_OUTPUT=/out/artex \ @@ -162,11 +165,6 @@ RUN set -eux; \ # ---------------------------------------------------------------- runtime --- FROM python:3.12-slim-bookworm@sha256:44cf1793efa7c7a476bb0f2cff81443f4a072c90c1cb127e2924933daa3e8c64 ARG TARGETARCH -ARG ARTEX_VERSION=dev -ARG ARTEX_REVISION= -LABEL org.opencontainers.image.title="ARTEX" \ - org.opencontainers.image.version="${ARTEX_VERSION}" \ - org.opencontainers.image.revision="${ARTEX_REVISION}" # Common tools: ripgrep / curl / vim, plus a set of recon staples (add/remove as needed). RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates ripgrep curl wget vim git jq unzip xz-utils \ @@ -312,6 +310,13 @@ RUN chmod +x /app/artex /app/start.sh && mkdir -p -m 0700 /app/keys \ # when the container runs without docker-compose.yml's no-new-privileges. RUN find / -xdev -perm /6000 -type f -exec chmod a-s {} + COPY skills/ /app/skills/ +# Declared last: an ARG is part of the cache key of every RUN after it, and the +# revision changes on each commit, so declaring it earlier rebuilt the whole stage. +ARG ARTEX_VERSION=dev +ARG ARTEX_REVISION= +LABEL org.opencontainers.image.title="ARTEX" \ + org.opencontainers.image.version="${ARTEX_VERSION}" \ + org.opencontainers.image.revision="${ARTEX_REVISION}" # persistence points: data/ (traffic index, task files, transcripts) and keys/ (jwt.key, secret.key, via ARTEX_JWT_KEY_DIR) VOLUME ["/app/data", "/app/keys"] EXPOSE 8787 8788