Skip to content

Commit 3aafdf0

Browse files
authored
Updated docker image builds with new requirements (#3613)
# Description Enabling multi-arch build with Isaac SIM 5.1 images
1 parent b7004f4 commit 3aafdf0

File tree

1 file changed

+50
-4
lines changed

1 file changed

+50
-4
lines changed

.github/workflows/postmerge-ci.yml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
branches:
1111
- main
1212
- devel
13+
- release/**
1314

1415
# Concurrency control to prevent parallel runs
1516
concurrency:
@@ -43,8 +44,17 @@ jobs:
4344
fetch-depth: 0
4445
lfs: true
4546

47+
- name: Set up QEMU
48+
uses: docker/setup-qemu-action@v3
49+
with:
50+
platforms: linux/arm64
51+
4652
- name: Set up Docker Buildx
4753
uses: docker/setup-buildx-action@v3
54+
with:
55+
platforms: linux/amd64,linux/arm64
56+
driver-opts: |
57+
image=moby/buildkit:buildx-stable-1
4858
4959
- name: Login to NGC
5060
run: |
@@ -100,12 +110,48 @@ jobs:
100110
COMBINED_TAG="${REPO_SHORT_NAME}-${SAFE_BRANCH_NAME}-${IMAGE_BASE_VERSION}"
101111
BUILD_TAG="${COMBINED_TAG}-b${{ github.run_number }}"
102112
113+
# Determine if multiarch is supported by inspecting the base image manifest
114+
echo "Checking if base image supports multiarch..."
115+
BASE_IMAGE_FULL="${{ env.ISAACSIM_BASE_IMAGE }}:${IMAGE_BASE_VERSION}"
116+
117+
# Get architectures from the base image manifest
118+
ARCHITECTURES=$(docker manifest inspect "$BASE_IMAGE_FULL" 2>/dev/null | grep -o '"architecture": "[^"]*"' | cut -d'"' -f4 | sort -u)
119+
120+
if [ -z "$ARCHITECTURES" ]; then
121+
echo "Could not inspect base image manifest: $BASE_IMAGE_FULL"
122+
echo "Defaulting to AMD64 only for safety"
123+
BUILD_PLATFORMS="linux/amd64"
124+
else
125+
echo "Base image architectures found:"
126+
echo "$ARCHITECTURES" | sed 's/^/ - /'
127+
128+
# Check if both amd64 and arm64 are present
129+
HAS_AMD64=$(echo "$ARCHITECTURES" | grep -c "amd64" || true)
130+
HAS_ARM64=$(echo "$ARCHITECTURES" | grep -c "arm64" || true)
131+
132+
if [ "$HAS_AMD64" -gt 0 ] && [ "$HAS_ARM64" -gt 0 ]; then
133+
echo "Base image supports multiarch (amd64 + arm64)"
134+
BUILD_PLATFORMS="linux/amd64,linux/arm64"
135+
elif [ "$HAS_AMD64" -gt 0 ]; then
136+
echo "Base image only supports amd64"
137+
BUILD_PLATFORMS="linux/amd64"
138+
elif [ "$HAS_ARM64" -gt 0 ]; then
139+
echo "Base image only supports arm64"
140+
BUILD_PLATFORMS="linux/arm64"
141+
else
142+
echo "Unknown architecture support, defaulting to amd64"
143+
BUILD_PLATFORMS="linux/amd64"
144+
fi
145+
fi
146+
103147
echo "Building image: ${{ env.ISAACLAB_IMAGE_NAME }}:$COMBINED_TAG"
104148
echo "IsaacSim version: $IMAGE_BASE_VERSION"
149+
echo "Base image: $BASE_IMAGE_FULL"
150+
echo "Target platforms: $BUILD_PLATFORMS"
105151
106-
# Build Docker image once with both tags
152+
# Build Docker image once with both tags for multiple architectures
107153
docker buildx build \
108-
--platform linux/amd64 \
154+
--platform $BUILD_PLATFORMS \
109155
--progress=plain \
110156
-t ${{ env.ISAACLAB_IMAGE_NAME }}:$COMBINED_TAG \
111157
-t ${{ env.ISAACLAB_IMAGE_NAME }}:$BUILD_TAG \
@@ -119,6 +165,6 @@ jobs:
119165
-f docker/Dockerfile.base \
120166
--push .
121167
122-
echo "✅ Successfully built and pushed: ${{ env.ISAACLAB_IMAGE_NAME }}:$COMBINED_TAG"
123-
echo "✅ Successfully built and pushed: ${{ env.ISAACLAB_IMAGE_NAME }}:$BUILD_TAG"
168+
echo "✅ Successfully built and pushed: ${{ env.ISAACLAB_IMAGE_NAME }}:$COMBINED_TAG (platforms: $BUILD_PLATFORMS)"
169+
echo "✅ Successfully built and pushed: ${{ env.ISAACLAB_IMAGE_NAME }}:$BUILD_TAG (platforms: $BUILD_PLATFORMS)"
124170
done

0 commit comments

Comments
 (0)