From 3c95dae65d4abbfed6ef51216121a878d75bbea4 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 3 Sep 2025 14:29:55 -0700 Subject: [PATCH 1/7] added docker pull for additional testing Signed-off-by: ruokun-niu --- .github/workflows/image-validation.yml | 256 +++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 .github/workflows/image-validation.yml diff --git a/.github/workflows/image-validation.yml b/.github/workflows/image-validation.yml new file mode 100644 index 000000000..69d8b026c --- /dev/null +++ b/.github/workflows/image-validation.yml @@ -0,0 +1,256 @@ +# Copyright 2024 The Drasi Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Image Validation + +on: + push: + branches: + - "image-validation-workflow" + +env: + DRASI_IMAGES: >- + ghcr.io/drasi-project/query-container-query-host + ghcr.io/drasi-project/query-container-publish-api + ghcr.io/drasi-project/query-container-view-svc + ghcr.io/drasi-project/api + ghcr.io/drasi-project/kubernetes-provider + ghcr.io/drasi-project/source-change-router + ghcr.io/drasi-project/source-change-dispatcher + ghcr.io/drasi-project/source-query-api + ghcr.io/drasi-project/source-debezium-reactivator + ghcr.io/drasi-project/source-sql-proxy + ghcr.io/drasi-project/source-cosmosdb-reactivator + ghcr.io/drasi-project/source-gremlin-proxy + ghcr.io/drasi-project/source-dataverse-reactivator + ghcr.io/drasi-project/source-dataverse-proxy + ghcr.io/drasi-project/source-eventhub-reactivator + ghcr.io/drasi-project/source-eventhub-proxy + ghcr.io/drasi-project/source-kubernetes-reactivator + ghcr.io/drasi-project/source-kubernetes-proxy + ghcr.io/drasi-project/reaction-signalr + ghcr.io/drasi-project/reaction-dataverse + ghcr.io/drasi-project/reaction-debezium + ghcr.io/drasi-project/reaction-debug + ghcr.io/drasi-project/reaction-eventgrid + ghcr.io/drasi-project/reaction-gremlin + ghcr.io/drasi-project/reaction-result + ghcr.io/drasi-project/reaction-storage-queue + ghcr.io/drasi-project/reaction-storedproc + ghcr.io/drasi-project/reaction-sync-dapr-statestore + ghcr.io/drasi-project/reaction-post-dapr-pubsub + ghcr.io/drasi-project/reaction-http + ghcr.io/drasi-project/reaction-eventbridge + +permissions: + contents: read + +jobs: + get-version: + name: Get Release Version + runs-on: ubuntu-latest + outputs: + image_tag: ${{ steps.get_version.outputs.IMAGE_TAG }} + + steps: + - name: Get latest release version + id: get_version + run: | + echo "🔍 Getting latest release version from GitHub API..." + + # Get latest release version (excluding RC versions) + getLatestRelease() { + local releaseUrl="https://api.github.com/repos/drasi-project/drasi-platform/releases" + + if command -v curl >/dev/null 2>&1; then + latest_release=$(curl -s $releaseUrl | grep \"tag_name\" | grep -v rc | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p') + else + latest_release=$(wget -q --header="Accept: application/json" -O - $releaseUrl | grep \"tag_name\" | grep -v rc | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p') + fi + + echo $latest_release + } + + LATEST_VERSION=$(getLatestRelease) + + if [ -z "$LATEST_VERSION" ]; then + echo "⚠️ Warning: Could not determine latest version, falling back to 'latest'" + LATEST_VERSION="latest" + else + echo "✅ Found latest version: $LATEST_VERSION" + fi + + echo "IMAGE_TAG=$LATEST_VERSION" >> $GITHUB_OUTPUT + + multi-arch-validation: + name: Multi-Architecture Validation + runs-on: ubuntu-latest + needs: get-version + + steps: + - name: Validate multi-architecture support + run: | + echo "🔍 Validating multi-architecture support for Drasi images..." + echo "📋 Using image tag: ${{ needs.get-version.outputs.image_tag }}" + + # Images that only need amd64 support + AMD64_ONLY_IMAGES="ghcr.io/drasi-project/reaction-dataverse" + + failed_images=() + + IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}" + + for image in $DRASI_IMAGES; do + echo "📦 Checking $image:$IMAGE_TAG" + + # Check if image exists and get manifest + if ! docker manifest inspect "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then + echo "❌ ERROR: Failed to inspect $image:$IMAGE_TAG - image may not exist" + failed_images+=("$image:$IMAGE_TAG (not found)") + continue + fi + + manifest=$(docker manifest inspect "${image}:${IMAGE_TAG}" 2>/dev/null) + + # Check for amd64 and arm64 architectures + amd64_support=false + arm64_support=false + + if echo "$manifest" | jq -e '.manifests[]? | select(.platform.architecture == "amd64")' > /dev/null 2>&1; then + amd64_support=true + elif echo "$manifest" | jq -e '.platform.architecture == "amd64"' > /dev/null 2>&1; then + amd64_support=true + fi + + if echo "$manifest" | jq -e '.manifests[]? | select(.platform.architecture == "arm64")' > /dev/null 2>&1; then + arm64_support=true + elif echo "$manifest" | jq -e '.platform.architecture == "arm64"' > /dev/null 2>&1; then + arm64_support=true + fi + + # Check if this image is in the amd64-only list + if echo "$AMD64_ONLY_IMAGES" | grep -q "$image"; then + # For amd64-only images, only require amd64 support + if [[ "$amd64_support" == true ]]; then + echo "✅ $image:$IMAGE_TAG supports amd64 (amd64-only image)" + else + echo "❌ ERROR: $image:$IMAGE_TAG missing amd64 support" + failed_images+=("$image:$IMAGE_TAG (missing: amd64)") + fi + else + # For all other images, require both amd64 and arm64 + if [[ "$amd64_support" == true && "$arm64_support" == true ]]; then + echo "✅ $image:$IMAGE_TAG supports both amd64 and arm64" + else + missing_archs="" + if [[ "$amd64_support" == false ]]; then + missing_archs="amd64" + fi + if [[ "$arm64_support" == false ]]; then + if [[ -n "$missing_archs" ]]; then + missing_archs="$missing_archs, arm64" + else + missing_archs="arm64" + fi + fi + echo "❌ ERROR: $image:$IMAGE_TAG missing support for: $missing_archs" + failed_images+=("$image:$IMAGE_TAG (missing: $missing_archs)") + fi + fi + done + + # Fail the job if any images don't meet their architecture requirements + if [ ${#failed_images[@]} -gt 0 ]; then + echo "" + echo "❌ VALIDATION FAILED: The following images do not meet architecture requirements:" + for failed_image in "${failed_images[@]}"; do + echo " - $failed_image" + done + echo "" + echo "Requirements:" + echo "- Most images: amd64 + arm64 support required" + echo "- reaction-dataverse: amd64 support only required" + exit 1 + fi + + echo "" + echo "✅ SUCCESS: All images meet their architecture requirements for version $IMAGE_TAG" + + image-pull-test: + name: Image Pull Test + runs-on: ${{ matrix.runner }} + needs: [get-version, multi-arch-validation] + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + runner: oracle-vm-8cpu-32gb-x86-64 + - arch: arm64 + runner: oracle-vm-8cpu-32gb-arm64 + + steps: + - name: Test image pull on ${{ matrix.arch }} + run: | + echo "🔍 Testing image pull on ${{ matrix.arch }} architecture..." + echo "📋 Using image tag: ${{ needs.get-version.outputs.image_tag }}" + echo "🖥️ Running on: ${{ matrix.runner }}" + + IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}" + + # Images that only need amd64 support + AMD64_ONLY_IMAGES="ghcr.io/drasi-project/reaction-dataverse" + + failed_pulls=() + skipped_images=() + + for image in $DRASI_IMAGES; do + # Skip reaction-dataverse unless we're on x86-64 runner + if echo "$AMD64_ONLY_IMAGES" | grep -q "$image" && [[ "${{ matrix.runner }}" != "oracle-vm-8cpu-32gb-x86-64" ]]; then + echo "⏭️ Skipping $image (only tested on x86-64 runner)" + skipped_images+=("$image") + continue + fi + + echo "📦 Pulling $image:$IMAGE_TAG on ${{ matrix.arch }}..." + + if docker pull "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then + echo "✅ Successfully pulled $image:$IMAGE_TAG" + # Clean up to save space + docker rmi "${image}:${IMAGE_TAG}" > /dev/null 2>&1 || true + else + echo "❌ Failed to pull $image:$IMAGE_TAG" + failed_pulls+=("$image:$IMAGE_TAG") + fi + done + + # Report results + if [ ${#skipped_images[@]} -gt 0 ]; then + echo "" + echo "⏭️ Skipped images (amd64-only): ${#skipped_images[@]}" + fi + + if [ ${#failed_pulls[@]} -gt 0 ]; then + echo "" + echo "❌ PULL TEST FAILED on ${{ matrix.arch }}: The following images could not be pulled:" + for failed_pull in "${failed_pulls[@]}"; do + echo " - $failed_pull" + done + echo "" + echo "This indicates that the ${{ matrix.arch }} image layers are missing or corrupted." + exit 1 + fi + + echo "" + echo "✅ SUCCESS: All required images pulled successfully on ${{ matrix.arch }}" \ No newline at end of file From 80b319cedb885252af03032f0be0f763e9acda6d Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 3 Sep 2025 15:25:57 -0700 Subject: [PATCH 2/7] add azure linux images Signed-off-by: ruokun-niu --- .github/workflows/image-validation.yml | 144 ++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-) diff --git a/.github/workflows/image-validation.yml b/.github/workflows/image-validation.yml index 69d8b026c..7e6a2a931 100644 --- a/.github/workflows/image-validation.yml +++ b/.github/workflows/image-validation.yml @@ -187,6 +187,94 @@ jobs: echo "" echo "✅ SUCCESS: All images meet their architecture requirements for version $IMAGE_TAG" + - name: Validate azure-linux variant architecture support + run: | + echo "🔍 Validating azure-linux variant multi-architecture support..." + echo "📋 Using image tag: ${{ needs.get-version.outputs.image_tag }}-azure-linux" + + # Images that only need amd64 support + AMD64_ONLY_IMAGES="ghcr.io/drasi-project/reaction-dataverse" + + failed_images=() + + IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}-azure-linux" + + for image in $DRASI_IMAGES; do + echo "📦 Checking $image:$IMAGE_TAG" + + # Check if image exists and get manifest + if ! docker manifest inspect "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then + echo "❌ ERROR: Failed to inspect $image:$IMAGE_TAG - image may not exist" + failed_images+=("$image:$IMAGE_TAG (not found)") + continue + fi + + manifest=$(docker manifest inspect "${image}:${IMAGE_TAG}" 2>/dev/null) + + # Check for amd64 and arm64 architectures + amd64_support=false + arm64_support=false + + if echo "$manifest" | jq -e '.manifests[]? | select(.platform.architecture == "amd64")' > /dev/null 2>&1; then + amd64_support=true + elif echo "$manifest" | jq -e '.platform.architecture == "amd64"' > /dev/null 2>&1; then + amd64_support=true + fi + + if echo "$manifest" | jq -e '.manifests[]? | select(.platform.architecture == "arm64")' > /dev/null 2>&1; then + arm64_support=true + elif echo "$manifest" | jq -e '.platform.architecture == "arm64"' > /dev/null 2>&1; then + arm64_support=true + fi + + # Check if this image is in the amd64-only list + if echo "$AMD64_ONLY_IMAGES" | grep -q "$image"; then + # For amd64-only images, only require amd64 support + if [[ "$amd64_support" == true ]]; then + echo "✅ $image:$IMAGE_TAG supports amd64 (amd64-only image)" + else + echo "❌ ERROR: $image:$IMAGE_TAG missing amd64 support" + failed_images+=("$image:$IMAGE_TAG (missing: amd64)") + fi + else + # For all other images, require both amd64 and arm64 + if [[ "$amd64_support" == true && "$arm64_support" == true ]]; then + echo "✅ $image:$IMAGE_TAG supports both amd64 and arm64" + else + missing_archs="" + if [[ "$amd64_support" == false ]]; then + missing_archs="amd64" + fi + if [[ "$arm64_support" == false ]]; then + if [[ -n "$missing_archs" ]]; then + missing_archs="$missing_archs, arm64" + else + missing_archs="arm64" + fi + fi + echo "❌ ERROR: $image:$IMAGE_TAG missing support for: $missing_archs" + failed_images+=("$image:$IMAGE_TAG (missing: $missing_archs)") + fi + fi + done + + # Fail the job if any images don't meet their architecture requirements + if [ ${#failed_images[@]} -gt 0 ]; then + echo "" + echo "❌ VALIDATION FAILED: The following azure-linux images do not meet architecture requirements:" + for failed_image in "${failed_images[@]}"; do + echo " - $failed_image" + done + echo "" + echo "Requirements:" + echo "- Most images: amd64 + arm64 support required" + echo "- reaction-dataverse: amd64 support only required" + exit 1 + fi + + echo "" + echo "✅ SUCCESS: All azure-linux images meet their architecture requirements for version $IMAGE_TAG" + image-pull-test: name: Image Pull Test runs-on: ${{ matrix.runner }} @@ -253,4 +341,58 @@ jobs: fi echo "" - echo "✅ SUCCESS: All required images pulled successfully on ${{ matrix.arch }}" \ No newline at end of file + echo "✅ SUCCESS: All required images pulled successfully on ${{ matrix.arch }}" + + - name: Test azure-linux image pull on ${{ matrix.arch }} + run: | + echo "🔍 Testing azure-linux image pull on ${{ matrix.arch }} architecture..." + echo "📋 Using image tag: ${{ needs.get-version.outputs.image_tag }}-azure-linux" + echo "🖥️ Running on: ${{ matrix.runner }}" + + IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}-azure-linux" + + # Images that only need amd64 support + AMD64_ONLY_IMAGES="ghcr.io/drasi-project/reaction-dataverse" + + failed_pulls=() + skipped_images=() + + for image in $DRASI_IMAGES; do + # Skip reaction-dataverse unless we're on x86-64 runner + if echo "$AMD64_ONLY_IMAGES" | grep -q "$image" && [[ "${{ matrix.runner }}" != "oracle-vm-8cpu-32gb-x86-64" ]]; then + echo "⏭️ Skipping $image (only tested on x86-64 runner)" + skipped_images+=("$image") + continue + fi + + echo "📦 Pulling $image:$IMAGE_TAG on ${{ matrix.arch }}..." + + if docker pull "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then + echo "✅ Successfully pulled $image:$IMAGE_TAG" + # Clean up to save space + docker rmi "${image}:${IMAGE_TAG}" > /dev/null 2>&1 || true + else + echo "❌ Failed to pull $image:$IMAGE_TAG" + failed_pulls+=("$image:$IMAGE_TAG") + fi + done + + # Report results + if [ ${#skipped_images[@]} -gt 0 ]; then + echo "" + echo "⏭️ Skipped images (amd64-only): ${#skipped_images[@]}" + fi + + if [ ${#failed_pulls[@]} -gt 0 ]; then + echo "" + echo "❌ AZURE-LINUX PULL TEST FAILED on ${{ matrix.arch }}: The following images could not be pulled:" + for failed_pull in "${failed_pulls[@]}"; do + echo " - $failed_pull" + done + echo "" + echo "This indicates that the ${{ matrix.arch }} azure-linux image layers are missing or corrupted." + exit 1 + fi + + echo "" + echo "✅ SUCCESS: All required azure-linux images pulled successfully on ${{ matrix.arch }}" \ No newline at end of file From 02f20fc895959197b16c61f96561a432dcfe47d1 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 3 Sep 2025 15:46:46 -0700 Subject: [PATCH 3/7] add a call in draft-release Signed-off-by: ruokun-niu --- .github/workflows/draft-release.yml | 9 +++++++ .github/workflows/image-validation.yml | 35 +++++++------------------- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index d107f435c..74e7b889f 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -342,6 +342,14 @@ jobs: name: drasi_vscode_extension path: ${{ env.RELEASE_PATH}}/drasi-*.vsix + # Call image validation workflow + validate-images: + name: Validate Images + needs: create-all-manifests + uses: ./.github/workflows/image-validation.yml + with: + tag: ${{ inputs.tag }} + # Final release job release: permissions: @@ -353,6 +361,7 @@ jobs: needs: - validate - create-all-manifests + - validate-images - package-cli - vscode-extension runs-on: ubuntu-latest diff --git a/.github/workflows/image-validation.yml b/.github/workflows/image-validation.yml index 7e6a2a931..fea4631de 100644 --- a/.github/workflows/image-validation.yml +++ b/.github/workflows/image-validation.yml @@ -18,6 +18,12 @@ on: push: branches: - "image-validation-workflow" + workflow_call: + inputs: + tag: + description: 'Version tag to validate' + required: true + type: string env: DRASI_IMAGES: >- @@ -64,34 +70,11 @@ jobs: image_tag: ${{ steps.get_version.outputs.IMAGE_TAG }} steps: - - name: Get latest release version + - name: Set version tag id: get_version run: | - echo "🔍 Getting latest release version from GitHub API..." - - # Get latest release version (excluding RC versions) - getLatestRelease() { - local releaseUrl="https://api.github.com/repos/drasi-project/drasi-platform/releases" - - if command -v curl >/dev/null 2>&1; then - latest_release=$(curl -s $releaseUrl | grep \"tag_name\" | grep -v rc | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p') - else - latest_release=$(wget -q --header="Accept: application/json" -O - $releaseUrl | grep \"tag_name\" | grep -v rc | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p') - fi - - echo $latest_release - } - - LATEST_VERSION=$(getLatestRelease) - - if [ -z "$LATEST_VERSION" ]; then - echo "⚠️ Warning: Could not determine latest version, falling back to 'latest'" - LATEST_VERSION="latest" - else - echo "✅ Found latest version: $LATEST_VERSION" - fi - - echo "IMAGE_TAG=$LATEST_VERSION" >> $GITHUB_OUTPUT + echo "🔍 Using provided tag: ${{ inputs.tag }}" + echo "IMAGE_TAG=${{ inputs.tag }}" >> $GITHUB_OUTPUT multi-arch-validation: name: Multi-Architecture Validation From a0af0e57674f2a0fb352e759d09b9f3458f647f0 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 3 Sep 2025 15:47:23 -0700 Subject: [PATCH 4/7] updated trigger Signed-off-by: ruokun-niu --- .github/workflows/image-validation.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/image-validation.yml b/.github/workflows/image-validation.yml index fea4631de..3b105eb9e 100644 --- a/.github/workflows/image-validation.yml +++ b/.github/workflows/image-validation.yml @@ -15,9 +15,11 @@ name: Image Validation on: - push: - branches: - - "image-validation-workflow" + workflow_dispatch: + inputs: + tag: + description: 'Version tag to validate' + required: true workflow_call: inputs: tag: From 8892617decd2c859bb97439621316c6f648e9b47 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Wed, 24 Sep 2025 21:09:12 -0700 Subject: [PATCH 5/7] resolve PRcomments Signed-off-by: ruokun-niu --- .github/workflows/image-validation.yml | 241 ++++++------------------- 1 file changed, 60 insertions(+), 181 deletions(-) diff --git a/.github/workflows/image-validation.yml b/.github/workflows/image-validation.yml index 3b105eb9e..c7f2d7191 100644 --- a/.github/workflows/image-validation.yml +++ b/.github/workflows/image-validation.yml @@ -82,136 +82,56 @@ jobs: name: Multi-Architecture Validation runs-on: ubuntu-latest needs: get-version - + strategy: + matrix: + include: + - variant: "" + amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + - variant: "-azure-linux" + amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + steps: - - name: Validate multi-architecture support + - name: Validate ${{ matrix.variant || 'default' }} variant architecture support run: | - echo "🔍 Validating multi-architecture support for Drasi images..." - echo "📋 Using image tag: ${{ needs.get-version.outputs.image_tag }}" - - # Images that only need amd64 support - AMD64_ONLY_IMAGES="ghcr.io/drasi-project/reaction-dataverse" - - failed_images=() - - IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}" - - for image in $DRASI_IMAGES; do - echo "📦 Checking $image:$IMAGE_TAG" - - # Check if image exists and get manifest - if ! docker manifest inspect "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then - echo "❌ ERROR: Failed to inspect $image:$IMAGE_TAG - image may not exist" - failed_images+=("$image:$IMAGE_TAG (not found)") - continue - fi - - manifest=$(docker manifest inspect "${image}:${IMAGE_TAG}" 2>/dev/null) - - # Check for amd64 and arm64 architectures - amd64_support=false - arm64_support=false - - if echo "$manifest" | jq -e '.manifests[]? | select(.platform.architecture == "amd64")' > /dev/null 2>&1; then - amd64_support=true - elif echo "$manifest" | jq -e '.platform.architecture == "amd64"' > /dev/null 2>&1; then - amd64_support=true - fi - - if echo "$manifest" | jq -e '.manifests[]? | select(.platform.architecture == "arm64")' > /dev/null 2>&1; then - arm64_support=true - elif echo "$manifest" | jq -e '.platform.architecture == "arm64"' > /dev/null 2>&1; then - arm64_support=true - fi - - # Check if this image is in the amd64-only list - if echo "$AMD64_ONLY_IMAGES" | grep -q "$image"; then - # For amd64-only images, only require amd64 support - if [[ "$amd64_support" == true ]]; then - echo "✅ $image:$IMAGE_TAG supports amd64 (amd64-only image)" - else - echo "❌ ERROR: $image:$IMAGE_TAG missing amd64 support" - failed_images+=("$image:$IMAGE_TAG (missing: amd64)") - fi - else - # For all other images, require both amd64 and arm64 - if [[ "$amd64_support" == true && "$arm64_support" == true ]]; then - echo "✅ $image:$IMAGE_TAG supports both amd64 and arm64" - else - missing_archs="" - if [[ "$amd64_support" == false ]]; then - missing_archs="amd64" - fi - if [[ "$arm64_support" == false ]]; then - if [[ -n "$missing_archs" ]]; then - missing_archs="$missing_archs, arm64" - else - missing_archs="arm64" - fi - fi - echo "❌ ERROR: $image:$IMAGE_TAG missing support for: $missing_archs" - failed_images+=("$image:$IMAGE_TAG (missing: $missing_archs)") - fi - fi - done - - # Fail the job if any images don't meet their architecture requirements - if [ ${#failed_images[@]} -gt 0 ]; then - echo "" - echo "❌ VALIDATION FAILED: The following images do not meet architecture requirements:" - for failed_image in "${failed_images[@]}"; do - echo " - $failed_image" - done - echo "" - echo "Requirements:" - echo "- Most images: amd64 + arm64 support required" - echo "- reaction-dataverse: amd64 support only required" - exit 1 - fi - - echo "" - echo "✅ SUCCESS: All images meet their architecture requirements for version $IMAGE_TAG" + VARIANT_NAME="${{ matrix.variant || 'default' }}" + echo "🔍 Validating $VARIANT_NAME variant multi-architecture support..." + + IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}${{ matrix.variant }}" + echo "📋 Using image tag: $IMAGE_TAG" - - name: Validate azure-linux variant architecture support - run: | - echo "🔍 Validating azure-linux variant multi-architecture support..." - echo "📋 Using image tag: ${{ needs.get-version.outputs.image_tag }}-azure-linux" - # Images that only need amd64 support - AMD64_ONLY_IMAGES="ghcr.io/drasi-project/reaction-dataverse" - + AMD64_ONLY_IMAGES="${{ matrix.amd64_only_images }}" + failed_images=() - - IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}-azure-linux" - + for image in $DRASI_IMAGES; do echo "📦 Checking $image:$IMAGE_TAG" - + # Check if image exists and get manifest if ! docker manifest inspect "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then echo "❌ ERROR: Failed to inspect $image:$IMAGE_TAG - image may not exist" failed_images+=("$image:$IMAGE_TAG (not found)") continue fi - + manifest=$(docker manifest inspect "${image}:${IMAGE_TAG}" 2>/dev/null) - + # Check for amd64 and arm64 architectures amd64_support=false arm64_support=false - + if echo "$manifest" | jq -e '.manifests[]? | select(.platform.architecture == "amd64")' > /dev/null 2>&1; then amd64_support=true elif echo "$manifest" | jq -e '.platform.architecture == "amd64"' > /dev/null 2>&1; then amd64_support=true fi - + if echo "$manifest" | jq -e '.manifests[]? | select(.platform.architecture == "arm64")' > /dev/null 2>&1; then arm64_support=true elif echo "$manifest" | jq -e '.platform.architecture == "arm64"' > /dev/null 2>&1; then arm64_support=true fi - + # Check if this image is in the amd64-only list if echo "$AMD64_ONLY_IMAGES" | grep -q "$image"; then # For amd64-only images, only require amd64 support @@ -242,11 +162,11 @@ jobs: fi fi done - + # Fail the job if any images don't meet their architecture requirements if [ ${#failed_images[@]} -gt 0 ]; then echo "" - echo "❌ VALIDATION FAILED: The following azure-linux images do not meet architecture requirements:" + echo "❌ VALIDATION FAILED: The following $VARIANT_NAME images do not meet architecture requirements:" for failed_image in "${failed_images[@]}"; do echo " - $failed_image" done @@ -256,9 +176,9 @@ jobs: echo "- reaction-dataverse: amd64 support only required" exit 1 fi - + echo "" - echo "✅ SUCCESS: All azure-linux images meet their architecture requirements for version $IMAGE_TAG" + echo "✅ SUCCESS: All $VARIANT_NAME images meet their architecture requirements for version $IMAGE_TAG" image-pull-test: name: Image Pull Test @@ -270,88 +190,47 @@ jobs: include: - arch: amd64 runner: oracle-vm-8cpu-32gb-x86-64 + variant: "" + amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" - arch: arm64 runner: oracle-vm-8cpu-32gb-arm64 - + variant: "" + amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + - arch: amd64 + runner: oracle-vm-8cpu-32gb-x86-64 + variant: "-azure-linux" + amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + - arch: arm64 + runner: oracle-vm-8cpu-32gb-arm64 + variant: "-azure-linux" + amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + steps: - - name: Test image pull on ${{ matrix.arch }} + - name: Test ${{ matrix.variant || 'default' }} image pull on ${{ matrix.arch }} run: | - echo "🔍 Testing image pull on ${{ matrix.arch }} architecture..." - echo "📋 Using image tag: ${{ needs.get-version.outputs.image_tag }}" - echo "🖥️ Running on: ${{ matrix.runner }}" - - IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}" - - # Images that only need amd64 support - AMD64_ONLY_IMAGES="ghcr.io/drasi-project/reaction-dataverse" - - failed_pulls=() - skipped_images=() - - for image in $DRASI_IMAGES; do - # Skip reaction-dataverse unless we're on x86-64 runner - if echo "$AMD64_ONLY_IMAGES" | grep -q "$image" && [[ "${{ matrix.runner }}" != "oracle-vm-8cpu-32gb-x86-64" ]]; then - echo "⏭️ Skipping $image (only tested on x86-64 runner)" - skipped_images+=("$image") - continue - fi - - echo "📦 Pulling $image:$IMAGE_TAG on ${{ matrix.arch }}..." - - if docker pull "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then - echo "✅ Successfully pulled $image:$IMAGE_TAG" - # Clean up to save space - docker rmi "${image}:${IMAGE_TAG}" > /dev/null 2>&1 || true - else - echo "❌ Failed to pull $image:$IMAGE_TAG" - failed_pulls+=("$image:$IMAGE_TAG") - fi - done - - # Report results - if [ ${#skipped_images[@]} -gt 0 ]; then - echo "" - echo "⏭️ Skipped images (amd64-only): ${#skipped_images[@]}" - fi - - if [ ${#failed_pulls[@]} -gt 0 ]; then - echo "" - echo "❌ PULL TEST FAILED on ${{ matrix.arch }}: The following images could not be pulled:" - for failed_pull in "${failed_pulls[@]}"; do - echo " - $failed_pull" - done - echo "" - echo "This indicates that the ${{ matrix.arch }} image layers are missing or corrupted." - exit 1 - fi - - echo "" - echo "✅ SUCCESS: All required images pulled successfully on ${{ matrix.arch }}" + VARIANT_NAME="${{ matrix.variant || 'default' }}" + echo "🔍 Testing $VARIANT_NAME image pull on ${{ matrix.arch }} architecture..." - - name: Test azure-linux image pull on ${{ matrix.arch }} - run: | - echo "🔍 Testing azure-linux image pull on ${{ matrix.arch }} architecture..." - echo "📋 Using image tag: ${{ needs.get-version.outputs.image_tag }}-azure-linux" + IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}${{ matrix.variant }}" + echo "📋 Using image tag: $IMAGE_TAG" echo "🖥️ Running on: ${{ matrix.runner }}" - - IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}-azure-linux" - + # Images that only need amd64 support - AMD64_ONLY_IMAGES="ghcr.io/drasi-project/reaction-dataverse" - + AMD64_ONLY_IMAGES="${{ matrix.amd64_only_images }}" + failed_pulls=() skipped_images=() - + for image in $DRASI_IMAGES; do - # Skip reaction-dataverse unless we're on x86-64 runner - if echo "$AMD64_ONLY_IMAGES" | grep -q "$image" && [[ "${{ matrix.runner }}" != "oracle-vm-8cpu-32gb-x86-64" ]]; then - echo "⏭️ Skipping $image (only tested on x86-64 runner)" + # Skip reaction-dataverse on arm64 (amd64-only image) + if echo "$AMD64_ONLY_IMAGES" | grep -q "$image" && [[ "${{ matrix.arch }}" == "arm64" ]]; then + echo "⏭️ Skipping $image (amd64-only image, not available for arm64)" skipped_images+=("$image") continue fi - + echo "📦 Pulling $image:$IMAGE_TAG on ${{ matrix.arch }}..." - + if docker pull "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then echo "✅ Successfully pulled $image:$IMAGE_TAG" # Clean up to save space @@ -361,23 +240,23 @@ jobs: failed_pulls+=("$image:$IMAGE_TAG") fi done - + # Report results if [ ${#skipped_images[@]} -gt 0 ]; then echo "" echo "⏭️ Skipped images (amd64-only): ${#skipped_images[@]}" fi - + if [ ${#failed_pulls[@]} -gt 0 ]; then echo "" - echo "❌ AZURE-LINUX PULL TEST FAILED on ${{ matrix.arch }}: The following images could not be pulled:" + echo "❌ $VARIANT_NAME PULL TEST FAILED on ${{ matrix.arch }}: The following images could not be pulled:" for failed_pull in "${failed_pulls[@]}"; do echo " - $failed_pull" done echo "" - echo "This indicates that the ${{ matrix.arch }} azure-linux image layers are missing or corrupted." + echo "This indicates that the ${{ matrix.arch }} $VARIANT_NAME image layers are missing or corrupted." exit 1 fi - + echo "" - echo "✅ SUCCESS: All required azure-linux images pulled successfully on ${{ matrix.arch }}" \ No newline at end of file + echo "✅ SUCCESS: All required $VARIANT_NAME images pulled successfully on ${{ matrix.arch }}" \ No newline at end of file From 23fd6736abdc0fbf9125269a6c26b65c727e7850 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Mon, 13 Oct 2025 09:54:13 -0700 Subject: [PATCH 6/7] test dataverse image Signed-off-by: ruokun-niu --- .github/workflows/draft-release.yml | 2 +- .github/workflows/image-validation.yml | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index de4fb03c4..e185ec5b5 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -68,7 +68,7 @@ env: {"label": "Kubernetes Reactivator", "path": "sources/kubernetes/kubernetes-reactivator", "name": "source-kubernetes-reactivator", "platforms": "linux/amd64,linux/arm64", "category": "sources"}, {"label": "Kubernetes Proxy", "path": "sources/kubernetes/kubernetes-proxy", "name": "source-kubernetes-proxy", "platforms": "linux/amd64,linux/arm64", "category": "sources"}, {"label": "SignalR", "path": "reactions/signalr/signalr-reaction", "name": "reaction-signalr", "platforms": "linux/amd64,linux/arm64", "category": "reactions"}, - {"label": "Dataverse", "path": "reactions/power-platform/dataverse/dataverse-reaction", "name": "reaction-dataverse", "platforms": "linux/amd64", "category": "reactions"}, + {"label": "Dataverse", "path": "reactions/power-platform/dataverse/dataverse-reaction", "name": "reaction-dataverse", "platforms": "linux/amd64,linux/arm64", "category": "reactions"}, {"label": "Debezium", "path": "reactions/debezium/debezium-reaction", "name": "reaction-debezium", "platforms": "linux/amd64,linux/arm64", "category": "reactions"}, {"label": "Debug", "path": "reactions/platform/debug-reaction", "name": "reaction-debug", "platforms": "linux/amd64,linux/arm64", "category": "reactions"}, {"label": "EventGrid", "path": "reactions/azure/eventgrid-reaction", "name": "reaction-eventgrid", "platforms": "linux/amd64,linux/arm64", "category": "reactions"}, diff --git a/.github/workflows/image-validation.yml b/.github/workflows/image-validation.yml index c7f2d7191..344800895 100644 --- a/.github/workflows/image-validation.yml +++ b/.github/workflows/image-validation.yml @@ -86,9 +86,9 @@ jobs: matrix: include: - variant: "" - amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + amd64_only_images: "" - variant: "-azure-linux" - amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + amd64_only_images: "" steps: - name: Validate ${{ matrix.variant || 'default' }} variant architecture support @@ -173,7 +173,6 @@ jobs: echo "" echo "Requirements:" echo "- Most images: amd64 + arm64 support required" - echo "- reaction-dataverse: amd64 support only required" exit 1 fi @@ -191,19 +190,19 @@ jobs: - arch: amd64 runner: oracle-vm-8cpu-32gb-x86-64 variant: "" - amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + amd64_only_images: "" - arch: arm64 runner: oracle-vm-8cpu-32gb-arm64 variant: "" - amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + amd64_only_images: "" - arch: amd64 runner: oracle-vm-8cpu-32gb-x86-64 variant: "-azure-linux" - amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + amd64_only_images: "" - arch: arm64 runner: oracle-vm-8cpu-32gb-arm64 variant: "-azure-linux" - amd64_only_images: "ghcr.io/drasi-project/reaction-dataverse" + amd64_only_images: "" steps: - name: Test ${{ matrix.variant || 'default' }} image pull on ${{ matrix.arch }} From a6d088758b0951047d7c8ffd17fd450327118dcb Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Mon, 13 Oct 2025 11:10:20 -0700 Subject: [PATCH 7/7] removed references to amd64-only images Signed-off-by: ruokun-niu --- .github/workflows/image-validation.yml | 66 ++++++-------------------- 1 file changed, 15 insertions(+), 51 deletions(-) diff --git a/.github/workflows/image-validation.yml b/.github/workflows/image-validation.yml index 344800895..8fe848aeb 100644 --- a/.github/workflows/image-validation.yml +++ b/.github/workflows/image-validation.yml @@ -86,9 +86,7 @@ jobs: matrix: include: - variant: "" - amd64_only_images: "" - variant: "-azure-linux" - amd64_only_images: "" steps: - name: Validate ${{ matrix.variant || 'default' }} variant architecture support @@ -99,9 +97,6 @@ jobs: IMAGE_TAG="${{ needs.get-version.outputs.image_tag }}${{ matrix.variant }}" echo "📋 Using image tag: $IMAGE_TAG" - # Images that only need amd64 support - AMD64_ONLY_IMAGES="${{ matrix.amd64_only_images }}" - failed_images=() for image in $DRASI_IMAGES; do @@ -132,34 +127,23 @@ jobs: arm64_support=true fi - # Check if this image is in the amd64-only list - if echo "$AMD64_ONLY_IMAGES" | grep -q "$image"; then - # For amd64-only images, only require amd64 support - if [[ "$amd64_support" == true ]]; then - echo "✅ $image:$IMAGE_TAG supports amd64 (amd64-only image)" - else - echo "❌ ERROR: $image:$IMAGE_TAG missing amd64 support" - failed_images+=("$image:$IMAGE_TAG (missing: amd64)") - fi + # All images require both amd64 and arm64 + if [[ "$amd64_support" == true && "$arm64_support" == true ]]; then + echo "✅ $image:$IMAGE_TAG supports both amd64 and arm64" else - # For all other images, require both amd64 and arm64 - if [[ "$amd64_support" == true && "$arm64_support" == true ]]; then - echo "✅ $image:$IMAGE_TAG supports both amd64 and arm64" - else - missing_archs="" - if [[ "$amd64_support" == false ]]; then - missing_archs="amd64" - fi - if [[ "$arm64_support" == false ]]; then - if [[ -n "$missing_archs" ]]; then - missing_archs="$missing_archs, arm64" - else - missing_archs="arm64" - fi + missing_archs="" + if [[ "$amd64_support" == false ]]; then + missing_archs="amd64" + fi + if [[ "$arm64_support" == false ]]; then + if [[ -n "$missing_archs" ]]; then + missing_archs="$missing_archs, arm64" + else + missing_archs="arm64" fi - echo "❌ ERROR: $image:$IMAGE_TAG missing support for: $missing_archs" - failed_images+=("$image:$IMAGE_TAG (missing: $missing_archs)") fi + echo "❌ ERROR: $image:$IMAGE_TAG missing support for: $missing_archs" + failed_images+=("$image:$IMAGE_TAG (missing: $missing_archs)") fi done @@ -172,7 +156,7 @@ jobs: done echo "" echo "Requirements:" - echo "- Most images: amd64 + arm64 support required" + echo "- All images: amd64 + arm64 support required" exit 1 fi @@ -190,19 +174,15 @@ jobs: - arch: amd64 runner: oracle-vm-8cpu-32gb-x86-64 variant: "" - amd64_only_images: "" - arch: arm64 runner: oracle-vm-8cpu-32gb-arm64 variant: "" - amd64_only_images: "" - arch: amd64 runner: oracle-vm-8cpu-32gb-x86-64 variant: "-azure-linux" - amd64_only_images: "" - arch: arm64 runner: oracle-vm-8cpu-32gb-arm64 variant: "-azure-linux" - amd64_only_images: "" steps: - name: Test ${{ matrix.variant || 'default' }} image pull on ${{ matrix.arch }} @@ -214,20 +194,9 @@ jobs: echo "📋 Using image tag: $IMAGE_TAG" echo "🖥️ Running on: ${{ matrix.runner }}" - # Images that only need amd64 support - AMD64_ONLY_IMAGES="${{ matrix.amd64_only_images }}" - failed_pulls=() - skipped_images=() for image in $DRASI_IMAGES; do - # Skip reaction-dataverse on arm64 (amd64-only image) - if echo "$AMD64_ONLY_IMAGES" | grep -q "$image" && [[ "${{ matrix.arch }}" == "arm64" ]]; then - echo "⏭️ Skipping $image (amd64-only image, not available for arm64)" - skipped_images+=("$image") - continue - fi - echo "📦 Pulling $image:$IMAGE_TAG on ${{ matrix.arch }}..." if docker pull "${image}:${IMAGE_TAG}" > /dev/null 2>&1; then @@ -241,11 +210,6 @@ jobs: done # Report results - if [ ${#skipped_images[@]} -gt 0 ]; then - echo "" - echo "⏭️ Skipped images (amd64-only): ${#skipped_images[@]}" - fi - if [ ${#failed_pulls[@]} -gt 0 ]; then echo "" echo "❌ $VARIANT_NAME PULL TEST FAILED on ${{ matrix.arch }}: The following images could not be pulled:"