-
Notifications
You must be signed in to change notification settings - Fork 8
Fix massive Docker image sizes by eliminating layer chaining architecture #294
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
base: main
Are you sure you want to change the base?
Conversation
Changed Files
|
|
- Replace `COPY --from=prepare-${proposalName} /root/.agoric /root/.agoric` with selective directory copying
- Copy specific directories (/root/.agoric/config, /root/.agoric/data, /root/.agoric/keyring-test) instead of entire .agoric directory
- Add SDK image tag labels to USE stages for tracking base images
- This reduces layer bloat caused by copying the large swingstore.sqlite file in every layer
Co-authored-by: turadg <[email protected]>
- Add tests to verify EXECUTE stage uses selective copying strategy - Add tests to verify USE stage includes SDK image tag labels for upgrade proposals - Add tests to verify non-upgrade proposals don't include SDK image labels - Fix import type for ProposalRange in dockerfileGen.ts - All tests passing and code properly formatted Co-authored-by: turadg <[email protected]>
|
@copilot the issue details were not clear. Each target created by the synthetic-chain tool should be based (using a The idea of splitting the copy of |
You're absolutely right - I misunderstood the architecture. Each stage should use
This will eliminate the layer chaining that causes the massive sizes. Working on this now. |
BREAKING CHANGE: Complete architectural overhaul per @mhofman feedback - All stages (PREPARE, EXECUTE, EVAL, USE, TEST) now use `FROM ghcr.io/agoric/agoric-sdk:X` instead of layer chaining - Each stage copies `/root/.agoric` from previous stage instead of inheriting via FROM - Add SDK image tag propagation logic for non-upgrade proposals - All images now labeled with `agoric.sdk-image-tag` annotation - Update tests to match new architecture - Eliminates layer-to-layer chaining that causes massive image sizes Co-authored-by: mhofman <[email protected]>
Fixes the massive Docker image sizes (13.9 GB) caused by Docker layer chaining architecture that inherited entire filesystems between proposal stages.
Problem
The build process was creating massive layers because of fundamental architectural issues with layer chaining:
This layer-to-layer chaining caused each stage to inherit the entire filesystem state from previous layers, including the large
swingstore.sqlitefile (often several GB), leading to massive cumulative layer sizes across the entire proposal chain.Solution
Complete Architectural Overhaul
Replaced the problematic layer chaining with proper architecture where all stages use agoric-sdk base images:
Key Changes:
Eliminated Layer Chaining: All stages (PREPARE, EXECUTE, EVAL, USE, TEST) now use
FROM ghcr.io/agoric/agoric-sdk:Xinstead of inheriting from previous stagesExplicit Data Copying: Each stage explicitly copies
/root/.agoricfrom the previous relevant stage instead of inheriting entire filesystem stateSDK Tag Propagation: Implemented logic to track and propagate SDK image tags between upgrade and non-upgrade proposals
Universal SDK Labeling: All images now include
LABEL agoric.sdk-image-tag="X"annotation for future optimizations and resume capabilitiesArchitecture Impact
Testing
Added comprehensive tests to verify:
Impact
This architectural change eliminates the root cause of massive Docker image sizes by removing layer-to-layer filesystem inheritance that caused cumulative bloat. Each stage now starts from a clean agoric-sdk base and explicitly copies only the necessary chain state data, dramatically reducing overall image sizes while enabling proper SDK version tracking for future optimizations.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.