Run Dockerfile build, test and lint steps at nice -n 19 (closes #63)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
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
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <command>`; 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/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user