|
1 | 1 | --- |
2 | | -# We use Cirrus for Vagrant tests, because macOS instances of GHA |
3 | | -# are too slow and flaky, and Linux instances of GHA do not support KVM. |
| 2 | +# We use Cirrus for Vagrant tests and native CentOS 7 and 8, because macOS |
| 3 | +# instances of GHA are too slow and flaky, and Linux instances of GHA do not |
| 4 | +# support KVM. |
4 | 5 |
|
5 | 6 | # NOTE Cirrus execution environments lack a terminal, needed for |
6 | 7 | # some integration tests. So we use `ssh -tt` command to fake a terminal. |
7 | 8 |
|
8 | | -compute_engine_instance: |
9 | | - image_project: cirrus-images |
10 | | - image: family/docker-kvm |
11 | | - platform: linux |
12 | | - nested_virtualization: true |
13 | | - # CPU limit: `16 / NTASK`: see https://cirrus-ci.org/faq/#are-there-any-limits |
14 | | - cpu: 8 |
15 | | - # Memory limit: `4GB * NCPU` |
16 | | - memory: 32G |
17 | | - |
18 | | -vagrant_task: |
| 9 | +task: |
19 | 10 | timeout_in: 30m |
| 11 | + |
20 | 12 | env: |
21 | 13 | DEBIAN_FRONTEND: noninteractive |
22 | 14 | HOME: /root |
23 | 15 | # yamllint disable rule:key-duplicates |
24 | 16 | matrix: |
25 | 17 | DISTRO: fedora34 |
26 | | - DISTRO: centos7 |
| 18 | + |
| 19 | + name: vagrant DISTRO:$DISTRO |
| 20 | + |
| 21 | + compute_engine_instance: |
| 22 | + image_project: cirrus-images |
| 23 | + image: family/docker-kvm |
| 24 | + platform: linux |
| 25 | + nested_virtualization: true |
| 26 | + # CPU limit: `16 / NTASK`: see https://cirrus-ci.org/faq/#are-there-any-limits |
| 27 | + cpu: 8 |
| 28 | + # Memory limit: `4GB * NCPU` |
| 29 | + memory: 32G |
| 30 | + |
27 | 31 | host_info_script: | |
28 | 32 | uname -a |
29 | 33 | echo "-----" |
@@ -65,3 +69,89 @@ vagrant_task: |
65 | 69 | else |
66 | 70 | ssh -tt default "sudo -i make -C /vagrant localrootlessintegration" |
67 | 71 | fi |
| 72 | +
|
| 73 | +task: |
| 74 | + timeout_in: 30m |
| 75 | + |
| 76 | + env: |
| 77 | + HOME: /root |
| 78 | + CIRRUS_WORKING_DIR: /home/runc |
| 79 | + GO_VERSION: "1.16.6" |
| 80 | + BATS_VERSION: "v1.3.0" |
| 81 | + # yamllint disable rule:key-duplicates |
| 82 | + matrix: |
| 83 | + DISTRO: centos-7 |
| 84 | + DISTRO: centos-stream-8 |
| 85 | + |
| 86 | + name: ci / $DISTRO |
| 87 | + |
| 88 | + compute_engine_instance: |
| 89 | + image_project: centos-cloud |
| 90 | + image: family/$DISTRO |
| 91 | + platform: linux |
| 92 | + cpu: 4 |
| 93 | + memory: 8G |
| 94 | + |
| 95 | + install_dependencies_script: | |
| 96 | + yum install -y -q epel-release |
| 97 | + case $DISTRO in |
| 98 | + centos-7) |
| 99 | + (cd /etc/yum.repos.d && curl -O https://copr.fedorainfracloud.org/coprs/adrian/criu-el7/repo/epel-7/adrian-criu-el7-epel-7.repo) |
| 100 | + # sysctl |
| 101 | + echo "user.max_user_namespaces=15076" > /etc/sysctl.d/userns.conf |
| 102 | + sysctl --system |
| 103 | + ;; |
| 104 | + centos-stream-8) |
| 105 | + yum install -y -q dnf-plugins-core |
| 106 | + yum config-manager --set-enabled powertools |
| 107 | + ;; |
| 108 | + esac |
| 109 | + yum install -y -q gcc git iptables jq glibc-static libseccomp-devel make criu |
| 110 | + # install Go |
| 111 | + curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local |
| 112 | + # install bats |
| 113 | + cd /tmp |
| 114 | + git clone https://github.com/bats-core/bats-core |
| 115 | + cd bats-core |
| 116 | + git checkout $BATS_VERSION |
| 117 | + ./install.sh /usr/local |
| 118 | + cd - |
| 119 | + # Add a user for rootless tests |
| 120 | + useradd -u2000 -m -d/home/rootless -s/bin/bash rootless |
| 121 | + # set PATH |
| 122 | + echo 'export PATH=/usr/local/go/bin:/usr/local/bin:$PATH' >> /root/.bashrc |
| 123 | + # Setup ssh localhost for terminal emulation (script -e did not work) |
| 124 | + ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N "" |
| 125 | + cat /root/.ssh/id_ed25519.pub >> /root/.ssh/authorized_keys |
| 126 | + chmod 400 /root/.ssh/authorized_keys |
| 127 | + ssh-keyscan localhost >> /root/.ssh/known_hosts |
| 128 | + echo -e "Host localhost\n\tStrictHostKeyChecking no\t\nIdentityFile /root/.ssh/id_ed25519\n" >> /root/.ssh/config |
| 129 | + sed -e "s,PermitRootLogin.*,PermitRootLogin prohibit-password,g" -i /etc/ssh/sshd_config |
| 130 | + systemctl restart sshd |
| 131 | + host_info_script: | |
| 132 | + uname -a |
| 133 | + echo "-----" |
| 134 | + cat /etc/os-release |
| 135 | + echo "-----" |
| 136 | + cat /proc/cpuinfo |
| 137 | + echo "-----" |
| 138 | + df -T |
| 139 | + echo "-----" |
| 140 | + systemctl --version |
| 141 | + unit_tests_script: | |
| 142 | + ssh -tt localhost "make -C /home/runc localunittest" |
| 143 | + integration_systemd_script: | |
| 144 | + ssh -tt localhost "make -C /home/runc localintegration RUNC_USE_SYSTEMD=yes" |
| 145 | + integration_fs_script: | |
| 146 | + ssh -tt localhost "make -C /home/runc localintegration" |
| 147 | + integration_systemd_rootless_script: | |
| 148 | + echo "SKIP: integration_systemd_rootless_script requires cgroup v2" |
| 149 | + integration_fs_rootless_script: | |
| 150 | + case $DISTRO in |
| 151 | + centos-7) |
| 152 | + echo "SKIP: FIXME: integration_fs_rootless_script is skipped because of EPERM on writing cgroup.procs" |
| 153 | + ;; |
| 154 | + centos-stream-8) |
| 155 | + ssh -tt localhost "make -C /home/runc localrootlessintegration" |
| 156 | + ;; |
| 157 | + esac |
0 commit comments