Skip to content

chore(ci): implement CI optimizations#691

Merged
luisremis merged 7 commits into
developfrom
fix/690-ci-optimizations
May 20, 2026
Merged

chore(ci): implement CI optimizations#691
luisremis merged 7 commits into
developfrom
fix/690-ci-optimizations

Conversation

@ad-claw000
Copy link
Copy Markdown
Contributor

Closes #690

This PR implements the 3 alternative solutions proposed in #690 to significantly reduce the execution time of the pr.yaml workflow.

Changes:

  1. Optimize Dockerfile Layer Caching: Reordered docker/notebook/Dockerfile and docker/tests/Dockerfile to ensure heavy external dependencies (like CLIP and apt packages) are installed before adding the repository source files. This prevents full dependency rebuilds on every code change.
  2. Enable Pytest Sharding / Parallel Execution: Added pytest-xdist and pytest-cov to pyproject.toml. Updated test/run_test.sh to use pytest -n auto for parallel execution and --cov=aperturedb for proper multiprocessing coverage generation, bypassing sequential execution bottlenecks.
  3. Implement Docker Build Caching: Updated ci.sh to explicitly pull the latest version of aperturedb-notebook and aperturedb-python-tests before building, and leveraged the --cache-from flag for the notebook build step.

@luisremis Ready for your review.

Closes #690

- Reordered Dockerfiles to maximize layer caching
- Implemented pytest-xdist to run tests in parallel using pytest-cov for coverage
- Implemented GitHub Actions Docker cache via --cache-from and pulling latest images
Copilot AI review requested due to automatic review settings May 19, 2026 20:09
@ad-claw000 ad-claw000 self-assigned this May 19, 2026
luisremis
luisremis previously approved these changes May 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets reducing pr.yaml workflow duration by improving Docker layer caching and introducing parallel pytest execution/coverage collection to shorten build + test cycles.

Changes:

  • Reordered Dockerfile steps (tests + notebook) to maximize cache hits by installing heavier dependencies before adding the repo contents.
  • Added pytest-xdist and pytest-cov, and updated the test runner to use parallel pytest workers with coverage.
  • Updated ci.sh to pull “latest” images before builds and use --cache-from to reuse existing layers.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/run_test.sh Switches to pytest-xdist parallel runs and pytest-cov coverage generation.
pyproject.toml Adds pytest-xdist and pytest-cov to dev optional dependencies.
docker/tests/Dockerfile Moves heavy installs (CLIP) ahead of adding source to improve caching.
docker/notebook/Dockerfile Reorders installs (CLIP/apt/Jupyter extensions) before adding source for better caching.
ci.sh Pulls latest images and adds --cache-from to improve Docker build cache reuse.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/run_test.sh Outdated
Comment thread test/run_test.sh Outdated
Comment thread docker/notebook/Dockerfile Outdated
Copilot AI review requested due to automatic review settings May 19, 2026 21:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread ci.sh
Comment thread ci.sh Outdated
Comment thread test/run_test.sh Outdated
Copilot AI review requested due to automatic review settings May 20, 2026 00:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread test/run_test.sh
Copy link
Copy Markdown
Contributor Author

@ad-claw000 ad-claw000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied autopep8 formatting to the new log messages to fix the pre-commit CI failure.

Copy link
Copy Markdown
Contributor Author

@ad-claw000 ad-claw000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the remaining feedback about pytest-xdist in the PR description.

Copy link
Copy Markdown
Contributor Author

@ad-claw000 ad-claw000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the remaining feedback about pytest-xdist in the PR description.

@luisremis luisremis merged commit b5cc797 into develop May 20, 2026
3 checks passed
@luisremis luisremis deleted the fix/690-ci-optimizations branch May 20, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI Optimization: Proposals to reduce PR workflow execution time

3 participants