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

Commit

Permalink
Merge pull request #3514 from fidencio/wip/stable-2.0-backport-arm-ci…
Browse files Browse the repository at this point in the history
…-fixes

stable-2.0 | Backport fixes for ARM & PPC
  • Loading branch information
GabyCT authored May 12, 2021
2 parents d066e18 + 02b66ab commit 5b01be5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .ci/install_kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ echo "Install Kubernetes components"
cidir=$(dirname "$0")
source /etc/os-release || source /usr/lib/os-release
kubernetes_version=$(get_version "externals.kubernetes.version")
ARCH=$("${cidir}"/kata-arch.sh -d)

if [ "$KATA_HYPERVISOR" == "firecracker" ]; then
die "Kubernetes will not work with $KATA_HYPERVISOR"
fi

if [ "$ID" == "ubuntu" ] || [ "$ID" == "debian" ]; then
if [ "$(command -v kubelet)" != "" ]; then
apt purge kubelet -y
fi
sudo bash -c "cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial-unstable main
EOF"
Expand All @@ -33,10 +37,15 @@ EOF"
chronic sudo -E apt update
chronic sudo -E apt install --allow-downgrades -y kubelet="$kubernetes_version" kubeadm="$kubernetes_version" kubectl="$kubernetes_version"
elif [ "$ID" == "centos" ] || [ "$ID" == "fedora" ]; then
if [ "$(command -v kubelet)" != "" ]; then
yum autoremove kubelet -y
fi
url="https://packages.cloud.google.com/yum/repos/kubernetes-el7-${ARCH}"
echo "Install ${url} for ${ARCH}"
sudo bash -c "cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
baseurl=${url}
enabled=1
gpgcheck=1
repo_gpgcheck=1
Expand Down
4 changes: 4 additions & 0 deletions .ci/ppc64le/lib_install_qemu_ppc64le.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,9 @@ build_and_install_qemu() {
sudo -E make install

sudo ln -sf $(command -v ${BUILT_QEMU}) "/usr/bin/qemu-system-${QEMU_ARCH}"

echo "Link virtiofsd to /usr/libexec/kata-qemu/virtiofsd"
sudo mkdir -p /usr/libexec/kata-qemu/
sudo ln -sf $(pwd)/virtiofsd /usr/libexec/kata-qemu/virtiofsd
popd
}
28 changes: 28 additions & 0 deletions integration/containerd/cri/integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,38 @@ err_report() {

trap err_report ERR

restart_docker() {
info "restart docker service"

back_file=$(mktemp)

#avoid the "Start request repeated too quickly" error
if [ -f "/lib/systemd/system/docker.service" ]; then
cp /lib/systemd/system/docker.service ${back_file}
sed -i 's/StartLimitBurst.*$/StartLimitBurst=0/g' /lib/systemd/system/docker.service
elif [ -f "/usr/lib/systemd/system/docker.service" ]; then
cp /usr/lib/systemd/system/docker.service ${back_file}
sed -i 's/StartLimitBurst.*$/StartLimitBurst=0/g' /usr/lib/systemd/system/docker.service
fi
sudo systemctl daemon-reload
sudo systemctl restart docker

#recover docker service file
if [ -f "/lib/systemd/system/docker.service" ]; then
mv ${back_file} /lib/systemd/system/docker.service
elif [ -f "/usr/lib/systemd/system/docker.service" ]; then
mv ${back_file} /usr/lib/systemd/system/docker.service
fi
sudo systemctl daemon-reload
}

check_daemon_setup() {
info "containerd(cri): Check daemon works with runc"
create_containerd_config "runc"

#restart docker service as TestImageLoad depends on it
restart_docker

sudo -E PATH="${PATH}:/usr/local/bin" \
REPORT_DIR="${REPORT_DIR}" \
FOCUS="TestImageLoad" \
Expand Down
9 changes: 8 additions & 1 deletion integration/kubernetes/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ esac
check_processes

# Remove existing CNI configurations:
cni_config_dir="/etc/cni/net.d"
cni_config_dir="/etc/cni"
cni_interface="cni0"
sudo rm -rf /var/lib/cni/networks/*
sudo rm -rf "${cni_config_dir}"/*
Expand Down Expand Up @@ -106,6 +106,13 @@ trap 'sudo -E sh -c "rm -r "${kubeadm_config_file}""' EXIT
if [ "${BAREMETAL}" == true ] && [[ $(wc -l /proc/swaps | awk '{print $1}') -gt 1 ]]; then
sudo swapoff -a || true
fi

#reinstall kubelet to do deep cleanup
if [ "$(command -v kubelet)" != "" ]; then
info "reinstall kubeadm, kubelet before initialize k8s"
bash -f "${SCRIPT_PATH}/../../.ci/install_kubernetes.sh"
fi

sudo -E kubeadm init --config "${kubeadm_config_file}"

mkdir -p "$HOME/.kube"
Expand Down

0 comments on commit 5b01be5

Please sign in to comment.