mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 16:27:50 +00:00
Merge pull request #8737 from Apokleos/test-ci-dgb-cri-containerd
ci: enable test dragonball stability and cri-containerd
This commit is contained in:
commit
ffcd95b6b4
@ -421,6 +421,8 @@ function enabling_hypervisor() {
|
|||||||
declare -r DEST_KATA_CONFIG="${CONFIG_DIR}/configuration.toml"
|
declare -r DEST_KATA_CONFIG="${CONFIG_DIR}/configuration.toml"
|
||||||
|
|
||||||
sudo ln -sf "${SRC_HYPERVISOR_CONFIG}" "${DEST_KATA_CONFIG}"
|
sudo ln -sf "${SRC_HYPERVISOR_CONFIG}" "${DEST_KATA_CONFIG}"
|
||||||
|
|
||||||
|
export KATA_CONFIG_PATH="${DEST_KATA_CONFIG}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,11 +61,6 @@ function run() {
|
|||||||
|
|
||||||
enabling_hypervisor
|
enabling_hypervisor
|
||||||
|
|
||||||
if [ "${KATA_HYPERVISOR}" = "dragonball" ]; then
|
|
||||||
echo "Skipping test for ${KATA_HYPERVISOR}"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
bash -c ${cri_containerd_dir}/integration-tests.sh
|
bash -c ${cri_containerd_dir}/integration-tests.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,12 +40,11 @@ readonly default_containerd_config="/etc/containerd/config.toml"
|
|||||||
readonly default_containerd_config_backup="$CONTAINERD_CONFIG_FILE.backup"
|
readonly default_containerd_config_backup="$CONTAINERD_CONFIG_FILE.backup"
|
||||||
readonly kata_config="/etc/kata-containers/configuration.toml"
|
readonly kata_config="/etc/kata-containers/configuration.toml"
|
||||||
readonly kata_config_backup="$kata_config.backup"
|
readonly kata_config_backup="$kata_config.backup"
|
||||||
readonly default_kata_config="/opt/kata/share/defaults/kata-containers/configuration.toml"
|
|
||||||
|
|
||||||
function ci_config() {
|
function ci_config() {
|
||||||
sudo mkdir -p $(dirname "${kata_config}")
|
sudo mkdir -p $(dirname "${kata_config}")
|
||||||
[ -f "$kata_config" ] && sudo cp "$kata_config" "$kata_config_backup" || \
|
[ -f "$kata_config" ] && sudo cp "$kata_config" "$kata_config_backup"
|
||||||
sudo cp "$default_kata_config" "$kata_config"
|
sudo cp -f "${KATA_CONFIG_PATH}" "$kata_config"
|
||||||
|
|
||||||
source /etc/os-release || source /usr/lib/os-release
|
source /etc/os-release || source /usr/lib/os-release
|
||||||
ID=${ID:-""}
|
ID=${ID:-""}
|
||||||
@ -88,10 +87,18 @@ function create_containerd_config() {
|
|||||||
[ -n "${runtime}" ] || die "need runtime to create config"
|
[ -n "${runtime}" ] || die "need runtime to create config"
|
||||||
|
|
||||||
local runtime_type="${containerd_runtime_type}"
|
local runtime_type="${containerd_runtime_type}"
|
||||||
|
|
||||||
|
local runtime_config_path="${kata_config}"
|
||||||
|
|
||||||
|
local containerd_runtime=$(command -v "containerd-shim-${runtime}-v2")
|
||||||
|
local runtime_binary_path="${containerd_runtime}"
|
||||||
|
|
||||||
if [ "${runtime}" == "runc" ]; then
|
if [ "${runtime}" == "runc" ]; then
|
||||||
runtime_type="io.containerd.runc.v2"
|
runtime_type="io.containerd.runc.v2"
|
||||||
|
runtime_config_path=""
|
||||||
|
runtime_binary_path=""
|
||||||
fi
|
fi
|
||||||
local containerd_runtime=$(command -v "containerd-shim-${runtime}-v2")
|
info "Kata Config Path ${runtime_config_path}, Runtime Binary Name ${runtime_binary_path}"
|
||||||
|
|
||||||
cat << EOF | sudo tee "${CONTAINERD_CONFIG_FILE}"
|
cat << EOF | sudo tee "${CONTAINERD_CONFIG_FILE}"
|
||||||
[debug]
|
[debug]
|
||||||
@ -107,7 +114,8 @@ cat << EOF | sudo tee "${CONTAINERD_CONFIG_FILE}"
|
|||||||
echo ' container_annotations = ["io.katacontainers.*"]'
|
echo ' container_annotations = ["io.katacontainers.*"]'
|
||||||
)
|
)
|
||||||
[plugins.cri.containerd.runtimes.${runtime}.options]
|
[plugins.cri.containerd.runtimes.${runtime}.options]
|
||||||
Runtime = "${containerd_runtime}"
|
ConfigPath = "${runtime_config_path}"
|
||||||
|
BinaryName = "${runtime_binary_path}"
|
||||||
[plugins.linux]
|
[plugins.linux]
|
||||||
shim = "${containerd_shim_path}"
|
shim = "${containerd_shim_path}"
|
||||||
EOF
|
EOF
|
||||||
@ -238,10 +246,26 @@ function TestKilledVmmCleanup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function TestContainerMemoryUpdate() {
|
function TestContainerMemoryUpdate() {
|
||||||
|
# there's no need to set true for enable_virtio_mem in dragonball
|
||||||
|
# As it can support virtio-mem by default.
|
||||||
|
if [[ "${KATA_HYPERVISOR}" == "dragonball" ]]; then
|
||||||
|
# Currently, dragonball fails at decrease memory, just test increasing memory.
|
||||||
|
# We'll re-enable it as soon as we get it to work.
|
||||||
|
# Reference: https://github.com/kata-containers/kata-containers/issues/8804
|
||||||
|
DoContainerMemoryUpdate 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${KATA_HYPERVISOR}" != "qemu" ]] || [[ "${ARCH}" == "ppc64le" ]] || [[ "${ARCH}" == "s390x" ]]; then
|
if [[ "${KATA_HYPERVISOR}" != "qemu" ]] || [[ "${ARCH}" == "ppc64le" ]] || [[ "${ARCH}" == "s390x" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for virtio_mem_enabled in {1, 0}; do
|
||||||
|
PrepareContainerMemoryUpdate $virtio_mem_enabled
|
||||||
|
DoContainerMemoryUpdate $virtio_mem_enabled
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function PrepareContainerMemoryUpdate() {
|
||||||
test_virtio_mem=$1
|
test_virtio_mem=$1
|
||||||
|
|
||||||
if [ $test_virtio_mem -eq 1 ]; then
|
if [ $test_virtio_mem -eq 1 ]; then
|
||||||
@ -256,7 +280,12 @@ function TestContainerMemoryUpdate() {
|
|||||||
|
|
||||||
sudo sed -i -e 's/^enable_virtio_mem.*$/#enable_virtio_mem = true/g' "${kata_config}"
|
sudo sed -i -e 's/^enable_virtio_mem.*$/#enable_virtio_mem = true/g' "${kata_config}"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function DoContainerMemoryUpdate() {
|
||||||
|
descrease_memory=$1
|
||||||
|
|
||||||
|
# start a test container
|
||||||
testContainerStart
|
testContainerStart
|
||||||
|
|
||||||
vm_size=$(($(sudo crictl exec $cid cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')*1024))
|
vm_size=$(($(sudo crictl exec $cid cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')*1024))
|
||||||
@ -274,7 +303,7 @@ function TestContainerMemoryUpdate() {
|
|||||||
die "The VM memory size $vm_size after increase is not right"
|
die "The VM memory size $vm_size after increase is not right"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $test_virtio_mem -eq 1 ]; then
|
if [ $descrease_memory -eq 1 ]; then
|
||||||
sudo crictl update --memory $((1*1024*1024*1024)) $cid
|
sudo crictl update --memory $((1*1024*1024*1024)) $cid
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
@ -285,6 +314,7 @@ function TestContainerMemoryUpdate() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# stop the test container
|
||||||
testContainerStop
|
testContainerStop
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,11 +654,7 @@ function main() {
|
|||||||
# Reference: https://github.com/kata-containers/kata-containers/issues/7410
|
# Reference: https://github.com/kata-containers/kata-containers/issues/7410
|
||||||
# TestContainerSwap
|
# TestContainerSwap
|
||||||
|
|
||||||
# TODO: runtime-rs doesn't support memory update currently
|
TestContainerMemoryUpdate
|
||||||
if [ "$KATA_HYPERVISOR" != "dragonball" ]; then
|
|
||||||
TestContainerMemoryUpdate 1
|
|
||||||
TestContainerMemoryUpdate 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${ARCH}" != "ppc64le" ]]; then
|
if [[ "${ARCH}" != "ppc64le" ]]; then
|
||||||
TestKilledVmmCleanup
|
TestKilledVmmCleanup
|
||||||
|
@ -36,11 +36,6 @@ function install_dependencies() {
|
|||||||
function run() {
|
function run() {
|
||||||
info "Running soak parallel stability tests using ${KATA_HYPERVISOR} hypervisor"
|
info "Running soak parallel stability tests using ${KATA_HYPERVISOR} hypervisor"
|
||||||
|
|
||||||
if [ "${KATA_HYPERVISOR}" = "dragonball" ]; then
|
|
||||||
echo "Skipping test for ${KATA_HYPERVISOR}"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
export ITERATIONS=2 MAX_CONTAINERS=20
|
export ITERATIONS=2 MAX_CONTAINERS=20
|
||||||
bash "${stability_dir}/soak_parallel_rm.sh"
|
bash "${stability_dir}/soak_parallel_rm.sh"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user