From fcb2421ee4145603f38697480683dad2c247b2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C5=A9=20Th=E1=BA=BF=20Huy?= <31652864+vuthehuyht@users.noreply.github.com> Date: Tue, 10 Nov 2026 09:24:26 +0700 Subject: [PATCH] fix(ci): prefetch bind-directory Docker test images (#7651) * fix(ci): prefetch bind-directory Docker test images * fix(ci): locate OpenSearch catalog dynamically and log unreadable image Find OpenSearchVersions.java dynamically instead of hardcoding its path, and log to PREFETCH_LOG when the default OpenSearch image cannot be parsed. * fix(ci): drop stale REDSHIFT_PG18 prefetch block RedshiftMaxErrorPostgres18IntegrationTest was renamed and no longer overrides the image, so the block only warned about a stale key on every shard. The renamed test runs on the default image already prefetched by the /redshift/ line. --- .github/ci/prefetch-images.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/ci/prefetch-images.sh b/.github/ci/prefetch-images.sh index 07c97bce0e..3ed2857c54 100755 --- a/.github/ci/prefetch-images.sh +++ b/.github/ci/prefetch-images.sh @@ -65,12 +65,27 @@ test_image() { # than for the second it saves. ContainerPlatformDockerIntegrationTest is not listed: it pulls the # other architecture, which a prefetch of the host image cannot serve. BUSYBOX_IMAGE="$(test_image BUSYBOX)" -starts ContainerHostNetworkDockerIntegrationTest EcsServiceDiscoveryDockerIntegrationTest \ +starts ContainerHostNetworkDockerIntegrationTest ContainerBindDirectoryDockerIntegrationTest EcsServiceDiscoveryDockerIntegrationTest \ EcsContainerManagerEfsIsolationDockerIntegrationTest EcsContainerManagerFirelensDockerIntegrationTest \ EcsContainerManagerStatsDockerIntegrationTest EcsContainerManagerVolumesFromDockerIntegrationTest \ EcsExecChannelDockerIntegrationTest EcsImagePullDockerIntegrationTest EcsLeftoverContainersDockerIntegrationTest \ BatchDockerRunnerDockerIntegrationTest SageMakerDockerIntegrationTest \ && [ -n "$BUSYBOX_IMAGE" ] && pull "$BUSYBOX_IMAGE" +# Bind-directory ownership uses the default OpenSearch image, whose cold pull can outlast a test. +OPENSEARCH_VERSIONS="$(find src/main/java -name OpenSearchVersions.java -print -quit)" +opensearch_default_image() { + file="${OPENSEARCH_VERSIONS:-/dev/null}" + default_version="$(grep -oE 'DEFAULT_VERSION = "[^"]+"' "$file" | cut -d '"' -f 2)" + image="" + if [ -n "$default_version" ]; then + image="$(grep -F "VERSION_TO_IMAGE.put(\"$default_version\"" "$file" \ + | grep -oE 'opensearchproject/opensearch:[^"]+')" + fi + [ -n "$image" ] || echo "$(date -u +%H:%M:%S) prefetch skipped: OpenSearch default image not readable" >> "$PREFETCH_LOG" + echo "$image" +} +OPENSEARCH_IMAGE="$(opensearch_default_image)" +starts ContainerBindDirectoryDockerIntegrationTest && [ -n "$OPENSEARCH_IMAGE" ] && pull "$OPENSEARCH_IMAGE" # EcsImagePullDockerIntegrationTest runs its own registry to move a tag in; the /ecr/ line below # covers the shards that run the ECR tests. REGISTRY_IMAGE="$(test_image REGISTRY)" @@ -158,12 +173,6 @@ starts RdsTemplateDatabaseRestoreIntegrationTest \ DSQL_IMAGE="$(awk '/^ dsql:/ { in_dsql=1; next } in_dsql && /^ [a-z]/ { exit } in_dsql && /^ image:/ { gsub(/"/, "", $2); print $2; exit }' src/main/resources/application.yml)" starts DsqlDataPlaneIntegrationTest DsqlClusterPolicyIntegrationTest DsqlTransactionAgeIntegrationTest \ && [ -n "$DSQL_IMAGE" ] && pull "$DSQL_IMAGE" -# This regression deliberately overrides Redshift's default image to PostgreSQL 18. -# Read that test's pin so updating its override also updates the prefetch. -REDSHIFT_PG18_TEST="$(find src/test/java -name RedshiftMaxErrorPostgres18IntegrationTest.java -print -quit)" -REDSHIFT_PG18_IMAGE="$(grep -oE '"postgres:[^"]+"' "${REDSHIFT_PG18_TEST:-/dev/null}" | tr -d '"')" -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. starts CodeArtifactMavenDockerIntegrationTest CodeArtifactMavenExternalConnectionDockerIntegrationTest \