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.
This commit is contained in:
Vũ Thế Huy authored and GitHub committed 2026-11-09 22:24:26 -04:00
1 parent 6100784e3f
commit fcb2421ee4
1 file changed
+16 -7
+16 -7
View File
@@ -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 \