From 5f3b745db2b11808f8075f3768ea43d25ec98ce9 Mon Sep 17 00:00:00 2001 From: clawbot Date: Tue, 29 Sep 2026 11:06:25 +0000 Subject: [PATCH] Run Dockerfile build, test and lint steps at nice -n 19 (closes #63) The owner ordered every build, test and lint step in every Dockerfile to run at the lowest priority. REPO_POLICIES.md gains that rule in one line, and both Dockerfiles this repo hands out follow it: its own, and the canonical Go example in REPO_POLICIES.md. Installs, dependency downloads and the runtime entrypoint are left at normal priority. Model: opus-5-5 --- Dockerfile | 4 ++-- TODO.md | 4 ++++ prompts/REPO_POLICIES.md | 14 +++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index da25dee..782fed0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN script/bootstrap COPY . . -RUN yarn run prettier --check '**/*.md' --tab-width 4 --prose-wrap always +RUN nice -n 19 yarn run prettier --check '**/*.md' --tab-width 4 --prose-wrap always # Test phase, same shape and for the same reason. # @@ -28,7 +28,7 @@ RUN script/bootstrap COPY . . -RUN echo "No tests defined." +RUN nice -n 19 echo "No tests defined." # Development environment, and the last stage: a plain `docker build .` # names no target and so builds this one. Nothing is wanted from the two diff --git a/TODO.md b/TODO.md index 77fc0f9..96e579a 100644 --- a/TODO.md +++ b/TODO.md @@ -21,6 +21,10 @@ fmt-check, and commit. # Completed Steps +- 2026-09-29: Every `Dockerfile` step that builds, tests or lints now runs at + `nice -n 19`, per the owner's order on issue 63: the rule is one line in + `REPO_POLICIES.md`, and this repo's `Dockerfile` and the canonical Go + `Dockerfile` there follow it. - 2026-09-08: Moved linting and testing into Docker as phases of the main `Dockerfile`, per the owner ruling on issue 40. `script/lint` and `script/test` build one phase each by name with `--no-cache` — the same answer diff --git a/prompts/REPO_POLICIES.md b/prompts/REPO_POLICIES.md index 2256291..398a246 100644 --- a/prompts/REPO_POLICIES.md +++ b/prompts/REPO_POLICIES.md @@ -1,6 +1,6 @@ --- title: Repository Policies -last_modified: 2026-09-08 +last_modified: 2026-09-29 --- This document covers repository structure, tooling, and workflow standards. Code @@ -109,6 +109,10 @@ style conventions are in separate documents: manifests (`package.json` + `yarn.lock`, `go.mod` + `go.sum`, etc.) before running it. +- Every `Dockerfile` `RUN` step that builds, tests or lints runs at the lowest + priority, as `RUN nice -n 19 `; installs, downloads, copies and the + runtime `CMD`/`ENTRYPOINT` are not niced. + - **Linting and testing run in Docker, as phases of the `Dockerfile`.** There is no separate lint file. `script/lint` and `script/test` each build one phase and nothing else: @@ -171,7 +175,7 @@ style conventions are in separate documents: COPY go.mod go.sum ./ RUN go mod download COPY . . - RUN golangci-lint run --config .golangci.yml ./... + RUN nice -n 19 golangci-lint run --config .golangci.yml ./... # Test phase # golang:1.x-alpine, YYYY-MM-DD @@ -180,9 +184,9 @@ style conventions are in separate documents: COPY go.mod go.sum ./ RUN go mod download COPY . . - RUN go test -timeout 90s -race -cover ./... || \ + RUN nice -n 19 go test -timeout 90s -race -cover ./... || \ { echo "--- Rerunning with -v for details ---"; \ - go test -timeout 90s -race -v ./...; exit 1; } + nice -n 19 go test -timeout 90s -race -v ./...; exit 1; } # Build stage. Nothing is wanted from either phase above; the copies # are what make BuildKit build them first, so this stage cannot run @@ -197,7 +201,7 @@ style conventions are in separate documents: COPY . . ARG VERSION=dev - RUN CGO_ENABLED=0 go build -trimpath \ + RUN CGO_ENABLED=0 nice -n 19 go build -trimpath \ -ldflags="-s -w -X main.Version=${VERSION}" \ -o /app ./cmd/app/