TEST-INFRA: [ci-execution-time] Create a custom Docker image for CI jobs #1788

Open
opened 2026-04-02 23:49:49 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: task/ci-custom-docker-image-ci-jobs
  • Commit Message: chore(ci): create custom Docker image to eliminate per-job dependency installation
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

Currently, each CI job in .forgejo/workflows/ci.yml installs Node.js, uv, nox, and other dependencies from scratch on every run. This cold-install process is repeated for every job, adding unnecessary wall-clock time to the CI pipeline. A custom Docker image that pre-bakes all required dependencies eliminates this overhead for the common case and is a direct contributor to the CI execution time reduction goals tracked in Epic #1678.

Current Behavior

  • Each CI job independently installs all required tools and dependencies (Node.js, uv, nox, system packages) on every invocation.
  • Dependency installation is repeated across all parallel jobs, multiplying the overhead.
  • There is no pre-built, versioned CI image for this repository; runner caches are the only mitigation and are unreliable across runner restarts.

Expected Behavior

  • A Dockerfile for CI purposes (e.g., .devcontainer/Dockerfile.ci) lives in the repository and defines a versioned CI image.
  • The image is pre-built and stored in a container registry.
  • All CI jobs reference the custom image directly, eliminating the need to install dependencies in each job.
  • The CI pipeline execution time is measurably reduced.

Acceptance Criteria

  • A custom Docker image for CI jobs is created and available in a container registry.
  • The Dockerfile is stored in the repository (e.g., .devcontainer/Dockerfile.ci).
  • The CI jobs in .forgejo/workflows/ci.yml are updated to use the new Docker image.
  • The CI pipeline execution time is reduced as a result of using the pre-built image.

Supporting Information

  • Related Epic: #1678 — CI Execution Time Optimization
  • Existing CI pipeline: .forgejo/workflows/ci.yml
  • Dependency manifest: pyproject.toml, uv.lock
  • The nox task runner is used for all test and quality sessions; the image must support nox invocations directly.

Subtasks

  • Audit all dependencies installed per-job in .forgejo/workflows/ci.yml (Node.js, uv, nox, system packages)
  • Write .devcontainer/Dockerfile.ci that pre-installs all required CI dependencies
  • Build and publish the Docker image to the project's container registry
  • Update all CI workflow jobs to reference the new custom image
  • Pin the image by digest or immutable tag in workflow files (no floating latest tags)
  • Add documentation describing how to rebuild the image locally and how the versioning scheme works
  • Tests (Behave): verify CI workflow jobs reference the custom image correctly
  • Verify coverage ≥ 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (chore(ci): create custom Docker image to eliminate per-job dependency installation), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (task/ci-custom-docker-image-ci-jobs).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage ≥ 97%.

Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: ca-new-issue-creator

## Metadata - **Branch**: `task/ci-custom-docker-image-ci-jobs` - **Commit Message**: `chore(ci): create custom Docker image to eliminate per-job dependency installation` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context Currently, each CI job in `.forgejo/workflows/ci.yml` installs Node.js, uv, nox, and other dependencies from scratch on every run. This cold-install process is repeated for every job, adding unnecessary wall-clock time to the CI pipeline. A custom Docker image that pre-bakes all required dependencies eliminates this overhead for the common case and is a direct contributor to the CI execution time reduction goals tracked in Epic #1678. ## Current Behavior - Each CI job independently installs all required tools and dependencies (Node.js, uv, nox, system packages) on every invocation. - Dependency installation is repeated across all parallel jobs, multiplying the overhead. - There is no pre-built, versioned CI image for this repository; runner caches are the only mitigation and are unreliable across runner restarts. ## Expected Behavior - A `Dockerfile` for CI purposes (e.g., `.devcontainer/Dockerfile.ci`) lives in the repository and defines a versioned CI image. - The image is pre-built and stored in a container registry. - All CI jobs reference the custom image directly, eliminating the need to install dependencies in each job. - The CI pipeline execution time is measurably reduced. ## Acceptance Criteria - [ ] A custom Docker image for CI jobs is created and available in a container registry. - [ ] The Dockerfile is stored in the repository (e.g., `.devcontainer/Dockerfile.ci`). - [ ] The CI jobs in `.forgejo/workflows/ci.yml` are updated to use the new Docker image. - [ ] The CI pipeline execution time is reduced as a result of using the pre-built image. ## Supporting Information - Related Epic: #1678 — CI Execution Time Optimization - Existing CI pipeline: `.forgejo/workflows/ci.yml` - Dependency manifest: `pyproject.toml`, `uv.lock` - The `nox` task runner is used for all test and quality sessions; the image must support `nox` invocations directly. ## Subtasks - [ ] Audit all dependencies installed per-job in `.forgejo/workflows/ci.yml` (Node.js, uv, nox, system packages) - [ ] Write `.devcontainer/Dockerfile.ci` that pre-installs all required CI dependencies - [ ] Build and publish the Docker image to the project's container registry - [ ] Update all CI workflow jobs to reference the new custom image - [ ] Pin the image by digest or immutable tag in workflow files (no floating `latest` tags) - [ ] Add documentation describing how to rebuild the image locally and how the versioning scheme works - [ ] Tests (Behave): verify CI workflow jobs reference the custom image correctly - [ ] Verify coverage ≥ 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done - [ ] All subtasks above are completed and checked off. - [ ] A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`chore(ci): create custom Docker image to eliminate per-job dependency installation`), followed by a blank line, then additional lines providing relevant details about the implementation. - [ ] The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`task/ci-custom-docker-image-ci-jobs`). - [ ] The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - [ ] All nox stages pass. - [ ] Coverage ≥ 97%. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-02 23:50:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#1788
No description provided.