Optimize Docker images for size and 4G deploy bandwidth#338
Open
MateoLostanlen wants to merge 5 commits intodevelopfrom
Open
Optimize Docker images for size and 4G deploy bandwidth#338MateoLostanlen wants to merge 5 commits intodevelopfrom
MateoLostanlen wants to merge 5 commits intodevelopfrom
Conversation
- Split requirements into stable (pip) and git-based for layered caching - Multi-stage build for engine to isolate git dependency - Remove duplicate opencv-python, use headless variant - Remove build-essential and git from camera API runtime - Add .dockerignore files - Update Makefile lock target to auto-split requirements
- Build and push both images for linux/amd64 and linux/arm64 - Trigger on develop, main, and version tags - GHA layer cache for faster rebuilds - Test both images in docker.yml CI - Remove redundant dockerhub-publish from release.yml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #338 +/- ##
========================================
Coverage 72.59% 72.59%
========================================
Files 7 7
Lines 602 602
========================================
Hits 437 437
Misses 165 165
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restructure both Dockerfiles with layered caching so that code-only deploys pull ~2.5 MB over 4G instead of 400 MB+. Split
requirements.txtinto stable pip deps and git-based deps (requirements-git.txt), each in its own Docker layer. Switch toopencv-python-headless, remove duplicate opencv in camera API, and dropbuild-essentialandgitfrom the camera API runtime image. Add.dockerignorefiles and multi-platform CI (linux/amd64+linux/arm64) building and pushing both images to Docker Hub.make locknow auto-splits requirements.Image sizes
Test plan: both images build, engine import check passes (
from pyroengine import SystemController),make runstarts the stack, CI triggers on push todevelopfor both platforms.