-
Notifications
You must be signed in to change notification settings - Fork 58
ci(DATAGO-115758): optimize Dockerfile cache #457
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
b926325 to
4ca4300
Compare
0ab3cf9 to
e2aee55
Compare
WhiteSource Policy Violation Summary✅︎ No Blocking Whitesource Policy Violations found in solaceai/solace-agent-mesh-pr-457! |
mo-radwan1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thank you Art for taking care of this
| source_image="${{ inputs.source_registry }}/solace-agent-mesh:${{ inputs.source_image_tag }}" | ||
| echo "Pulling multi-platform image from ECR: ${source_image}" | ||
| # Pull the multi-platform manifest and both platform images | ||
| docker pull --platform linux/amd64 "${source_image}-amd64" | ||
| docker pull --platform linux/arm64 "${source_image}-arm64" | ||
| # Convert comma-separated tags to array | ||
| IFS=',' read -ra TAGS <<< "${{ steps.docker_tags.outputs.TAGS_LIST }}" | ||
| # For each target tag, create a multi-platform manifest | ||
| for TAG in "${TAGS[@]}"; do | ||
| TAG=$(echo "$TAG" | xargs) # Trim whitespace | ||
| echo "Creating multi-platform manifest for: ${TAG}" | ||
| # Tag the platform-specific images for DockerHub | ||
| docker tag "${source_image}-amd64" "${TAG}-amd64" | ||
| docker tag "${source_image}-arm64" "${TAG}-arm64" | ||
| # Push platform-specific images | ||
| docker push "${TAG}-amd64" | ||
| docker push "${TAG}-arm64" | ||
| # Create and push multi-platform manifest | ||
| docker buildx imagetools create \ | ||
| --tag "${TAG}" \ | ||
| "${TAG}-amd64" \ | ||
| "${TAG}-arm64" | ||
| docker push "${TAG}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Skopeo would be good to use here since we're just retagging and pushing rather than building
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| enable-cache: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should pin this sha
f9cf54b to
258649d
Compare
Comprehensive Dockerfile optimization for improved build performance, multi-architecture support, and licensing compliance. ## Performance Optimizations **Migrated from pip to uv (build stage only):** - 10-100x faster package installation with parallel downloads - BuildKit cache mounts for persistent dependency caching - npm cache mount for faster frontend builds **Optimized layer caching:** - Install build tools BEFORE copying dependency files - Dependency metadata copied before source code - Better cache hit rates on code-only changes **Multi-architecture support:** - Added TARGETARCH and TARGETPLATFORM support - Architecture-specific cache IDs to prevent cross-contamination - Works with: docker buildx build --platform linux/amd64,linux/arm64 ## Licensing & Compliance Fixes **Runtime stage uses pip (not uv):** - Addresses licensing attribution requirements for uv and its dependencies - uv only used in build stage (discarded, no licensing obligations) - pip is built-in to Python (no additional licenses) **Removed PIP_NO_CACHE_DIR=1:** - Enables pip caching for faster builds - Works with cache mounts for optimal performance ## Changes Summary **Build stage:** - ✅ Uses uv with cache mounts (fast builds) - ✅ Install hatch before COPY (better caching) - ✅ npm cache mount for frontend - ✅ BuildKit cache mounts **Runtime stage:** - ✅ Uses pip (licensing compliant) - ✅ No uv in any layer (clean layer history) - ✅ Minimal dependencies - ✅ Smaller image footprint ## Expected Performance Gains | Scenario | Improvement | |----------|-------------| | First build | 20-40% faster | | Rebuild (code change) | 60-80% faster | | Rebuild (deps unchanged) | 90% faster | ## Compliance - Linux Foundation layer attribution requirements met - No uv licensing obligations in final image - Clean layer history for auditing Co-authored-by: Artyom Morozov (layer caching optimization) Co-authored-by: Samuel Gamelin (licensing compliance feedback)
258649d to
1232d1f
Compare
|





DATAGO-115758