X Tutup
Skip to content

Commit 87bfd20

Browse files
committed
Evaluate Cirrus CI for Vagrant tests
ref: issue 3078 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
1 parent 2749f1f commit 87bfd20

File tree

2 files changed

+68
-86
lines changed

2 files changed

+68
-86
lines changed

.cirrus.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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.
4+
5+
# NOTE Cirrus execution environments lack a terminal, needed for
6+
# some integration tests. So we use `ssh -tt` command to fake a terminal.
7+
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:
19+
timeout_in: 30m
20+
env:
21+
DEBIAN_FRONTEND: noninteractive
22+
HOME: /root
23+
# yamllint disable rule:key-duplicates
24+
matrix:
25+
DISTRO: fedora34
26+
DISTRO: centos7
27+
host_info_script: |
28+
uname -a
29+
echo "-----"
30+
cat /etc/os-release
31+
echo "-----"
32+
cat /proc/cpuinfo
33+
echo "-----"
34+
df -T
35+
install_libvirt_vagrant_script: |
36+
apt-get update
37+
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
38+
systemctl enable --now libvirtd
39+
vagrant_cache:
40+
fingerprint_script: uname -s ; cat Vagrantfile.$DISTRO
41+
folder: /root/.vagrant.d
42+
vagrant_up_script: |
43+
ln -sf Vagrantfile.$DISTRO Vagrantfile
44+
# Retry if it fails (download.fedoraproject.org returns 404 sometimes)
45+
vagrant up || vagrant up
46+
mkdir -p -m 0700 /root/.ssh
47+
vagrant ssh-config >> /root/.ssh/config
48+
guest_info_script: |
49+
ssh default 'sh -exc "uname -a && systemctl --version && df -T && cat /etc/os-release"'
50+
unit_tests_script: |
51+
ssh default 'sudo -i make -C /vagrant localunittest'
52+
integration_systemd_script: |
53+
ssh -tt default "sudo -i make -C /vagrant localintegration RUNC_USE_SYSTEMD=yes"
54+
integration_fs_script: |
55+
ssh -tt default "sudo -i make -C /vagrant localintegration"
56+
integration_systemd_rootless_script: |
57+
if [ $DISTRO == centos7 ]; then
58+
echo "SKIP: integration_systemd_rootless_script requires cgroup v2"
59+
else
60+
ssh -tt default "sudo -i make -C /vagrant localrootlessintegration RUNC_USE_SYSTEMD=yes"
61+
fi
62+
integration_fs_rootless_script: |
63+
if [ $DISTRO == centos7 ]; then
64+
echo "SKIP: FIXME: integration_fs_rootless_script is skipped because of EPERM on writing cgroup.procs"
65+
else
66+
ssh -tt default "sudo -i make -C /vagrant localrootlessintegration"
67+
fi

.github/workflows/test.yml

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# NOTE Github Actions execution environments lack a terminal, needed for
2-
# some integration tests. Two ways to get a terminal are used below:
3-
#
4-
# 1. script utility -- for "local" integration tests;
5-
# 2. ssh -tt -- for Vagrant VMs (script is buggy on CentOS 7).
2+
# some integration tests. So we use `script` command to fake a terminal.
63

74
name: ci
85
on:
@@ -73,88 +70,6 @@ jobs:
7370
if: matrix.rootless != 'rootless'
7471
run: sudo -E PATH="$PATH" script -e -c 'make RUNC_USE_SYSTEMD=yes local${{ matrix.rootless }}integration'
7572

76-
77-
# cgroup v2 unified hierarchy + very recent kernel (openat2)
78-
fedora:
79-
# nested virtualization is only available on macOS hosts
80-
runs-on: macos-10.15
81-
timeout-minutes: 30
82-
# only run it if others have passed
83-
needs: [test]
84-
steps:
85-
- uses: actions/checkout@v2
86-
87-
- name: "Cache ~/.vagrant.d/boxes, using hash of Vagrantfile.fedora34"
88-
uses: actions/cache@v2
89-
with:
90-
path: ~/.vagrant.d/boxes
91-
key: vagrant-${{ hashFiles('Vagrantfile.fedora34') }}
92-
93-
- name: prepare vagrant
94-
run: |
95-
ln -sf Vagrantfile.fedora34 Vagrantfile
96-
# Retry if it fails (download.fedoraproject.org returns 404 sometimes)
97-
vagrant up || vagrant up
98-
vagrant ssh-config >> ~/.ssh/config
99-
100-
- name: system info
101-
run: ssh default 'sh -exc "uname -a && systemctl --version && df -T"'
102-
103-
- name: unit tests
104-
run: ssh default 'cd /vagrant && sudo make localunittest'
105-
106-
- name: cgroupv2 with systemd
107-
run: ssh -tt default "sudo make -C /vagrant localintegration RUNC_USE_SYSTEMD=yes"
108-
109-
- name: cgroupv2 with fs2
110-
run: ssh -tt default "sudo make -C /vagrant localintegration"
111-
112-
- name: cgroupv2 with systemd (rootless)
113-
run: ssh -tt default "sudo make -C /vagrant localrootlessintegration RUNC_USE_SYSTEMD=yes"
114-
115-
- name: cgroupv2 with fs2 (rootless)
116-
run: ssh -tt default "sudo make -C /vagrant localrootlessintegration"
117-
118-
119-
# kernel 3.10 (frankenized), systemd 219
120-
centos7:
121-
# nested virtualization is only available on macOS hosts
122-
runs-on: macos-10.15
123-
timeout-minutes: 15
124-
# only run it if others have passed
125-
needs: [test]
126-
steps:
127-
- uses: actions/checkout@v2
128-
129-
- name: "Cache ~/.vagrant.d/boxes, using hash of Vagrantfile.centos7"
130-
uses: actions/cache@v2
131-
with:
132-
path: ~/.vagrant.d/boxes
133-
key: vagrant-${{ hashFiles('Vagrantfile.centos7') }}
134-
135-
- name: prepare vagrant
136-
run: |
137-
ln -sf Vagrantfile.centos7 Vagrantfile
138-
vagrant up
139-
vagrant ssh-config >> ~/.ssh/config
140-
141-
- name: system info
142-
run: ssh default 'rpm -q centos-release kernel systemd'
143-
144-
- name: unit tests
145-
run: ssh default 'sudo -i make -C /vagrant localunittest'
146-
147-
- name: integration tests (fs cgroup driver)
148-
run: ssh -tt default "sudo -i make -C /vagrant localintegration"
149-
150-
- name: integration tests (systemd cgroup driver)
151-
run: ssh -tt default "sudo -i make -C /vagrant localintegration RUNC_USE_SYSTEMD=1"
152-
153-
- name: rootless integration
154-
# FIXME: rootless is skipped because of EPERM on writing cgroup.procs
155-
if: false
156-
run: ssh default "sudo -i make -C /vagrant localrootlessintegration"
157-
15873
# We need to continue support for 32-bit ARM.
15974
# However, we do not have 32-bit ARM CI, so we use i386 for testing 32bit stuff.
16075
# We are not interested in providing official support for i386.

0 commit comments

Comments
 (0)
X Tutup