Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
test nydus on aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
jongwu committed Mar 1, 2023
1 parent 339affb commit 7197461
Showing 1 changed file with 41 additions and 7 deletions.
48 changes: 41 additions & 7 deletions integration/nydus/nydus_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ 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."
exit 0
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

Expand All @@ -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"

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/
Expand Down

0 comments on commit 7197461

Please sign in to comment.