Skip to content

Commit

Permalink
ci: practice filter scheme in setup.sh
Browse files Browse the repository at this point in the history
since not all integration suites supported in aarch64 for now,
ommiting unrelated installation in setup.sh could be necessary.

Fixes: kata-containers#472

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
  • Loading branch information
Pennyzct committed Aug 2, 2018
1 parent caaa135 commit 22e2c53
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 10 deletions.
23 changes: 23 additions & 0 deletions .ci/lib_setup_aarch64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
#
# Copyright (c) 2018 ARM Limited
#
# SPDX-License-Identifier: Apache-2.0

set -e

filter_test_script="${cidir}/filter_test_aarch64.sh"

check_test_union()
{
local test_union=$(bash -f ${filter_test_script})
flag="$1"
# regex match
[[ ${test_union} =~ ${flag} ]] && echo "true"

echo "false"
}

CRIO=$(check_test_union crio)
KUBERNETES=$(check_test_union kubernetes)
OPENSHIFT=$(check_test_union openshift)
33 changes: 23 additions & 10 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ source "${cidir}/lib.sh"

apply_depends_on

arch=$(arch)
arch=$("${cidir}"/kata-arch.sh -d)
INSTALL_KATA="${INSTALL_KATA:-yes}"

echo "Set up environment"
Expand All @@ -40,15 +40,21 @@ if ! sudo docker version | grep -q "$docker_version" && [ "$CI" == true ]; then
"${cidir}/../cmd/container-manager/manage_ctr_mgr.sh" docker install -f
fi

if [ "$arch" = x86_64 ]; then
case "$arch" in
x86_64)
if grep -q "N" /sys/module/kvm_intel/parameters/nested; then
echo "enable Nested Virtualization"
sudo modprobe -r kvm_intel
sudo modprobe kvm_intel nested=1
fi
else
;;
aarch64)
info "CI running in bare machine"
;;
*)
die "Unsupported architecture: $arch"
fi
;;
esac

if [ "${INSTALL_KATA}" == "yes" ];then
echo "Install Kata sources"
Expand All @@ -58,14 +64,21 @@ fi
echo "Install CNI plugins"
bash -f "${cidir}/install_cni_plugins.sh"

echo "Install CRI-O"
bash -f "${cidir}/install_crio.sh"
# values indicating whether related intergration tests have been supported
CRIO="true"
KUBERNETES="true"
OPENSHIFT="true"

# load arch-specific lib file
if [ -f "${cidir}/lib_setup_${arch}.sh" ]; then
source "${cidir}/lib_setup_${arch}.sh"
fi

[ "${CRIO}" = "true" ] && echo "Install CRI-O" && bash -f "${cidir}/install_crio.sh"

echo "Install Kubernetes"
bash -f "${cidir}/install_kubernetes.sh"
[ "${KUBERNETES}" = "true" ] && echo "Install Kubernetes" && bash -f "${cidir}/install_kubernetes.sh"

echo "Install Openshift"
bash -f "${cidir}/install_openshift.sh"
[ "${OPENSHIFT}" = "true" ] && echo "Install Openshift" && bash -f "${cidir}/install_openshift.sh"

echo "Disable systemd-journald rate limit"
sudo crudini --set /etc/systemd/journald.conf Journal RateLimitInterval 0s
Expand Down

0 comments on commit 22e2c53

Please sign in to comment.