1
0
mirror of https://github.com/ubuntu/microk8s.git synced 2021-05-23 02:23:41 +03:00

Fixes for Centos7 support (#2182)

Build runc in its own part and patch-elf it
Move a number of binaries into a patched-elf part
Add a centos7 test option (eg test-distro.sh images_centos-7 latest/edge latest/beta)
This commit is contained in:
Konstantinos Tsakalozos
2021-04-22 11:03:54 +03:00
committed by GitHub
parent c8ba1b2fd7
commit 233fa43a91
5 changed files with 67 additions and 21 deletions

View File

@@ -32,6 +32,11 @@ jobs:
with:
name: microk8s.snap
path: microk8s.snap
# TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
run: |
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
# DO NOT FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADDRESSED!
- name: Running upgrade path test
run: |
set -x

View File

@@ -33,7 +33,7 @@ then
echo "Disabling HA will reset your cluster in a clean state."
echo "Any running workloads will be stopped and any cluster configuration will be lost."
echo "As this is a single node cluster and this is a destructive operation,"
echo "please use the \'--force\' flag."
echo "please use the '--force' flag."
exit 2
fi

View File

@@ -320,7 +320,7 @@ parts:
containerd:
build-snaps: [go]
after: [iptables]
after: [iptables, runc]
build-attributes: [no-patchelf]
source: build-scripts/
plugin: dump
@@ -335,15 +335,6 @@ parts:
export GOPATH=$(realpath ../go)
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
# Build runc
go get -d github.com/opencontainers/runc
(
cd $GOPATH/src/github.com/opencontainers/runc
git checkout ${RUNC_COMMIT}
make BUILDTAGS='seccomp apparmor'
)
cp $GOPATH/src/github.com/opencontainers/runc/runc $SNAPCRAFT_PART_INSTALL/bin/
# Build containerd
rm -rf $GOPATH
mkdir -p $GOPATH
@@ -368,7 +359,38 @@ parts:
- libnss-mymachines
- conntrack
- libssl1.0.0
- coreutils
stage:
- -sbin/xtables-multi
- -sbin/iptables*
- -lib/xtables
runc:
build-snaps: [go]
after: [iptables]
source: build-scripts/
plugin: dump
build-packages:
- btrfs-tools
- libseccomp-dev
override-build: |
set -eux
. $SNAPCRAFT_PART_SRC/set-env-variables.sh
snap refresh go --channel=1.15/stable || true
go version
export GOPATH=$(realpath ../go)
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
# Build runc
go get -d github.com/opencontainers/runc
(
cd $GOPATH/src/github.com/opencontainers/runc
git checkout ${RUNC_COMMIT}
make BUILDTAGS='seccomp apparmor'
)
cp $GOPATH/src/github.com/opencontainers/runc/runc $SNAPCRAFT_PART_INSTALL/bin/
# Assemble the snap
snapcraftctl build
stage:
- -sbin/xtables-multi
- -sbin/iptables*
@@ -388,7 +410,14 @@ parts:
- hostname
- squashfs-tools
- tar
- coreutils
- diffutils
- iproute2
- ethtool
- net-tools
- util-linux
- libatm1
- zfsutils-linux
cluster-agent:
plugin: python
@@ -418,14 +447,6 @@ parts:
- openssl
- file
- dpkg
stage-packages:
- ethtool
- libatm1
- net-tools
- util-linux
- zfsutils-linux
- iproute2
- python3-click
source: .
prime:
- -README*

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
yum install epel-release -y
yum install sudo -y
yum install snapd -y
systemctl enable --now snapd.socket
ln -s /var/lib/snapd/snap /snap
yum install python3-pip -y
yum install docker -y
pip3 install -U pytest requests pyyaml sh
# wait for the snapd seeding to take place!
n=0
until [ $n -ge 7 ]
do
sudo snap install core18 && break # substitute your command here
n=$[$n+1]
sleep 10
done

View File

@@ -26,7 +26,8 @@ function create_machine() {
# Allow for the machine to boot and get an IP
sleep 20
tar cf - ./tests | lxc exec $NAME -- tar xvf - -C /var/tmp
DISTRO_DEPS="${DISTRO//:/_}"
DISTRO_DEPS_TMP="${DISTRO//:/_}"
DISTRO_DEPS="${DISTRO_DEPS_TMP////-}"
lxc exec $NAME -- /bin/bash "/var/tmp/tests/lxc/install-deps/$DISTRO_DEPS"
lxc exec $NAME -- reboot
sleep 20