From f560c87510e483e6fadd056645fc3e3fc651665e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 11 Jun 2026 20:54:44 +0200 Subject: [PATCH] tests: pull stability-test images from the ghcr.io mirror MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stability tests pulled their container images straight from Docker Hub: cassandra_stress.sh pulled docker.io/library/cassandra and the stress-ng image was built FROM ubuntu:20.04 (Docker Hub). Both are now sourced from the kata-containers ghcr.io mirror: * cassandra_stress.sh uses a substitutable REGISTRY (default ghcr.io/kata-containers) for the cassandra image. * common_stability.bash prefers ghcr.io/kata-containers for the ubuntu base, keeping the previous registries as fallbacks. * the stress-ng Dockerfile becomes Dockerfile.in with an @UBUNTU_REGISTRY@ placeholder so it flows through the existing registry-fallback logic; the generated Dockerfile is gitignored. Only Docker Hub sources are migrated here; quay.io/registry.k8s.io test images are left untouched. Authored-by: Cursor Signed-off-by: Fabiano FidĂȘncio --- tests/stability/cassandra_stress.sh | 13 +++++++++---- tests/stability/common_stability.bash | 5 ++++- tests/stability/stressng_dockerfile/.gitignore | 3 +++ .../{Dockerfile => Dockerfile.in} | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 tests/stability/stressng_dockerfile/.gitignore rename tests/stability/stressng_dockerfile/{Dockerfile => Dockerfile.in} (91%) diff --git a/tests/stability/cassandra_stress.sh b/tests/stability/cassandra_stress.sh index 7048a2b5f9..938188af88 100755 --- a/tests/stability/cassandra_stress.sh +++ b/tests/stability/cassandra_stress.sh @@ -11,9 +11,14 @@ SCRIPT_PATH=$(dirname "$(readlink -f "$0")") # shellcheck source=/dev/null source "${SCRIPT_PATH}/common_stability.bash" -IMAGE="docker.io/library/cassandra:latest" +# Pull from the kata-containers ghcr.io mirror by default instead of Docker +# Hub. Override REGISTRY to use a different source. +REGISTRY="${REGISTRY:-ghcr.io/kata-containers}" +IMAGE="${REGISTRY}/cassandra:latest" CONTAINER_NAME="${CONTAINER_NAME:-cassandra_test}" -DOCKER_IMAGE="cassandra:latest" +DOCKER_IMAGE="${IMAGE}" +# Local archive name; must be slash-free as it is used as a filename. +IMAGE_TAR="cassandra.tar" PAYLOAD_ARGS="${PAYLOAD_ARGS:-tail -f /dev/null}" CMD="cassandra -R" @@ -25,9 +30,9 @@ function main() { # DOCKER_EXE, CTR_EXE, and CTR_RUNTIME are set by common.bash's init_env # shellcheck disable=SC2154 sudo -E "${DOCKER_EXE}" pull "${DOCKER_IMAGE}" - sudo -E "${DOCKER_EXE}" save -o "${DOCKER_IMAGE}.tar" "${DOCKER_IMAGE}" + sudo -E "${DOCKER_EXE}" save -o "${IMAGE_TAR}" "${DOCKER_IMAGE}" # shellcheck disable=SC2154 - sudo -E "${CTR_EXE}" i import "${DOCKER_IMAGE}.tar" + sudo -E "${CTR_EXE}" i import "${IMAGE_TAR}" # shellcheck disable=SC2154 sudo -E "${CTR_EXE}" run -d --runtime "${CTR_RUNTIME}" "${IMAGE}" "${CONTAINER_NAME}" sh -c "${PAYLOAD_ARGS}" diff --git a/tests/stability/common_stability.bash b/tests/stability/common_stability.bash index ada959ae95..6b3cebdd42 100644 --- a/tests/stability/common_stability.bash +++ b/tests/stability/common_stability.bash @@ -19,9 +19,12 @@ KATA_HYPERVISOR="${KATA_HYPERVISOR:-qemu}" http_proxy="${http_proxy:-}" https_proxy="${https_proxy:-}" +# Prefer the kata-containers ghcr.io mirror over Docker Hub; the remaining +# entries are kept as fallbacks. Override REGISTRY to change the primary source. declare -A registries registries[ubuntu]=\ -"docker.io/library +"${REGISTRY:-ghcr.io/kata-containers} +docker.io/library public.ecr.aws/lts mirror.gcr.io/library quay.io/libpod" diff --git a/tests/stability/stressng_dockerfile/.gitignore b/tests/stability/stressng_dockerfile/.gitignore new file mode 100644 index 0000000000..666158c736 --- /dev/null +++ b/tests/stability/stressng_dockerfile/.gitignore @@ -0,0 +1,3 @@ +# Generated at test time from Dockerfile.in by common_stability.bash +# (@UBUNTU_REGISTRY@ is substituted with the first working registry). +/Dockerfile diff --git a/tests/stability/stressng_dockerfile/Dockerfile b/tests/stability/stressng_dockerfile/Dockerfile.in similarity index 91% rename from tests/stability/stressng_dockerfile/Dockerfile rename to tests/stability/stressng_dockerfile/Dockerfile.in index b17002c1e4..588524af29 100644 --- a/tests/stability/stressng_dockerfile/Dockerfile +++ b/tests/stability/stressng_dockerfile/Dockerfile.in @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -FROM ubuntu:20.04 +FROM @UBUNTU_REGISTRY@/ubuntu:20.04 # Version of the Dockerfile LABEL DOCKERFILE_VERSION="1.0"