Skip to content

Commit

Permalink
Fix script to run on ubuntu 24.04
Browse files Browse the repository at this point in the history
Signed-off-by: Kohei Tokunaga <[email protected]>
  • Loading branch information
ktock committed Jun 25, 2024
1 parent 66247e6 commit e13a32d
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions script/benchmark/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ cat <<EOF > "${TMP_CONTEXT}/Dockerfile"
FROM ${BENCHMARKING_BASE_IMAGE_NAME}
RUN apt-get update -y && \
apt-get install -y python2 jq wget && \
ln -s /usr/bin/python2 /usr/bin/python && \
apt-get install -y python3 jq wget && \
ln -s /usr/bin/python3 /usr/bin/python && \
mkdir -p /tmp/crane && \
wget -O - https://github.com/google/go-containerregistry/releases/download/v0.19.1/go-containerregistry_Linux_x86_64.tar.gz | tar -C /tmp/crane/ -zxf - && \
mv /tmp/crane/crane /usr/local/bin/
Expand Down Expand Up @@ -133,9 +133,9 @@ echo "Logging to >>> ${LOG_FILE} (will finally be stored under ${OUTPUTDIR})"
echo "Benchmarking..."
FAIL=
if ! ( cd "${CONTEXT}" && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" build ${DOCKER_BUILD_ARGS:-} \
docker compose -f "${DOCKER_COMPOSE_YAML}" build ${DOCKER_BUILD_ARGS:-} \
"${BENCHMARKING_NODE}" && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate && \
docker compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate && \
docker exec \
-e BENCHMARK_RUNTIME_MODE -e BENCHMARK_SAMPLES_NUM -e BENCHMARK_PROFILE \
-i "${BENCHMARKING_CONTAINER}" \
Expand Down Expand Up @@ -165,7 +165,7 @@ if [ "${FAIL}" != "true" ] ; then
fi

echo "Cleaning up environment..."
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
if [ "${FAIL}" == "true" ] ; then
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions script/cri-containerd/test-stargz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ LOG_FILE=$(mktemp)
MIRROR_TMP=$(mktemp -d)
function cleanup {
ORG_EXIT_CODE="${1}"
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v || true
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v || true
rm -rf "${TMP_CONTEXT}" || true
rm "${DOCKER_COMPOSE_YAML}" || true
rm "${CONTAINERD_CONFIG}" || true
Expand Down Expand Up @@ -90,7 +90,7 @@ volumes:
critest-prepare-containerd-data:
critest-prepare-containerd-stargz-grpc-data:
EOF
docker-compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate
docker compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate

CONNECTED=
for i in $(seq 100) ; do
Expand Down
4 changes: 2 additions & 2 deletions script/cri-o/test-stargz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LOG_FILE=$(mktemp)
MIRROR_TMP=$(mktemp -d)
function cleanup {
ORG_EXIT_CODE="${1}"
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v || true
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v || true
rm -rf "${TMP_CONTEXT}" || true
rm "${DOCKER_COMPOSE_YAML}" || true
rm "${CRIO_CONFIG}" || true
Expand Down Expand Up @@ -109,7 +109,7 @@ volumes:
critest-prepare-containerd-data:
critest-prepare-containerd-stargz-grpc-data:
EOF
docker-compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate
docker compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate

retry docker exec "${PREPARE_NODE_NAME}" curl -k --head "http://${REGISTRY_HOST}:5000/v2/"

Expand Down
6 changes: 3 additions & 3 deletions script/criauth/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ EOF
cp "${REPO}/script/criauth/mirror.sh" "${MIRROR_TMP}/mirror.sh"
if ! ( cd "${CONTEXT}" && \
docker network create "${REGISTRY_NETWORK}" && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate && \
docker compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate && \
docker exec "${PREPARE_NODE_NAME}" /bin/bash /tools/mirror.sh \
"${TESTIMAGE_ORIGIN}" "${TESTIMAGE}" ) ; then
echo "Failed to prepare private registry"
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker network rm "${REGISTRY_NETWORK}"
exit 1
fi
Expand All @@ -126,7 +126,7 @@ if ! ( "${CONTEXT}"/run-kind.sh "${KIND_CLUSTER_NAME}" \
"${KIND_KUBECONFIG}" "${TESTIMAGE}" ) ; then
FAIL=true
fi
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
kind delete cluster --name "${KIND_CLUSTER_NAME}"
docker network rm "${REGISTRY_NETWORK}"

Expand Down
6 changes: 3 additions & 3 deletions script/integration/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ EOF
echo "Testing..."
FAIL=
if ! ( cd "${CONTEXT}" && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" build ${DOCKER_BUILD_ARGS:-} \
docker compose -f "${DOCKER_COMPOSE_YAML}" build ${DOCKER_BUILD_ARGS:-} \
"${CONTAINERD_NODE}" && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" up --abort-on-container-exit ) ; then
docker compose -f "${DOCKER_COMPOSE_YAML}" up --abort-on-container-exit ) ; then
FAIL=true
fi
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
if [ "${FAIL}" == "true" ] ; then
exit 1
fi
Expand Down
6 changes: 3 additions & 3 deletions script/k3s/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ EOF
cp "${REPO}/script/k3s/mirror.sh" "${MIRROR_TMP}/mirror.sh"
if ! ( cd "${CONTEXT}" && \
docker network create "${REGISTRY_NETWORK}" && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate && \
docker compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate && \
docker exec "${PREPARE_NODE_NAME}" /bin/bash /tools/mirror.sh \
"${TESTIMAGE_ORIGIN}" "${TESTIMAGE}" ) ; then
echo "Failed to prepare private registry"
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker network rm "${REGISTRY_NETWORK}"
exit 1
fi
Expand All @@ -127,7 +127,7 @@ if ! ( "${CONTEXT}"/run-k3s.sh "${K3S_CLUSTER_NAME}" \
"${K3S_KUBECONFIG}" "${TESTIMAGE}" ) ; then
FAIL=true
fi
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
k3d cluster delete "${K3S_CLUSTER_NAME}"
docker network rm "${REGISTRY_NETWORK}"

Expand Down
6 changes: 3 additions & 3 deletions script/kind/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ EOF
cp "${REPO}/script/kind/mirror.sh" "${MIRROR_TMP}/mirror.sh"
if ! ( cd "${CONTEXT}" && \
docker network create "${REGISTRY_NETWORK}" && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate && \
docker compose -f "${DOCKER_COMPOSE_YAML}" up -d --force-recreate && \
docker exec "${PREPARE_NODE_NAME}" /bin/bash /tools/mirror.sh \
"${TESTIMAGE_ORIGIN}" "${TESTIMAGE}" ) ; then
echo "Failed to prepare private registry"
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker network rm "${REGISTRY_NETWORK}"
exit 1
fi
Expand All @@ -127,7 +127,7 @@ if ! ( "${CONTEXT}"/run-kind.sh "${KIND_CLUSTER_NAME}" \
"${KIND_KUBECONFIG}" "${TESTIMAGE}" ) ; then
FAIL=true
fi
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
kind delete cluster --name "${KIND_CLUSTER_NAME}"
docker network rm "${REGISTRY_NETWORK}"

Expand Down
6 changes: 3 additions & 3 deletions script/optimize/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ volumes:
EOF
local FAIL=
if ! ( cd "${CONTEXT}" && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" build ${DOCKER_BUILD_ARGS:-} testenv_opt && \
docker-compose -f "${DOCKER_COMPOSE_YAML}" up --abort-on-container-exit ) ; then
docker compose -f "${DOCKER_COMPOSE_YAML}" build ${DOCKER_BUILD_ARGS:-} testenv_opt && \
docker compose -f "${DOCKER_COMPOSE_YAML}" up --abort-on-container-exit ) ; then
FAIL=true
fi
docker-compose -f "${DOCKER_COMPOSE_YAML}" down -v
docker compose -f "${DOCKER_COMPOSE_YAML}" down -v
if [ "${FAIL}" == "true" ] ; then
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion script/podman/config/test-podman-rootless.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
set -eux -o pipefail
if [[ "$(id -u)" = "0" ]]; then
# Switch to the rootless user via SSH; This is the same approach as done in nerdctl CI
systemctl start sshd
systemctl start ssh
exec ssh -o StrictHostKeyChecking=no rootless@localhost "$0" "$@"
else
systemctl --user start podman-rootless-stargz-store
Expand Down

0 comments on commit e13a32d

Please sign in to comment.