-
Notifications
You must be signed in to change notification settings - Fork 322
ci: Create per-platform Dockerfile for proper Docker image layer caching #3747
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,8 +23,8 @@ on: | |||||||||
| type: string | ||||||||||
|
|
||||||||||
| env: | ||||||||||
| DOCKERHUB_REPO: electricsql/electric | ||||||||||
| DOCKERHUB_CANARY_REPO: electricsql/electric-canary | ||||||||||
| DOCKERHUB_REPO: alco/electric | ||||||||||
| DOCKERHUB_CANARY_REPO: alco/electric-canary | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| derive_build_vars: | ||||||||||
|
|
@@ -111,14 +111,30 @@ jobs: | |||||||||
| - uses: docker/login-action@v3 | ||||||||||
| with: | ||||||||||
| registry: docker.io | ||||||||||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||||||||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||||||||
| username: ${{ secrets.DOCKERHUB_USERNAME_ALCO }} | ||||||||||
| password: ${{ secrets.DOCKERHUB_TOKEN_ALCO }} | ||||||||||
|
Comment on lines
+114
to
+115
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert temporary credentials before merging. These use personal secrets ( - username: ${{ secrets.DOCKERHUB_USERNAME_ALCO }}
- password: ${{ secrets.DOCKERHUB_TOKEN_ALCO }}
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| - name: Create a temporary per-platform Dockerfile (CI only) | ||||||||||
| run: | | ||||||||||
| set -euo pipefail | ||||||||||
|
|
||||||||||
| source_dockerfile="packages/sync-service/Dockerfile" | ||||||||||
|
|
||||||||||
| # Make the Dockerfile path unique per platform so Blacksmith uses separate sticky | ||||||||||
| # disks for image layer caching. | ||||||||||
| # Without this, caches produced by builds for different platforms trample each other | ||||||||||
| # and only the last written cache is persistent for subsequent builds. | ||||||||||
| dst="/tmp/sync-service.Dockerfile.${{ matrix.platform_id }}" | ||||||||||
| { echo "# blacksmith-cache-scope: sync-service/${{ matrix.platform_id }}"; cat "$source_dockerfile"; } > "$dst" | ||||||||||
|
|
||||||||||
| echo "SYNC_SERVICE_DOCKERFILE=$dst" >> "$GITHUB_ENV" | ||||||||||
|
|
||||||||||
| - name: Build and push by digest | ||||||||||
| id: build | ||||||||||
| uses: useblacksmith/build-push-action@v2 | ||||||||||
| with: | ||||||||||
| context: packages/sync-service | ||||||||||
| file: ${{ env.SYNC_SERVICE_DOCKERFILE }} | ||||||||||
| build-contexts: | | ||||||||||
| electric-telemetry=packages/electric-telemetry | ||||||||||
| build-args: | | ||||||||||
|
|
@@ -149,8 +165,8 @@ jobs: | |||||||||
| steps: | ||||||||||
| - uses: docker/login-action@v3 | ||||||||||
| with: | ||||||||||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||||||||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||||||||
| username: ${{ secrets.DOCKERHUB_USERNAME_ALCO }} | ||||||||||
| password: ${{ secrets.DOCKERHUB_TOKEN_ALCO }} | ||||||||||
|
Comment on lines
+168
to
+169
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert temporary credentials before merging. Same as the build job—revert to production secrets. - username: ${{ secrets.DOCKERHUB_USERNAME_ALCO }}
- password: ${{ secrets.DOCKERHUB_TOKEN_ALCO }}
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| - uses: useblacksmith/setup-docker-builder@v1 | ||||||||||
|
|
||||||||||
|
|
||||||||||
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.
Revert temporary Docker Hub repositories before merging.
These point to a personal Docker Hub account (
alco/*) instead of the officialelectricsql/*repositories. Per the commit message, this is intentionally temporary for testing. Ensure these are reverted to the production values before merge.📝 Committable suggestion
🤖 Prompt for AI Agents