mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-09 22:24:51 +00:00
tests: pull stability-test images from the ghcr.io mirror
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 <cursor@cursor.com>
Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
This commit is contained in:
@@ -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}"
|
||||
|
||||
@@ -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"
|
||||
|
||||
3
tests/stability/stressng_dockerfile/.gitignore
vendored
Normal file
3
tests/stability/stressng_dockerfile/.gitignore
vendored
Normal file
@@ -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
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user