From 5800b42dfac053debd1d6b6e3f765d6c66ebcda9 Mon Sep 17 00:00:00 2001 From: Jianyong Wu Date: Thu, 23 Feb 2023 11:38:58 +0800 Subject: [PATCH] test nydus on aarch64 Depends-on: github.com/kata-containers/kata-containers#6408 --- integration/nydus/nydus-container.yaml | 2 +- integration/nydus/nydus_tests.sh | 48 ++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/integration/nydus/nydus-container.yaml b/integration/nydus/nydus-container.yaml index a30327adee..393010818a 100644 --- a/integration/nydus/nydus-container.yaml +++ b/integration/nydus/nydus-container.yaml @@ -1,7 +1,7 @@ metadata: name: nydus-container image: - image: ghcr.io/dragonflyoss/image-service/alpine:nydus-latest + image: ghcr.io/dragonflyoss/image-service/alpine:nydus-nightly-v6 command: - tail - -f diff --git a/integration/nydus/nydus_tests.sh b/integration/nydus/nydus_tests.sh index a7cd786ed9..bfe3704177 100755 --- a/integration/nydus/nydus_tests.sh +++ b/integration/nydus/nydus_tests.sh @@ -28,7 +28,7 @@ containerd_config="/etc/containerd/config.toml" containerd_config_backup="/tmp/containerd.config.toml" # test image for container -IMAGE="${IMAGE:-ghcr.io/dragonflyoss/image-service/alpine:nydus-latest}" +IMAGE="${IMAGE:-ghcr.io/dragonflyoss/image-service/alpine:nydus-nightly-v6}" if [ "$KATA_HYPERVISOR" != "qemu" ] && [ "$KATA_HYPERVISOR" != "cloud-hypervisor" ] && [ "$KATA_HYPERVISOR" != "dragonball" ]; then echo "Skip nydus test for $KATA_HYPERVISOR, it only works for QEMU/CLH/DB now." @@ -36,8 +36,8 @@ if [ "$KATA_HYPERVISOR" != "qemu" ] && [ "$KATA_HYPERVISOR" != "cloud-hypervisor fi arch="$(uname -m)" -if [ "$arch" != "x86_64" ]; then - echo "Skip nydus test for $arch, it only works for x86_64 now. See https://github.com/kata-containers/tests/issues/4445" +if [ "$arch" != "x86_64" -a "$arch" != "aarch64" ]; then + echo "Skip nydus test for $arch, it only works for x86_64 and aarch64 now. See https://github.com/kata-containers/tests/issues/4445" exit 0 fi @@ -58,12 +58,46 @@ function install_from_tarball() { curl -Ls "$tarball_url" | sudo tar xfz - -C /usr/local/bin --strip-components=1 } -function setup_nydus() { - # install nydus - install_from_tarball "nydus" "nydus-static" +function install_from_source() { + [ -z $(command -v cargo) ] && "${dir_path}/../../.ci/install_rust.sh" && source "$HOME/.cargo/env" + [ -z $(command -v cmake) ] && apt install cmake -y + local src_dir=$(mktemp -d) + + pushd ${src_dir} + git clone https://github.com/dragonflyoss/image-service.git + + pushd image-service + # install nydusd nydus-image + make && make install + [ -f "/usr/bin/nydusd" ] && ln -s /usr/bin/nydusd /usr/local/bin/nydusd + [ -f "/usr/bin/nydus-image" ] && ln -s /usr/bin/nydus-image /usr/local/bin/nydus-image + # install nydusify + make -C contrib/nydusify/ && install -m 755 contrib/nydusify/cmd/nydusify /usr/bin + popd # install nydus-snapshotter - install_from_tarball "nydus-snapshotter" "nydus-snapshotter" + git clone https://github.com/containerd/nydus-snapshotter.git + pushd nydus-snapshotter + make && make install + popd + + popd + + # clean up temp dir + rm -rf ${src_dir} +} + +function setup_nydus() { + + if [ "${arch}" == "x86_64" ]; then + # install nydus + install_from_tarball "nydus" "nydus-static" + + # install nydus-snapshotter + install_from_tarball "nydus-snapshotter" "nydus-snapshotter" + else + install_from_source + fi # Config nydus snapshotter sudo -E cp "$dir_path/nydusd-config.json" /etc/