Skip to content

Dockerfile: use uv for build #1238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 1, 2025
Merged

Conversation

pjonsson
Copy link
Contributor

@pjonsson pjonsson commented Jul 30, 2025

Use uv for building the Docker image.

This also shuffles things around a bit to improve the Docker cache hit rate. When building locally, this will also cache uv itself as well as the deb packages.


📚 Documentation preview 📚: https://datacube-ows--1238.org.readthedocs.build/en/1238/

pjonsson added 6 commits July 30, 2025 23:02
This workflow does not need
the entire source tree.
We only use releases and those do not
change, so pin by hash. This protects
from a compromised GDAL repository
changing the tag to point to something
dangerous.
Put the basic package installation
early, and split out the build-arg
dependent part into a separate RUN
statement so the first RUN statement
can be cached.
Make Python flush things immediately
and stop leaving __pycache__ directories
in the file system.
@pjonsson pjonsson force-pushed the docker-use-uv branch 2 times, most recently from 18b532b to c679056 Compare July 30, 2025 21:10
Copy link

codecov bot commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.38%. Comparing base (46e8c01) to head (5101c05).
⚠️ Report is 8 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1238      +/-   ##
===========================================
- Coverage    93.58%   93.38%   -0.20%     
===========================================
  Files           53       53              
  Lines         7096     7125      +29     
===========================================
+ Hits          6641     6654      +13     
- Misses         455      471      +16     

see 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pjonsson
Copy link
Contributor Author

The deployment image shrinks from 1.39GB to 1.07GB with this PR, and the build becomes reproducible since it's using locked dependencies.

The image builds don't seem to hit more than 40% cache for some reason, but the image build now takes less than 90 seconds when it does hit the cache.

@pjonsson pjonsson force-pushed the docker-use-uv branch 2 times, most recently from b6eefd3 to 76113e0 Compare July 31, 2025 19:23
@omad omad merged commit 63225bd into opendatacube:develop Aug 1, 2025
14 checks passed
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.

3 participants