mirror of
https://github.com/containers/podman.git
synced 2025-06-12 19:14:36 +08:00
Merge pull request #10646 from edsantiago/arm64
System tests: the continuing multiarch saga
This commit is contained in:
@ -61,8 +61,8 @@ chmod 755 pause
|
|||||||
# - check for updates @ https://hub.docker.com/_/alpine
|
# - check for updates @ https://hub.docker.com/_/alpine
|
||||||
# busybox-extras provides httpd needed in 500-networking.bats
|
# busybox-extras provides httpd needed in 500-networking.bats
|
||||||
cat >Containerfile <<EOF
|
cat >Containerfile <<EOF
|
||||||
ARG ARCH=please-override-arch
|
ARG REPO=please-override-repo
|
||||||
FROM docker.io/\${ARCH}/alpine:3.12.0
|
FROM docker.io/\${REPO}/alpine:3.13.5
|
||||||
RUN apk add busybox-extras
|
RUN apk add busybox-extras
|
||||||
ADD testimage-id pause /home/podman/
|
ADD testimage-id pause /home/podman/
|
||||||
LABEL created_by=$create_script
|
LABEL created_by=$create_script
|
||||||
@ -74,17 +74,46 @@ EOF
|
|||||||
# --squash-all : needed by 'tree' test in 070-build.bats
|
# --squash-all : needed by 'tree' test in 070-build.bats
|
||||||
podman rmi -f testimage &> /dev/null || true
|
podman rmi -f testimage &> /dev/null || true
|
||||||
|
|
||||||
|
# There should always be a testimage tagged ':0000000<X>' (eight digits,
|
||||||
|
# zero-padded sequence ID) in the same location; this is used by tests
|
||||||
|
# which need to pull a non-locally-cached image. This image will rarely
|
||||||
|
# if ever need to change, nor in fact does it even have to be a copy of
|
||||||
|
# this testimage since all we use it for is 'true'.
|
||||||
|
# However, it does need to be multiarch :-(
|
||||||
|
zerotag_latest=$(skopeo list-tags docker://quay.io/libpod/testimage |\
|
||||||
|
jq -r '.Tags[]' |\
|
||||||
|
sort --version-sort |\
|
||||||
|
grep '^000' |\
|
||||||
|
tail -n 1)
|
||||||
|
zerotag_next=$(printf "%08d" $((zerotag_latest + 1)))
|
||||||
|
|
||||||
|
# We don't always need to push the :00xx image, but build it anyway.
|
||||||
|
zeroimg=quay.io/libpod/testimage:${zerotag_next}
|
||||||
|
buildah manifest create $zeroimg
|
||||||
|
|
||||||
# We need to use buildah because (as of 2021-02-23) only buildah has --manifest
|
# We need to use buildah because (as of 2021-02-23) only buildah has --manifest
|
||||||
# and because Dan says arch emulation is not currently working on podman
|
# and because Dan says arch emulation is not currently working on podman
|
||||||
# (no further details).
|
# (no further details).
|
||||||
# Arch emulation on Fedora requires the qemu-user-static package.
|
# Arch emulation on Fedora requires the qemu-user-static package.
|
||||||
for arch in amd64 arm64v8 ppc64le s390x;do
|
for arch in amd64 arm64 ppc64le s390x;do
|
||||||
|
# docker.io repo is usually the same name as the desired arch; except
|
||||||
|
# for arm64, where podman needs to have the arch be 'arm64' but the
|
||||||
|
# image lives in 'arm64v8'.
|
||||||
|
repo=$arch
|
||||||
|
if [[ $repo = "arm64" ]]; then
|
||||||
|
repo="${repo}v8"
|
||||||
|
fi
|
||||||
|
|
||||||
${BUILDAH} bud \
|
${BUILDAH} bud \
|
||||||
--arch=$arch \
|
--arch=$arch \
|
||||||
--build-arg ARCH=$arch \
|
--build-arg REPO=$repo \
|
||||||
--manifest=testimage \
|
--manifest=testimage \
|
||||||
--squash \
|
--squash \
|
||||||
.
|
.
|
||||||
|
|
||||||
|
# The zero-tag image
|
||||||
|
${BUILDAH} pull --arch $arch docker.io/$repo/busybox:1.33.1
|
||||||
|
${BUILDAH} manifest add $zeroimg docker.io/$repo/busybox:1.33.1
|
||||||
done
|
done
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
@ -94,23 +123,13 @@ rm -rf $tmpdir
|
|||||||
# Tag image and push (all arches) to quay.
|
# Tag image and push (all arches) to quay.
|
||||||
remote_tag=quay.io/libpod/testimage:$YMD
|
remote_tag=quay.io/libpod/testimage:$YMD
|
||||||
podman tag testimage ${remote_tag}
|
podman tag testimage ${remote_tag}
|
||||||
${BUILDAH} manifest push --all ${remote_tag} docker://${remote_tag}
|
cat <<EOF
|
||||||
|
|
||||||
# Side note: there should always be a testimage tagged ':0000000<X>'
|
If you're happy with these images, run:
|
||||||
# (eight digits, zero-padded sequence ID) in the same location; this is
|
|
||||||
# used by tests which need to pull a non-locally-cached image. This
|
${BUILDAH} manifest push --all ${remote_tag} docker://${remote_tag}
|
||||||
# image will rarely if ever need to change, nor in fact does it even
|
${BUILDAH} manifest push --all ${zeroimg} docker://${zeroimg}
|
||||||
# have to be a copy of this testimage since all we use it for is 'true'.
|
|
||||||
# However, it does need to be multiarch :-(
|
(You do not always need to push the :0000 image)
|
||||||
#
|
|
||||||
# As of 2021-02-24 it is simply busybox, because it is super small,
|
EOF
|
||||||
# but it's complicated because of multiarch:
|
|
||||||
#
|
|
||||||
# img=quay.io/libpod/testimage:0000000<current+1>
|
|
||||||
# buildah manifest create $img
|
|
||||||
# for arch in amd64 arm64v8 ppc64le s390x;do
|
|
||||||
# buildah pull --arch $arch docker.io/$arch/busybox:1.32.0
|
|
||||||
# buildah manifest add $img docker.io/$arch/busybox:1.32.0
|
|
||||||
# done
|
|
||||||
# buildah manifest push --all $img docker://$img
|
|
||||||
#
|
|
||||||
|
@ -7,14 +7,15 @@ PODMAN=${PODMAN:-podman}
|
|||||||
PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"}
|
PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"}
|
||||||
PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"}
|
PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"}
|
||||||
PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"}
|
PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"}
|
||||||
PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20210427"}
|
PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20210610"}
|
||||||
PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG"
|
PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG"
|
||||||
PODMAN_TEST_IMAGE_ID=
|
PODMAN_TEST_IMAGE_ID=
|
||||||
|
|
||||||
# Remote image that we *DO NOT* fetch or keep by default; used for testing pull
|
# Remote image that we *DO NOT* fetch or keep by default; used for testing pull
|
||||||
# This changed from 0 to 1 on 2021-02-24 due to multiarch considerations; it
|
# This has changed in 2021, from 0 through 3, various iterations of getting
|
||||||
# should change only very rarely.
|
# multiarch to work. It should change only very rarely.
|
||||||
PODMAN_NONLOCAL_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:00000002"
|
PODMAN_NONLOCAL_IMAGE_TAG=${PODMAN_NONLOCAL_IMAGE_TAG:-"00000003"}
|
||||||
|
PODMAN_NONLOCAL_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_NONLOCAL_IMAGE_TAG"
|
||||||
|
|
||||||
# Because who wants to spell that out each time?
|
# Because who wants to spell that out each time?
|
||||||
IMAGE=$PODMAN_TEST_IMAGE_FQN
|
IMAGE=$PODMAN_TEST_IMAGE_FQN
|
||||||
|
Reference in New Issue
Block a user