TEST-INFRA: [ci-pipeline-design] Implement Docker Layer Caching in CI/CD Workflows #6890

Open
opened 2026-04-10 04:52:26 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Branch: feature/ci-docker-layer-caching
  • Commit Message: ci(pipeline): implement Docker layer caching in CI/CD workflows
  • Milestone: (none — backlog, see note below)
  • Parent Epic: #5407

Summary

The CI/CD pipeline frequently builds Docker images in the docker and build-docker jobs (ci.yml and release.yml). These builds do not currently cache Docker layers, resulting in longer build times as each job rebuilds the image from scratch.

Implementing Docker layer caching will significantly speed up these jobs, reducing CI/CD execution time and providing faster feedback to developers.

Proposed Solution

Leverage actions/cache to cache Docker layers between workflow runs. This can be achieved by:

  1. Adding a cache step to the docker and build-docker jobs in .forgejo/workflows/ci.yml and .forgejo/workflows/release.yml.
  2. Using a cache key that depends on the Dockerfile and other relevant files (e.g., pyproject.toml).
  3. Configuring the docker build command to use the cached layers.

Acceptance Criteria

  • The docker job in ci.yml uses Docker layer caching.
  • The build-docker job in release.yml uses Docker layer caching.
  • CI/CD pipeline execution time is measurably reduced when Docker images are rebuilt.

Duplicate Check

  • Search queries used: "docker cache", "layer caching", "docker layer"
  • Number of results found for each query: 0
  • None of the existing issues cover this specific finding.

Subtasks

  • Add actions/cache step to the docker job in .forgejo/workflows/ci.yml
  • Add actions/cache step to the build-docker job in .forgejo/workflows/release.yml
  • Define cache key based on Dockerfile and pyproject.toml hash
  • Configure docker build to use --cache-from with cached layers
  • Verify measurable reduction in CI/CD execution time for Docker build jobs
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

  • The docker job in ci.yml uses Docker layer caching
  • The build-docker job in release.yml uses Docker layer caching
  • Cache key correctly invalidates when Dockerfile or pyproject.toml changes
  • CI/CD pipeline execution time is measurably reduced for Docker build jobs
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone Test Infrastructure. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


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

## Metadata - **Branch**: `feature/ci-docker-layer-caching` - **Commit Message**: `ci(pipeline): implement Docker layer caching in CI/CD workflows` - **Milestone**: *(none — backlog, see note below)* - **Parent Epic**: #5407 ## Summary The CI/CD pipeline frequently builds Docker images in the `docker` and `build-docker` jobs (`ci.yml` and `release.yml`). These builds do not currently cache Docker layers, resulting in longer build times as each job rebuilds the image from scratch. Implementing Docker layer caching will significantly speed up these jobs, reducing CI/CD execution time and providing faster feedback to developers. ## Proposed Solution Leverage `actions/cache` to cache Docker layers between workflow runs. This can be achieved by: 1. Adding a cache step to the `docker` and `build-docker` jobs in `.forgejo/workflows/ci.yml` and `.forgejo/workflows/release.yml`. 2. Using a cache key that depends on the `Dockerfile` and other relevant files (e.g., `pyproject.toml`). 3. Configuring the `docker build` command to use the cached layers. ## Acceptance Criteria - The `docker` job in `ci.yml` uses Docker layer caching. - The `build-docker` job in `release.yml` uses Docker layer caching. - CI/CD pipeline execution time is measurably reduced when Docker images are rebuilt. ### Duplicate Check - Search queries used: "docker cache", "layer caching", "docker layer" - Number of results found for each query: 0 - None of the existing issues cover this specific finding. ## Subtasks - [ ] Add `actions/cache` step to the `docker` job in `.forgejo/workflows/ci.yml` - [ ] Add `actions/cache` step to the `build-docker` job in `.forgejo/workflows/release.yml` - [ ] Define cache key based on `Dockerfile` and `pyproject.toml` hash - [ ] Configure `docker build` to use `--cache-from` with cached layers - [ ] Verify measurable reduction in CI/CD execution time for Docker build jobs - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done - [ ] The `docker` job in `ci.yml` uses Docker layer caching - [ ] The `build-docker` job in `release.yml` uses Docker layer caching - [ ] Cache key correctly invalidates when `Dockerfile` or `pyproject.toml` changes - [ ] CI/CD pipeline execution time is measurably reduced for Docker build jobs - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone Test Infrastructure. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: new-issue-creator
HAL9000 self-assigned this 2026-04-10 06:16:35 +00:00
HAL9000 added this to the v3.5.0 milestone 2026-04-10 06:16:35 +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#6890
No description provided.