Skip to content

build: Improved Docker build#119

Merged
toby-coleman merged 7 commits intomainfrom
build/uv-improvements
Mar 29, 2025
Merged

build: Improved Docker build#119
toby-coleman merged 7 commits intomainfrom
build/uv-improvements

Conversation

@toby-coleman
Copy link
Contributor

Summary

Improvements to the Docker build and associated CI pipeline.

Changes

  • Use uv instead of pip where appropriate in CI tests and Dockerfile for improved performance.
  • Update the Docker tagging for public repo usage.
  • Fix docker version tagging now that pipeline is triggered from workflow_run and not tag.
  • Improve build times by using a registry cache.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @toby-coleman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request focuses on improving the Docker build process and associated CI pipeline. The primary goals are to enhance performance and streamline the build process. It introduces uv for faster dependency management, updates Docker tagging for public repo usage, fixes version tagging, and leverages Docker's registry cache for quicker builds.

Highlights

  • Dependency Management: Replaces pip with uv in CI tests and the Dockerfile to improve performance during dependency installation.
  • Docker Tagging: Updates the Docker tagging mechanism, especially for public repository usage, and fixes version tagging issues related to pipeline triggers.
  • Build Performance: Improves build times by utilizing Docker's registry cache.

Changelog

  • Dockerfile
    • Replaced pip with uv for installing dependencies from requirements.txt.
    • Mounted the uv executable from a pre-built image to avoid installation overhead.
    • Configured a cache mount for uv to speed up subsequent builds.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A Dockerfile's tale,
Of layers and trails,
With uv so swift,
Performance, a gift,
Build times now set sail.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces significant improvements to the Docker build process by leveraging uv for faster dependency resolution and build times. The changes also include updates to Docker tagging and the use of a registry cache. Overall, these changes aim to optimize the build process and improve CI pipeline performance.

Summary of Findings

  • uv usage in Dockerfile: The Dockerfile is updated to use uv instead of pip for installing dependencies, which should lead to faster installation times. The introduction of a registry cache further optimizes build times.
  • Docker tagging: The Docker tagging logic has been updated to accommodate changes in the CI pipeline trigger, ensuring correct versioning of Docker images.

Merge Readiness

The changes introduced in this pull request appear to be well-reasoned and beneficial for improving the Docker build process. However, it's crucial to ensure that the uv installation and usage are thoroughly tested across different environments and that the Docker tagging logic is functioning as expected. I am unable to directly approve the pull request, and users should have others review and approve this code before merging. Given the potential impact of these changes on the build process, I recommend careful testing and validation before merging.

@toby-coleman
Copy link
Contributor Author

Performance improvement for Docker build:

  • Before: ~10 mins
  • With uv instead of pip: ~5 mins
  • Caching enabled with warm cache: ~ 40s.

@codecov
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@toby-coleman toby-coleman merged commit bee228e into main Mar 29, 2025
7 checks passed
@toby-coleman toby-coleman deleted the build/uv-improvements branch March 29, 2025 12:14
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.

1 participant