Files
kata-containers/tests/integration/nydus/gha-run.sh
Fabiano Fidêncio 285d5daa23 tests: install latest cri-tools dynamically
Resolve the cri-tools release at install time instead of pinning a
version in versions.yaml: install_cri_tools now queries the GitHub
releases API for the absolute latest stable tag, and the kata-monitor,
cri-containerd and nydus jobs call it directly.

Also write /etc/crictl.yaml during containerd setup so crictl stops
emitting deprecation warnings about the legacy default endpoints.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: OpenAI Codex <codex@openai.com>
2026-06-09 14:33:30 +02:00

76 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2023 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -o errexit
set -o nounset
set -o pipefail
# shellcheck disable=SC2034
kata_tarball_dir="${2:-kata-artifacts}"
nydus_dir="$(dirname "$(readlink -f "$0")")"
# shellcheck source=/dev/null
source "${nydus_dir}/../../common.bash"
function install_dependencies() {
info "Installing the dependencies needed for running the nydus tests"
# Dependency list of projects that we can rely on the system packages
# - jq
declare -a system_deps=(
jq
)
sudo apt-get update
sudo apt-get -y install "${system_deps[@]}"
ensure_yq
# Dependency list of projects that we can install them
# directly from their releases on GitHub:
# - containerd
# - cri-container-cni release tarball already includes CNI plugins
# - nydus
# - nydus-snapshotter
declare -a github_deps
# shellcheck disable=SC2154
github_deps[0]="cri_containerd:$(get_from_kata_deps ".externals.containerd.${CONTAINERD_VERSION}")"
github_deps[1]="nydus:$(get_from_kata_deps ".externals.nydus.version")"
github_deps[2]="nydus_snapshotter:$(get_from_kata_deps ".externals.nydus-snapshotter.version")"
github_deps[3]="runc:$(get_from_kata_deps ".externals.runc.latest")"
github_deps[4]="cni_plugins:$(get_from_kata_deps ".externals.cni-plugins.version")"
for github_dep in "${github_deps[@]}"; do
IFS=":" read -r -a dep <<< "${github_dep}"
"install_${dep[0]}" "${dep[1]}"
done
# cri-tools is resolved at install time to the absolute latest
# release, so it is not pinned via versions.yaml.
install_cri_tools
}
function run() {
# shellcheck disable=SC2154
info "Running nydus tests using ${KATA_HYPERVISOR} hypervisor"
enabling_hypervisor
bash -c "${nydus_dir}/nydus_tests.sh"
}
function main() {
action="${1:-}"
case "${action}" in
install-dependencies) install_dependencies ;;
install-kata) install_kata ;;
install-kata-tools) install_kata_tools "${2:-}" ;;
run) run ;;
*) >&2 die "Invalid argument" ;;
esac
}
main "$@"