Repository navigation
Description
Problem or Motivation
Each of the 6 Service Image Tests shards builds the service stage again (no-cache-filters: service, .github/workflows/ci.yml:590). This takes 79-89 s per shard plus 13-30 s of buildx setup, about 503 runner-s per run (measured). The Service Image job builds the same target.
Each shard also compiles bytecode for a .venv that lists only the shard files, and it restores a tooling cache that never hits. The shards print no per-test times. The comment at ci.yml:534-535 says that the shards stay under 300 s, but they average 368-507 s (measured).
Saving: 40-50 s per shard, 4-5 runner-min and 6 builds per run (estimated).
Found by the CI and test audit of 2026-11-11. The account runs at most 20 hosted jobs at one time (measured), so each job that does no work makes the queue of each pull request longer.
Proposed Solution & Architectural Design
- The Service Image job builds once and runs its smoke test and scan. Then it saves the image with
docker saveandactions/upload-artifact. - Each shard gets the image with
actions/download-artifactanddocker load. - Add
--durations=10and-rsto the pytest arguments (ci.yml:653). - Skip the tooling cache in the shards.
- Correct the comment at
ci.yml:534-535(AGENTS.md rule 8). - Change
_service_image_test_job_problems(tests/invariants/test_architectural_invariants.py:1659) so that it accepts a loaded image of theservicestage. - Owner decision O1 (2026-11-11) moves Service Image Tests off the PR path, in the item 'perf(ci): run the in-image suite nightly and on image PRs'. After it, this saving applies to the nightly runs and the image-input runs. The two items change the same job, so merge one of them first.
Risk: Low. The artifact adds an upload and a download.
Target Subsystem
SDLC, Git & PR Governance (.github/workflows/ci.yml, tests/invariants/test_architectural_invariants.py).
Existing Tool Considered
docker save and docker load with the official actions/upload-artifact and actions/download-artifact. docker/build-push-action can also write the tar with outputs: type=docker,dest=<file>. No new tool. Cost: about 40,000 tokens and 3 hours.
Acceptance Criteria
- One build of the
servicestage per run (from 7). - No shard has a build step.
- The shard mean falls by 40 s or more (from 437 s).
- Each shard log lists its 10 slowest tests and the reason for each skip.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
perfprefix of the title gives the type.(ci)scope of the title gives the scope.Measured savings of 4-5 runner-minutes per run and 6 fewer builds reduce queue time, but no functional or security impact justifies P1.Saves runner capacity and shortens PR queue time for every contributor, but does not change delivered functionality.Requires editing ci.yml for artifact upload/download, adding pytest flags, skipping a cache, and updating one invariant test; well-scoped but touches multiple steps.Both items change the service image build steps in ci.yml, but #1858 deduplicates the build between ci.yml and release.yml via a reusable workflow, while this candidate shares one build across 6 test shards within ci.yml.dan-petty commentedon Nov 11, 2026
Observation (run 43093341637, PR #4801, 2026-11-11): in shard 6 of 6 of
Service Image Tests, the stepPost Build and Load Service Imagetook 631 s (20:18:15 to 20:28:46 UTC). In shards 1 to 5 the same step took 2 to 7 s. The test step of shard 6 ended at 20:18:15, so the job used about 10 more runner-min, and theTests & Coverageaggregate waited for it.The post step of
docker/build-push-actionv6 exports the build record and writes the build summary. No workflow setsDOCKER_BUILD_RECORD_UPLOADorDOCKER_BUILD_SUMMARY(git grep DOCKER_BUILD_ .github/finds nothing). This is one occurrence; the cause of the slow export is not verified. When this item changes the shard build, consider whether the shards need the build record.devops-cli-service commentedon Nov 12, 2026
Released in v0.119.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.119.0
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 15:46 UTC