rusackas commented on code in PR #45755:
URL: https://github.com/apache/superset/pull/45755#discussion_r4404820260


##########
.github/workflows/docker.yml:
##########
@@ -503,6 +693,68 @@ jobs:
             sleep 30
           done
 
+      # supersetbot tagged the linux/amd64 push above with the unsuffixed tags
+      # (<sha>, <short sha>, master, each with the preset chunk) and the
+      # linux/arm64 push in docker-build-arm64 with the same tags plus an
+      # `-arm` suffix. Fold each pair into one manifest list under the
+      # unsuffixed tag, which is what the single multi-platform build used
+      # to publish. The run-scoped GHA-* tags stay per platform (IMAGE_TAG
+      # carries a -arm64 suffix in the arm64 job) since nothing pulls them
+      # cross-platform.
+      - name: Publish the multi-platform manifest lists
+        if: >-
+          steps.publish_guard.outputs.publish == 'true' &&
+          github.event_name == 'push' && github.ref == 'refs/heads/master'
+        shell: bash
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          BUILD_PRESET: ${{ matrix.build_preset }}
+        run: |
+          set -euo pipefail
+          eval "$(bash scripts/docker-build-plan.sh "$GITHUB_EVENT_NAME" 
"$GITHUB_REF" "${GITHUB_REF_NAME:-}" "$BUILD_PLATFORM")"
+          mapfile -t tags < <(
+            DOCKERHUB_TOKEN= supersetbot docker \
+              --preset "$BUILD_PRESET" \
+              --context "$BUILD_CONTEXT" \
+              --context-ref "$BUILD_CONTEXT_REF" \
+              --platform linux/amd64 \
+              --dry-run |
+              grep -oE -- '-t apache/superset:[^[:space:]\\]+' | cut -d' ' -f2 
| sort -u
+          )
+          # Merge from the per-commit tags (the full-sha tag of this preset
+          # and its `-arm` twin) rather than from the mutable `master*` and
+          # `master*-arm` tags, so a newer commit's push landing mid-run
+          # cannot pair this commit's amd64 image with another commit's arm64.
+          sha_tag=""
+          for tag in "${tags[@]}"; do
+            case "$tag" in 
"apache/superset:${GITHUB_SHA}"|"apache/superset:${GITHUB_SHA}-"*) 
sha_tag="$tag"; break ;; esac
+          done
+          if [ -z "$sha_tag" ]; then
+            echo "::error::no per-commit tag found among: ${tags[*]}"
+            exit 1
+          fi
+          merged=0
+          for tag in "${tags[@]}"; do
+            case "$tag" in *:GHA-*) continue ;; esac
+            for attempt in 1 2 3; do
+              if docker buildx imagetools create -t "$tag" "$sha_tag" 
"${sha_tag}-arm"; then
+                merged=$((merged + 1))
+                break
+              fi
+              if [ "$attempt" -eq 3 ]; then
+                echo "::error::could not merge ${tag}-arm into $tag"
+                exit 1
+              fi
+              echo "::warning::manifest merge attempt ${attempt} for $tag 
failed; retrying in 15s..."
+              sleep 15
+            done
+            docker buildx imagetools inspect "$tag"

Review Comment:
   Good catch. The inspect is only informational once the merge has succeeded, 
so I made it non-fatal (warning on failure) in b34ffe8 so a blip there can no 
longer strand the later tags.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to