Skip to content

Commit 8ebc013

Browse files
committed
CI: move cgroup v2 tests to Cirrus
For simplicity, switch away from Fedora 35 Vagrant on GHA to Ubuntu 21.10 on Cirrus Signed-off-by: Akihiro Suda <[email protected]>
1 parent de03e56 commit 8ebc013

File tree

5 files changed

+57
-114
lines changed

5 files changed

+57
-114
lines changed

.cirrus.yml

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,46 @@
1-
freebsd_instance:
2-
image_family: freebsd-13-0
1+
# GitHub Actions does not support cgroup v2, so we use Cirrus for cgroup v2.
2+
linux_cgroup2_task:
3+
name: "Linux/cgroup2"
4+
timeout_in: 60m
5+
compute_engine_instance:
6+
image_project: ubuntu-os-cloud
7+
image: family/ubuntu-2110
8+
# CPU limit: `16 / NTASK`: see https://cirrus-ci.org/faq/#are-there-any-limits
9+
cpu: 4
10+
# Memory limit: `4GB * NCPU`
11+
memory: 16G
12+
disk: 100
13+
env:
14+
DEBIAN_FRONTEND: noninteractive
15+
DOCKER_BUILDKIT: 1
16+
# Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)
17+
remove_snapd_script:
18+
- systemctl disable --now snapd.service snapd.socket
19+
- apt-get purge -y snapd
20+
- losetup -Dv
21+
- losetup -lv
22+
install_docker_script:
23+
- apt-get update
24+
- apt-get install -y docker.io
25+
- docker info
26+
rootful_build_script:
27+
- docker build -t test-integration --target test-integration .
28+
rootful_test_script:
29+
- docker run -t --rm --privileged test-integration
30+
rootless_build_script:
31+
- docker build -t test-integration-rootless --target test-integration-rootless .
32+
rootless_test_script:
33+
- docker run -t --rm --privileged test-integration-rootless
334

4-
task:
5-
name: test-freebsd-amd64
35+
freebsd_task:
36+
name: "FreeBSD"
37+
timeout_in: 20m
38+
compute_engine_instance:
39+
image_project: freebsd-org-cloud-dev
40+
image: family/freebsd-13-0
41+
platform: freebsd
42+
cpu: 2
43+
memory: 4G
644
env:
745
NERDCTL_RUN_ARGS: --net none knast/freebsd:13-STABLE echo "Nerdctl is up and running."
846
install_script:
@@ -14,12 +52,17 @@ task:
1452
- sudo go run . run $NERDCTL_RUN_ARGS | grep running
1553
# TODO: run `go test -v ./cmd/...`
1654

17-
docker_builder:
18-
name: windows
19-
platform: windows
20-
os_version: 2019
55+
windows_task:
56+
name: "Windows"
57+
timeout_in: 20m
58+
compute_engine_instance:
59+
image_project: cirrus-images
60+
image: family/windows-docker-builder
61+
platform: windows
62+
cpu: 2
63+
memory: 4G
2164
matrix:
22-
- name: Windows 1.6 tests
65+
- name: "Windows/containerd-1.6"
2366
env:
2467
ctrdVersion: 1.6.0-beta.3
2568
env:

.github/workflows/test.yml

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: "Register QEMU (tonistiigi/binfmt)"
7474
run: docker run --privileged --rm tonistiigi/binfmt --install all
7575
- name: "Run integration tests"
76-
run: docker run -t --rm --privileged test-integration go test -v ./cmd/nerdctl/... -args -test.kill-daemon
76+
run: docker run -t --rm --privileged test-integration
7777

7878
test-integration-rootless:
7979
runs-on: ubuntu-20.04
@@ -125,50 +125,3 @@ jobs:
125125
run: docker run --privileged --rm tonistiigi/binfmt --install all
126126
- name: "Ensure that the integration test suite is compatible with Docker"
127127
run: go test -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon
128-
129-
test-integration-cgroup2:
130-
# nested virtualization is only available on macOS hosts
131-
runs-on: macos-10.15
132-
timeout-minutes: 50
133-
env:
134-
VAGRANT_VAGRANTFILE: hack/Vagrantfile.fedora
135-
steps:
136-
- uses: actions/setup-go@v2
137-
with:
138-
go-version: 1.17.x
139-
- uses: actions/checkout@v2
140-
with:
141-
fetch-depth: 1
142-
# Vagrant is slow, so we build binaries outside Vagrant
143-
- name: "Build binaries"
144-
run: |
145-
GOOS=linux make binaries
146-
GOOS=linux go test -c ./cmd/nerdctl
147-
- name: "Boot VM"
148-
run: |
149-
vagrant up
150-
vagrant ssh-config >> ~/.ssh/config
151-
- name: "Show info"
152-
run: ssh default -- sudo nerdctl info
153-
- name: "Run tests"
154-
uses: nick-invision/retry@v2
155-
with:
156-
timeout_minutes: 10
157-
retry_on: error
158-
max_attempts: 2
159-
# TODO: enable -test.kill-daemon
160-
command: ssh default -- "sudo /vagrant/nerdctl.test -test.v"
161-
- name: "Install rootless containerd"
162-
run: |
163-
ssh default -- containerd-rootless-setuptool.sh install
164-
- name: "Show info (rootless)"
165-
run: ssh default -- nerdctl info
166-
- name: "Run tests (rootless)"
167-
uses: nick-invision/retry@v2
168-
with:
169-
timeout_minutes: 10
170-
retry_on: error
171-
max_attempts: 2
172-
command: ssh default -- "/vagrant/nerdctl.test -test.v -test.kill-daemon"
173-
- name: "Uninstall rootless containerd"
174-
run: ssh default -- containerd-rootless-setuptool.sh uninstall

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ RUN systemctl enable test-integration-ipfs-offline && \
249249
ipfs init && \
250250
ipfs config Addresses.API "/ip4/127.0.0.1/tcp/5888" && \
251251
ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/5889"
252-
CMD ["go", "test", "-v", "./cmd/nerdctl/..."]
252+
CMD ["go", "test", "-v", "./cmd/nerdctl/...", "-args", "-test.kill-daemon"]
253253

254254
FROM test-integration AS test-integration-rootless
255255
# Install SSH for creating systemd user session.
@@ -267,6 +267,7 @@ RUN ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N '' && \
267267
cp -a /root/.ssh/id_rsa.pub /home/rootless/.ssh/authorized_keys && \
268268
mkdir -p /home/rootless/.local/share && \
269269
chown -R rootless:rootless /home/rootless
270+
COPY ./Dockerfile.d/[email protected]_delegate.conf /etc/systemd/system/[email protected]/delegate.conf
270271
# ipfs daemon for rootless containerd will be enabled in /test-integration-rootless.sh
271272
RUN systemctl disable test-integration-ipfs-offline
272273
VOLUME /home/rootless/.local/share
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Service]
2+
Delegate=yes

hack/Vagrantfile.fedora

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)