From a5b3fab110cca29d8bd8f568057bc5b801712f33 Mon Sep 17 00:00:00 2001 From: Andre Kurait Date: Mon, 9 Nov 2026 19:49:27 -0600 Subject: [PATCH] fix(ci): derive Neptune prefetch images from configuration (#7834) * fix(ci): derive Neptune prefetch images from configuration Read the Neptune pin for Java compatibility and shared shard prefetch from application.yml. Preserve best-effort pulls, shard selection and Node retry behavior. Signed-off-by: Andre Kurait * fix(ci): share configured Neptune image lookup Reuse one keyed lookup for Node, Java and shard prefetch. Read the Neo4j pin from configuration and correct the pre-pull overlap comment. Signed-off-by: Andre Kurait * fix(ci): share service image read and prefetch Use one service/key config reader across Neptune and CodeArtifact. Share configured-image pull/skip logic, preserve Node/Java failure policies and remove the unused test file. Signed-off-by: Andre Kurait * chore(ci): remove superseded Neptune image reader Remove the old helper left by the preceding rename publication. All consumers use the qualified shared service/key reader. Signed-off-by: Andre Kurait --------- Signed-off-by: Andre Kurait Signed-off-by: Andre Kurait --- .github/ci/prefetch-images.sh | 29 ++++++++++++++++------------- .github/ci/service-image.sh | 13 +++++++++++++ .github/workflows/compatibility.yml | 29 +++++++++++++++++------------ 3 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 .github/ci/service-image.sh diff --git a/.github/ci/prefetch-images.sh b/.github/ci/prefetch-images.sh index ab88e3c241..07c97bce0e 100755 --- a/.github/ci/prefetch-images.sh +++ b/.github/ci/prefetch-images.sh @@ -108,7 +108,18 @@ starts EmrServerlessHiveDockerIntegrationTest EmrHiveStepsDockerIntegrationTest # package token in shard.txt -> images its tests are known to launch # (measured inline pulls; update alongside image-catalog changes) grep -q '/docdb/' "$SHARD_FILE" && pull mongo:7.0 -grep -q '/neptune/' "$SHARD_FILE" && { pull neo4j:5-community; pull tinkerpop/gremlin-server:3.7.3; } +configured_image() { + image="$(bash .github/ci/service-image.sh "$1" "$2")" + if [ -n "$image" ]; then + pull "$image" + else + echo "$(date -u +%H:%M:%S) prefetch skipped: $1.$2 not readable" >> "$PREFETCH_LOG" + fi +} +if grep -q '/neptune/' "$SHARD_FILE"; then + configured_image neptune default-neo4j-image + configured_image neptune default-image +fi grep -q '/elasticache/' "$SHARD_FILE" && { pull valkey/valkey:8; pull memcached:1.6; } grep -q '/memorydb/' "$SHARD_FILE" && pull valkey/valkey:8 grep -q '/ecr/' "$SHARD_FILE" && pull registry:2 @@ -155,21 +166,13 @@ starts RedshiftMaxErrorPostgres18IntegrationTest \ && [ -n "$REDSHIFT_PG18_IMAGE" ] && pull "$REDSHIFT_PG18_IMAGE" # CodeArtifact's real registry fixtures each use one configured sidecar image. # Keep unrelated unit-test shards from pulling all four registries. -codeartifact_image() { - image="$(awk -v key="$1" '/^ codeartifact:/ { in_service=1; next } in_service && /^ [a-z]/ { exit } in_service && $1 == key ":" { gsub(/"/, "", $2); print $2; exit }' src/main/resources/application.yml)" - if [ -n "$image" ]; then - pull "$image" - else - echo "$(date -u +%H:%M:%S) prefetch skipped: codeartifact.$1 not readable" >> "$PREFETCH_LOG" - fi -} starts CodeArtifactMavenDockerIntegrationTest CodeArtifactMavenExternalConnectionDockerIntegrationTest \ - && codeartifact_image maven-image + && configured_image codeartifact maven-image starts CodeArtifactNpmDockerIntegrationTest CodeArtifactNpmExternalConnectionDockerIntegrationTest \ - && codeartifact_image npm-image + && configured_image codeartifact npm-image starts CodeArtifactNuGetDockerIntegrationTest CodeArtifactNuGetExternalConnectionDockerIntegrationTest \ - && codeartifact_image nuget-image -starts CodeArtifactPypiDockerIntegrationTest && codeartifact_image pypi-image + && configured_image codeartifact nuget-image +starts CodeArtifactPypiDockerIntegrationTest && configured_image codeartifact pypi-image # RDS's engine fixture starts MySQL at the default and explicitly requested versions. # Read both sources rather than duplicating their version pins here. if starts RdsParameterGroupEngineIntegrationTest; then diff --git a/.github/ci/service-image.sh b/.github/ci/service-image.sh new file mode 100644 index 0000000000..72e33066c3 --- /dev/null +++ b/.github/ci/service-image.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Read one service image key from the checked-out runtime configuration. +# An absent key prints nothing so callers retain their own failure policy. +set -eu +if [ "$#" -ne 2 ]; then + echo "Usage: service-image.sh " >&2 + exit 2 +fi +awk -v service="$1" -v key="$2" ' + $0 == " " service ":" { in_service=1; next } + in_service && /^ [a-z]/ { exit } + in_service && $1 == key ":" { gsub(/"/, "", $2); print $2; exit } +' src/main/resources/application.yml diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 26acf0f783..06f84f51b1 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -331,24 +331,37 @@ jobs: - name: Load native floci image run: gunzip -c /tmp/floci-native-image.tar.gz | docker load + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + sparse-checkout: | + compatibility-tests + .github/ci + src/main/resources + # The suite makes Floci pull ~30 images on a fresh runner, about 2 minutes inside the test - # window. Pulling the heavy ones in the background here overlaps them with Floci's start, the - # checkout and the test image build; a pull still running when a test needs the image is joined + # window. Pulling the heavy ones in the background here overlaps them with Floci's start and + # the test image build; a pull still running when a test needs the image is joined # by the daemon, not repeated. The list follows the "Pulling image:" lines of Floci's log; a # stale entry only costs a wasted pull, a missing one only the time it costs today. - name: Pre-pull service images if: matrix.test == 'sdk-test-java' run: | + NEPTUNE_IMAGE="$(bash .github/ci/service-image.sh neptune default-image)" + if [ -z "$NEPTUNE_IMAGE" ]; then + echo "::warning::Cannot read Neptune default-image from application.yml; skipping Neptune pre-pull" + fi for image in \ opensearchproject/opensearch:2.19.5 opensearchproject/opensearch:2.11.1 \ mysql:8.0 postgres:16.3-alpine postgres:16-alpine postgres:15-alpine \ apache/flink:2.3 rabbitmq:3-management redpandadata/redpanda:latest \ - tinkerpop/gremlin-server:3.7.3 influxdb:2.7 valkey/valkey:8 \ + "$NEPTUNE_IMAGE" influxdb:2.7 valkey/valkey:8 \ rancher/k3s:latest rancher/k3s:v1.29.14-k3s1 registry:2 \ public.ecr.aws/lambda/python:3.12 public.ecr.aws/lambda/python:3.14 \ public.ecr.aws/lambda/nodejs:20 public.ecr.aws/lambda/provided:al2023 \ floci/floci-duck:latest floci/floci-sidecar-cedar:1.1.0 floci/floci-sidecar-graphql:0.2.0 \ nginx:alpine nginx:latest alpine:3 alpine:latest busybox:stable busybox:latest; do + [ -n "$image" ] || continue nohup bash -c ' start=$SECONDS if err=$(docker pull -q "$1" 2>&1 >/dev/null); then result=ok; else result=FAILED; fi @@ -404,19 +417,11 @@ jobs: docker logs --tail 50 floci exit 1 - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - sparse-checkout: | - compatibility-tests - .github/ci - src/main/resources - # Keep the first Neptune request inside its existing test deadline on a cold runner. - name: Pre-pull Neptune image for Node SDK if: matrix.test == 'sdk-test-node' run: | - image="$(awk '/^ neptune:/ { in_service=1; next } in_service && /^ [a-z]/ { exit } in_service && $1 == "default-image:" { gsub(/"/, "", $2); print $2; exit }' src/main/resources/application.yml)" + image="$(bash .github/ci/service-image.sh neptune default-image)" if [ -z "$image" ]; then echo "::error::Cannot read Neptune default-image from application.yml" exit 1