Files
floci/.github/ci/prefetch-images.sh
T

325 lines
23 KiB
Bash
Executable File

#!/usr/bin/env bash
# Best-effort background prefetch of the Docker images this shard's tests use.
# Never fails the build; a pull that loses the race just means the test pulls
# it itself, exactly as before. Pulls only images implied by shard.txt so four
# shards do not each pull all images (registry rate-limit exposure).
# ECR Public counts anonymous transfer per runner IP, so an image is keyed on the classes that
# start it whenever its package is spread over every shard (Lambda, ECS), and a key that names a
# class is checked against src/test/java so a rename cannot silently turn the prefetch off. The
# images the tests start come from Docker Hub wherever it carries them, which GitHub-hosted
# runners pull without a limit; TestImages says why, and why the Lambda runtimes cannot.
# Each pull writes one line to $PREFETCH_LOG (prefetch-images.log next to shard.txt by default):
# "prefetched <image>" or "prefetch failed <image>: <last line of docker's output>", timestamped,
# so a test that pulled the image itself can be told apart from a prefetch that failed or was
# still downloading. The lines go to a file because the pulls outlive the workflow step that
# started them and the step's stdout is closed by then.
# A nightly check, a *NightlyIntegrationTest class, keys its images on its own name: ci.yml leaves those names out
# of the list it passes, so they are pulled only for nightly-checks.yml, which passes nothing else.
# Usage: prefetch-images.sh <shard.txt>
set -u
SHARD_FILE="${1:-}"
PREFETCH_LOG="${PREFETCH_LOG:-$(dirname "${SHARD_FILE:-.}")/prefetch-images.log}"
command -v docker >/dev/null 2>&1 || exit 0
[ -r "$SHARD_FILE" ] || { echo "prefetch-images: ${SHARD_FILE:-<none>} not readable, nothing prefetched" >&2; exit 0; }
: > "$PREFETCH_LOG"
pull_and_log() {
if output="$(docker pull -q "$1" 2>&1)"; then
echo "$(date -u +%H:%M:%S) prefetched $1" >> "$PREFETCH_LOG"
else
echo "$(date -u +%H:%M:%S) prefetch failed $1: $(printf '%s\n' "$output" | tail -n 1)" >> "$PREFETCH_LOG"
fi
}
# Docker Hub and other registries: each pull in its own background job, as before. An image two
# entries name (busybox:stable is both the EFS init image and the tests' shell) is pulled once.
REQUESTED=""
pull() {
case " $REQUESTED " in *" $1 "*) return 0;; esac
REQUESTED="$REQUESTED $1"
pull_and_log "$1" &
}
# ECR Public counts unauthenticated pulls per second as well as bytes, so its images are queued
# and pulled one after another, a second apart, in a single background job instead of all at once.
ECR_PUBLIC_IMAGES=""
ecr() { ECR_PUBLIC_IMAGES="$ECR_PUBLIC_IMAGES $1"; }
# True when the shard runs any of the named classes. A name with no source file is a stale key,
# recorded in the log so the next reader can see why an image stopped being prefetched.
starts() {
for class in "$@"; do
[ -n "$(find src/test/java -name "$class.java" -print -quit)" ] \
|| echo "$(date -u +%H:%M:%S) stale prefetch key: no test class named $class" >> "$PREFETCH_LOG"
done
grep -qE "$(IFS='|'; echo "$*")" "$SHARD_FILE"
}
# The image a test constant pins, or empty (and a log line) when the constant cannot be read.
# TestImages is found by name rather than by its package path, which a package rename changes.
TEST_IMAGES="$(find src/test/java -path '*/testing/TestImages.java' -print -quit)"
if starts SsmSessionManagerDockerNightlyIntegrationTest; then
pull debian:bookworm-slim
pull postgres:17
fi
if starts RdsIntegrationRetryPermissionDockerNightlyIntegrationTest; then
pull postgres:16-alpine
fi
# RdsPostgresReplicationSlotsDockerNightlyIntegrationTest starts an instance of each PostgreSQL major from 13 to 18.
if starts RdsPostgresReplicationSlotsDockerNightlyIntegrationTest; then
for major in 13 14 15 16 17 18; do
pull "postgres:$major-alpine"
done
fi
if starts Ec2PublishedConnectionNightlyIntegrationTest; then
ecr public.ecr.aws/docker/library/alpine:latest
pull alpine/socat:1.8.1.3
fi
# Ec2GuestShutdownDockerNightlyIntegrationTest launches ami-alpine and attaches a volume through the
# volume helper (floci.services.ec2.volume-helper-image).
if starts Ec2GuestShutdownDockerNightlyIntegrationTest; then
ecr public.ecr.aws/docker/library/alpine:latest
pull alpine:3.21
fi
# EksNodeRestartDockerNightlyIntegrationTest attaches a volume to a k3s node through the same volume helper; the k3s
# image is pulled for the /eks/ package below.
if starts EksNodeRestartDockerNightlyIntegrationTest; then
pull alpine:3.21
fi
test_image() {
image="$(grep -oE "$1 *= *\"[^\"]+\"" "${TEST_IMAGES:-/dev/null}" | grep -oE '"[^"]+"' | tr -d '"')"
[ -n "$image" ] || echo "$(date -u +%H:%M:%S) prefetch skipped: TestImages.$1 not readable" >> "$PREFETCH_LOG"
echo "$image"
}
# Every Docker-backed test that needs a shell uses the one busybox TestImages pins, so one pull
# serves all of them. It is also the base of the image
# EcsContainerManagerVolumesFromDockerNightlyIntegrationTest builds, and a build resolves its base against
# the registry rather than through ImageCacheService, so it is prefetched for the cache hit rather
# 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 ContainerBindDirectoryDockerIntegrationTest EcsServiceDiscoveryDockerNightlyIntegrationTest \
EcsContainerManagerEfsIsolationDockerIntegrationTest EcsContainerManagerFirelensDockerNightlyIntegrationTest \
EcsContainerManagerStatsDockerIntegrationTest EcsContainerManagerVolumesFromDockerNightlyIntegrationTest \
EcsHealthCheckDockerNightlyIntegrationTest \
EcsExecChannelDockerIntegrationTest EcsImagePullDockerIntegrationTest EcsLeftoverContainersDockerIntegrationTest \
BatchDockerRunnerDockerIntegrationTest SageMakerDockerNightlyIntegrationTest DockerPoolSaturationNightlyIntegrationTest \
&& [ -n "$BUSYBOX_IMAGE" ] && pull "$BUSYBOX_IMAGE"
# Bind-directory ownership uses the default OpenSearch image, whose cold pull can outlast a test, and the nightly
# OpenSearchDomainRestartNightlyIntegrationTest runs a domain on it.
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 OpenSearchDomainRestartNightlyIntegrationTest \
&& [ -n "$OPENSEARCH_IMAGE" ] && pull "$OPENSEARCH_IMAGE"
# MwaaEnvironmentRestartDockerNightlyIntegrationTest runs an environment on the default Airflow version, whose image
# pairs it with the Python release MwaaEnvironmentManager.pythonTagFor names, beside its Postgres database.
if starts MwaaEnvironmentRestartDockerNightlyIntegrationTest; then
MWAA_CONFIG="$(sed -n '/^ mwaa:$/,/^ [a-z]/p' src/main/resources/application.yml 2>/dev/null)"
MWAA_VERSION="$(printf '%s\n' "$MWAA_CONFIG" | grep -oE 'default-version: "[0-9.]+"' | cut -d '"' -f 2)"
MWAA_POSTGRES_IMAGE="$(printf '%s\n' "$MWAA_CONFIG" | grep -oE 'default-postgres-image: "[^"]+"' | cut -d '"' -f 2)"
case "$MWAA_VERSION" in
2.[0-9].*|2.10.*) MWAA_PYTHON=python3.11 ;;
*) MWAA_PYTHON=python3.12 ;;
esac
if [ -n "$MWAA_VERSION" ] && [ -n "$MWAA_POSTGRES_IMAGE" ]; then
pull "apache/airflow:$MWAA_VERSION-$MWAA_PYTHON"
pull "$MWAA_POSTGRES_IMAGE"
else
echo "$(date -u +%H:%M:%S) prefetch skipped: MWAA default images not readable" >> "$PREFETCH_LOG"
fi
fi
# 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)"
starts EcsImagePullDockerIntegrationTest && [ -n "$REGISTRY_IMAGE" ] && pull "$REGISTRY_IMAGE"
PYTHON_ALPINE_IMAGE="$(test_image PYTHON_ALPINE)"
starts ContainerCaBundleDockerIntegrationTest EcsCredentialsProxyDockerNightlyIntegrationTest SageMakerDockerNightlyIntegrationTest \
&& [ -n "$PYTHON_ALPINE_IMAGE" ] && pull "$PYTHON_ALPINE_IMAGE"
# DNS lifecycle guests use Python, including inherited protected/shared checks. Their network helpers build
# from alpine:3.21 locally, so prefetch the base rather than pulling the locally built helper image.
if starts EcsPrivateDnsGuestDockerNightlyIntegrationTest EcsSharedPrivateDnsGuestDockerNightlyIntegrationTest \
EcsProtectedPrivateDnsGuestDockerNightlyIntegrationTest Ec2PrivateDnsGuestDockerNightlyIntegrationTest \
Ec2ProtectedPrivateDnsGuestDockerNightlyIntegrationTest; then
[ -n "$PYTHON_ALPINE_IMAGE" ] && pull "$PYTHON_ALPINE_IMAGE"
pull alpine:3.21
fi
CORRETTO_8_IMAGE="$(test_image CORRETTO_8)"
starts ContainerCaBundleDockerIntegrationTest && [ -n "$CORRETTO_8_IMAGE" ] && pull "$CORRETTO_8_IMAGE"
# The Firelens test names the log router image itself rather than taking it from config.
FLUENT_BIT_IMAGE="$(test_image FLUENT_BIT)"
starts EcsContainerManagerFirelensDockerNightlyIntegrationTest && [ -n "$FLUENT_BIT_IMAGE" ] && pull "$FLUENT_BIT_IMAGE"
# ECR Public images, in queue order: the Lambda runtimes by size, then EMR's. They are the only images
# left on ECR Public; everything Docker Hub also carries is pulled from there (see TestImages).
# Lambda runtimes, measured from a full four-shard run by pairing each ImageCacheService
# "Pulling image" / "Image already present locally" line with the class that logged it.
# nodejs:20 is the runtime the API Gateway, ELBv2 and Lambda integration tests resolve and every
# shard reaches it; the two Python runtimes each have one Docker-backed class; nodejs:18 was
# pulled by every shard and started by none. A class missed here pulls inline, as before.
{ grep -qE '/apigateway/|/apigatewayv2/|/lambda/' "$SHARD_FILE" \
|| starts EventBridgeV2LambdaDeliveryDockerNightlyIntegrationTest; } && ecr public.ecr.aws/lambda/nodejs:20
grep -qE '/lambdaweb/' "$SHARD_FILE" && ecr public.ecr.aws/lambda/nodejs:24
starts SwfLambdaIntegrationTest && ecr public.ecr.aws/lambda/python:3.12
starts ElbV2LambdaTargetDataPlaneIntegrationTest && ecr public.ecr.aws/lambda/python:3.14
# EmrDockerRunnerNightlyIntegrationTest runs EMR steps and EMR Serverless job runs in the emr-7.5.0 image the runner's
# default template names (EmrServerlessSparkRunner), 3.5 GB, so it is queued last, behind the Lambda runtimes;
# Of the nightly checks, EmrHiveStepsNightlyIntegrationTest runs a cluster's other steps in it,
# EmrServerlessCustomImageNightlyIntegrationTest builds its custom image on it,
# EmrFlociContainerNightlyIntegrationTest runs a cluster's steps in it from Floci in a container,
# EmrPigStepsNightlyIntegrationTest a cluster's Pig steps, EmrAppUiNightlyIntegrationTest a MapReduce step,
# EmrClusterShrinkNightlyIntegrationTest a cluster shrink, and EmrTrinoNightlyIntegrationTest a cluster's trino-cli
# steps.
starts EmrDockerRunnerNightlyIntegrationTest EmrHiveStepsNightlyIntegrationTest EmrServerlessCustomImageNightlyIntegrationTest \
EmrFlociContainerNightlyIntegrationTest EmrPigStepsNightlyIntegrationTest EmrNotebookExecutionNightlyIntegrationTest \
EmrAppUiNightlyIntegrationTest EmrClusterShrinkNightlyIntegrationTest EmrTrinoNightlyIntegrationTest \
&& ecr public.ecr.aws/emr-serverless/spark/emr-7.5.0:latest
# EmrServerlessHiveDockerNightlyIntegrationTest runs EMR Serverless Hive job runs, and EmrHiveStepsNightlyIntegrationTest EMR
# Hive steps, in the emr-7.5.0 Hive image the runner's default Hive template names, 2.7 GB; every EMR cluster runs its
# HDFS in it, EmrDockerRunnerNightlyIntegrationTest's and the nightly EmrFlociContainerNightlyIntegrationTest's,
# EmrPigStepsNightlyIntegrationTest's and EmrSessionServerNightlyIntegrationTest's included (an emr-spark-* cluster's
# Hadoop comes from it too).
starts EmrServerlessHiveDockerNightlyIntegrationTest EmrHiveStepsNightlyIntegrationTest EmrDockerRunnerNightlyIntegrationTest \
EmrFlociContainerNightlyIntegrationTest EmrPigStepsNightlyIntegrationTest EmrSessionServerNightlyIntegrationTest \
EmrNotebookExecutionNightlyIntegrationTest EmrAppUiNightlyIntegrationTest EmrClusterShrinkNightlyIntegrationTest \
EmrTrinoNightlyIntegrationTest \
&& ecr public.ecr.aws/emr-serverless/hive/emr-7.5.0:latest
# EmrTrinoNightlyIntegrationTest runs a cluster's Trino coordinator from the Trino project's image of emr-7.5.0's
# Trino, 446, about 1 GB, from Docker Hub.
starts EmrTrinoNightlyIntegrationTest && pull trinodb/trino:446
# The nightly EmrServerlessSparkConnectNightlyIntegrationTest runs a session's Spark Connect server, and its client, in
# the emr-7.13.0 image, 3.7 GB, the first release with sessions, and EmrServerlessDashboardNightlyIntegrationTest a job
# run and a session in it, whose dashboards it opens.
starts EmrServerlessSparkConnectNightlyIntegrationTest EmrServerlessDashboardNightlyIntegrationTest \
&& ecr public.ecr.aws/emr-serverless/spark/emr-7.13.0:latest
# The nightly EmrSessionServerNightlyIntegrationTest runs an EMR session's Spark Connect server on an emr-spark-8.1.0
# cluster, Spark 4, sessions needing the AWS runtime for Apache Spark, and its client in that image.
starts EmrSessionServerNightlyIntegrationTest && ecr public.ecr.aws/emr-serverless/spark4/emr-spark-8.1.0:latest
# The nightly EmrContainersSparkNightlyIntegrationTest runs EMR on EKS job runs in the emr-7.5.0 release's EMR on EKS
# base image, about 5 GB.
starts EmrContainersSparkNightlyIntegrationTest && ecr public.ecr.aws/emr-on-eks/spark/emr-7.5.0:latest
# The nightly EmrContainersGatewayNightlyIntegrationTest runs an EMR on EKS managed endpoint's gateway and a PySpark
# kernel in the emr-7.5.0 release's notebook-spark image, about 6 GB.
starts EmrContainersGatewayNightlyIntegrationTest \
&& ecr public.ecr.aws/emr-on-eks/notebook-spark/emr-7.5.0:latest
# The nightly GlueRedshiftEtlDockerNightlyIntegrationTest runs a Glue Spark job in the image glue.image pins,
# AWS's Glue 5.0 image, several GB, so its pull overlaps compilation rather than the test's wait.
GLUE_IMAGE="$(bash .github/ci/service-image.sh glue image)"
starts GlueRedshiftEtlDockerNightlyIntegrationTest && [ -n "$GLUE_IMAGE" ] && ecr "$GLUE_IMAGE"
# package token in shard.txt -> images its tests are known to launch
# (measured inline pulls; update alongside image-catalog changes)
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
# NeptuneGraphVolumeDockerNightlyIntegrationTest keeps a graph across containers on both engines' configured images,
# and NeptuneClusterRestartDockerNightlyIntegrationTest restarts clusters on the Gremlin one.
if starts NeptuneGraphVolumeDockerNightlyIntegrationTest NeptuneClusterRestartDockerNightlyIntegrationTest; then
configured_image neptune default-image
configured_image neptune default-neo4j-image
fi
if starts DocDbClusterRestartDockerNightlyIntegrationTest DocDbClusterSnapshotDockerNightlyIntegrationTest \
|| grep -q '/docdb/' "$SHARD_FILE"; then
configured_image docdb 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
grep -q '/ec2/' "$SHARD_FILE" && { pull busybox:stable; pull alpine:latest; }
# The Cedar sidecar pin lives in application.yml; read it rather than duplicate it.
CEDAR_IMAGE="$(grep -oE 'cedar-image: *"[^"]+"' src/main/resources/application.yml | grep -oE '"[^"]+"' | tr -d '"')"
grep -q '/verifiedpermissions/' "$SHARD_FILE" && [ -n "$CEDAR_IMAGE" ] && pull "$CEDAR_IMAGE"
# Same for the GraphQL sidecar. AppSyncCfnIntegrationTest also starts it but lives under
# services/cloudformation/, so it needs its own token alongside the /appsync/ path match.
GRAPHQL_IMAGE="$(grep -oE 'graphql-image: *"[^"]+"' src/main/resources/application.yml | grep -oE '"[^"]+"' | tr -d '"')"
grep -qE '/appsync/|AppSyncCfnIntegrationTest' "$SHARD_FILE" && [ -n "$GRAPHQL_IMAGE" ] && pull "$GRAPHQL_IMAGE"
# The Node sidecar that evaluates APPSYNC_JS resolver code; the pin lives in application.yml too.
# Matched on the one class that starts it rather than on /appsync/, since every other test in that
# package is a unit test: a path match would have every shard pull an image one of them uses.
JS_RUNTIME_IMAGE="$(grep -oE 'image: *"node:[^"]+"' src/main/resources/application.yml | grep -oE '"[^"]+"' | tr -d '"')"
grep -q 'AppSyncJsResolverDockerNightlyIntegrationTest' "$SHARD_FILE" && [ -n "$JS_RUNTIME_IMAGE" ] && pull "$JS_RUNTIME_IMAGE"
# RdsAwsDockerNightlyIntegrationTest is the one class that starts SQL Server (about 1.5 GB); the pin lives in
# application.yml. The other services/rds classes mock the container layer.
SQLSERVER_IMAGE="$(grep -oE 'default-sql-server-image: *"[^"]+"' src/main/resources/application.yml | grep -oE '"[^"]+"' | tr -d '"')"
grep -q 'RdsAwsDockerNightlyIntegrationTest' "$SHARD_FILE" && [ -n "$SQLSERVER_IMAGE" ] && pull "$SQLSERVER_IMAGE"
# Postgres is the most-pulled image in CI: Redshift pins it in application.yml, RDS adapts
# postgres:<version>-alpine to the engine version its tests request (16.3), and the CloudFormation
# provisioner tests reach it through Redshift. It was pulled inline in every shard.
REDSHIFT_PG_IMAGE="$(grep -oE 'image-version: *postgres:[^ ]+' src/main/resources/application.yml | awk '{print $2}')"
grep -qE '/redshift/|/cloudformation/|GlueRedshiftEtlDockerNightlyIntegrationTest|RdsZeroEtlInitialLoadDockerNightlyIntegrationTest|RdsZeroEtlReplicationDockerNightlyIntegrationTest' "$SHARD_FILE" && [ -n "$REDSHIFT_PG_IMAGE" ] && pull "$REDSHIFT_PG_IMAGE"
grep -qE '/rds/|/rdsdata/' "$SHARD_FILE" && pull postgres:16.3-alpine
# RdsEndpointsInVpcDockerNightlyIntegrationTest serves each instance through a relay on EC2's socat image.
starts RdsEndpointsInVpcDockerNightlyIntegrationTest && configured_image ec2 socat-image
# ElbV2AddressesInVpcDockerNightlyIntegrationTest runs its node relays, targets and client on EC2's socat image.
starts ElbV2AddressesInVpcDockerNightlyIntegrationTest && configured_image ec2 socat-image
# The template-database restore fixture selects its own PostgreSQL image.
# Read that override so its first CreateDBInstance does not also have to pull PostGIS.
POSTGIS_TEST="$(find src/test/java -name RdsTemplateDatabaseRestoreDockerNightlyIntegrationTest.java -print -quit)"
POSTGIS_IMAGE="$(awk -F'"' '$2 == "floci.services.rds.default-postgres-image" { print $4 }' "${POSTGIS_TEST:-/dev/null}")"
[ -n "$POSTGIS_IMAGE" ] \
|| echo "$(date -u +%H:%M:%S) prefetch skipped: RdsTemplateDatabaseRestoreDockerNightlyIntegrationTest default-postgres-image not readable" >> "$PREFETCH_LOG"
starts RdsTemplateDatabaseRestoreDockerNightlyIntegrationTest \
&& [ -n "$POSTGIS_IMAGE" ] && pull "$POSTGIS_IMAGE"
# These DSQL fixtures start the configured PostgreSQL sidecar; unit-only shards do not.
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"
# CodeArtifact's real registry fixtures each use one configured sidecar image.
# Keep unrelated unit-test shards from pulling registries they do not use.
starts CodeArtifactMavenDockerIntegrationTest CodeArtifactMavenExternalConnectionDockerIntegrationTest \
&& configured_image codeartifact maven-image
starts CodeArtifactNpmDockerNightlyIntegrationTest CodeArtifactNpmExternalConnectionDockerIntegrationTest \
&& configured_image codeartifact npm-image
starts CodeArtifactNuGetDockerNightlyIntegrationTest CodeArtifactNuGetExternalConnectionDockerIntegrationTest \
&& configured_image codeartifact nuget-image
starts CodeArtifactPypiDockerNightlyIntegrationTest && configured_image codeartifact pypi-image
starts CodeArtifactCargoDockerNightlyIntegrationTest CodeArtifactCargoExternalConnectionDockerNightlyIntegrationTest \
CodeArtifactCargoUpstreamRepositoryDockerNightlyIntegrationTest && configured_image codeartifact cargo-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 RdsParameterGroupEngineDockerNightlyIntegrationTest; then
MYSQL_DEFAULT="$(grep -oE 'DEFAULT_MYSQL_IMAGE *= *"[^"]+"' src/main/java/io/floci/aws/config/EmulatorConfig.java | grep -oE '"[^"]+"' | tr -d '"')"
[ -n "$MYSQL_DEFAULT" ] && pull "$MYSQL_DEFAULT"
MYSQL_TEST="$(find src/test/java -name RdsParameterGroupEngineDockerNightlyIntegrationTest.java -print -quit)"
MYSQL_VERSIONS="$(awk -F'"' '$2 == "EngineVersion" { print $4 }' "${MYSQL_TEST:-/dev/null}" | sort -u)"
for version in $MYSQL_VERSIONS; do
[ -n "$MYSQL_DEFAULT" ] && pull "${MYSQL_DEFAULT%:*}:$version"
done
fi
# The InfluxDB and k3s pins live in application.yml like the sidecars above.
INFLUX_IMAGE="$(grep -oE 'default-image: *"influxdb:[^"]+"' src/main/resources/application.yml | grep -oE '"[^"]+"' | tr -d '"')"
grep -q '/timestreaminfluxdb/' "$SHARD_FILE" && [ -n "$INFLUX_IMAGE" ] && pull "$INFLUX_IMAGE"
K3S_IMAGE="$(grep -oE 'default-image: *"rancher/k3s:[^"]+"' src/main/resources/application.yml | grep -oE '"[^"]+"' | tr -d '"')"
grep -q '/eks/' "$SHARD_FILE" && [ -n "$K3S_IMAGE" ] && pull "$K3S_IMAGE"
# The nightly AmazonMqBrokerRestartNightlyIntegrationTest runs a broker in the RabbitMQ image Amazon MQ defaults to,
# pinned in application.yml too.
RABBITMQ_IMAGE="$(grep -oE 'default-image: *"rabbitmq:[^"]+"' src/main/resources/application.yml | grep -oE '"[^"]+"' | tr -d '"')"
starts AmazonMqBrokerRestartNightlyIntegrationTest && [ -n "$RABBITMQ_IMAGE" ] && pull "$RABBITMQ_IMAGE"
# The nightly KinesisAnalyticsFlinkRestartNightlyIntegrationTest runs a FLINK-1_20 application, whose image
# KinesisAnalyticsRuntimes maps, and the EFS init image chowns its savepoints volume.
FLINK_IMAGE="$(grep -oE '"FLINK-1_20", *"[^"]+"' "$(find src/main/java -name KinesisAnalyticsRuntimes.java -print -quit)" | grep -oE '"apache/flink:[^"]+"' | tr -d '"')"
EFS_INIT_IMAGE="$(grep -oE '^ +init-image: *[^ #]+' src/main/resources/application.yml | head -n 1 | sed 's/.*init-image: *//')"
if starts KinesisAnalyticsFlinkRestartNightlyIntegrationTest; then
[ -n "$FLINK_IMAGE" ] && pull "$FLINK_IMAGE"
[ -n "$EFS_INIT_IMAGE" ] && pull "$EFS_INIT_IMAGE"
fi
if [ -n "$ECR_PUBLIC_IMAGES" ]; then
{ for image in $ECR_PUBLIC_IMAGES; do pull_and_log "$image"; sleep 1; done; } &
fi
exit 0