From e68222c5e12d48e31761eaed77889f04f763fdfa 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 --- integration/nydus/nydus_tests.sh | 48 +++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/integration/nydus/nydus_tests.sh b/integration/nydus/nydus_tests.sh index a7cd786ed9..03fcf6dd88 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" && "$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" + + 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/