-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Checking if criu cgroup v1 kludges help
Testing criu PR 2545. Makes TestCheckpoint and TestUsernsCheckpoint run 150 times. For gha ci, use both precompiled criu and compile the one with freezer-kludges. For cirrus/almalinux, only compile criu with freezer-kludges. Disabled some CI runs: - gha: ubuntu 24.04, actuated-arm (cgroup v2); - cirrus: fedora (cgroup v2); - both gha and cirrus: bats installation, integration tests. Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information
Showing
5 changed files
with
145 additions
and
563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,49 +23,14 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-24.04, actuated-arm64-6cpu-8gb] | ||
os: [ubuntu-20.04] | ||
go-version: [1.22.x, 1.23.x] | ||
rootless: ["rootless", ""] | ||
rootless: [""] | ||
race: ["-race", ""] | ||
criu: ["", "criu-dev"] | ||
exclude: | ||
# Disable most of criu-dev jobs, as they are expensive | ||
# (need to compile criu) and don't add much value/coverage. | ||
- criu: criu-dev | ||
go-version: 1.22.x | ||
- criu: criu-dev | ||
rootless: rootless | ||
- criu: criu-dev | ||
race: -race | ||
- go-version: 1.22.x | ||
os: actuated-arm64-6cpu-8gb | ||
- race: "-race" | ||
os: actuated-arm64-6cpu-8gb | ||
- criu: criu-dev | ||
os: actuated-arm64-6cpu-8gb | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
# https://gist.github.com/alexellis/1f33e581c75e11e161fe613c46180771#file-metering-gha-md | ||
# vmmeter start | ||
- name: Prepare arkade | ||
uses: alexellis/arkade-get@master | ||
if: matrix.os == 'actuated-arm64-6cpu-8gb' | ||
with: | ||
crane: latest | ||
print-summary: false | ||
|
||
- name: Install vmmeter | ||
if: matrix.os == 'actuated-arm64-6cpu-8gb' | ||
run: | | ||
crane export --platform linux/arm64 ghcr.io/openfaasltd/vmmeter:latest | sudo tar -xvf - -C /usr/local/bin | ||
- name: Run vmmeter | ||
uses: self-actuated/vmmeter-action@master | ||
if: matrix.os == 'actuated-arm64-6cpu-8gb' | ||
# vmmeter end | ||
|
||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
|
@@ -74,6 +39,8 @@ jobs: | |
set -x | ||
# Sync `set -x` outputs with command ouputs | ||
exec 2>&1 | ||
# CRIU | ||
criu --version | ||
# Version | ||
uname -a | ||
cat /etc/os-release | ||
|
@@ -124,65 +91,23 @@ jobs: | |
sudo apt -qy install \ | ||
libcap-dev libnet1-dev libnl-3-dev \ | ||
libprotobuf-c-dev libprotobuf-dev protobuf-c-compiler protobuf-compiler | ||
git clone https://github.com/checkpoint-restore/criu.git ~/criu | ||
(cd ~/criu && git checkout ${{ matrix.criu }} && sudo make install-criu) | ||
# Testing https://github.com/checkpoint-restore/criu/pull/2545 | ||
git clone https://github.com/kolyshkin/criu.git ~/criu | ||
(cd ~/criu && git checkout freeze-kludges && sudo make install-criu) | ||
rm -rf ~/criu | ||
- name: install go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
check-latest: true | ||
|
||
- name: build | ||
run: sudo -E PATH="$PATH" make EXTRA_FLAGS="${{ matrix.race }}" all | ||
|
||
- name: Setup Bats and bats libs | ||
uses: bats-core/[email protected] | ||
with: | ||
bats-version: 1.9.0 | ||
support-install: false | ||
assert-install: false | ||
detik-install: false | ||
file-install: false | ||
|
||
- name: Allow userns for runc | ||
# https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions-15 | ||
if: matrix.os == 'ubuntu-24.04' | ||
run: | | ||
sed "s;^profile runc /usr/sbin/;profile runc-test $PWD/;" < /etc/apparmor.d/runc | sudo apparmor_parser | ||
- name: unit test | ||
if: matrix.rootless != 'rootless' | ||
run: sudo -E PATH="$PATH" -- make TESTFLAGS="${{ matrix.race }}" localunittest | ||
|
||
- name: add rootless user | ||
if: matrix.rootless == 'rootless' | ||
run: | | ||
sudo useradd -u2000 -m -d/home/rootless -s/bin/bash rootless | ||
# Allow root and rootless itself to execute `ssh rootless@localhost` in tests/rootless.sh | ||
ssh-keygen -t ecdsa -N "" -f $HOME/rootless.key | ||
sudo mkdir -m 0700 -p /home/rootless/.ssh | ||
sudo cp $HOME/rootless.key /home/rootless/.ssh/id_ecdsa | ||
sudo cp $HOME/rootless.key.pub /home/rootless/.ssh/authorized_keys | ||
sudo chown -R rootless.rootless /home/rootless | ||
sudo chmod a+X $HOME # for Ubuntu 22.04 and later | ||
- name: integration test (fs driver) | ||
run: sudo -E PATH="$PATH" script -e -c 'make local${{ matrix.rootless }}integration' | ||
|
||
- name: integration test (systemd driver) | ||
# Skip rootless+systemd for ubuntu 20.04 because of cgroup v1. | ||
if: ${{ !(matrix.os == 'ubuntu-20.04' && matrix.rootless == 'rootless') }} | ||
run: | | ||
# Delegate all cgroup v2 controllers to rootless user via --systemd-cgroup. | ||
# The default (since systemd v252) is "pids memory cpu". | ||
sudo mkdir -p /etc/systemd/system/[email protected] | ||
printf "[Service]\nDelegate=yes\n" | sudo tee /etc/systemd/system/[email protected]/delegate.conf | ||
sudo systemctl daemon-reload | ||
# Run the tests. | ||
sudo -E PATH="$PATH" script -e -c 'make RUNC_USE_SYSTEMD=yes local${{ matrix.rootless }}integration' | ||
# We need to continue support for 32-bit ARM. | ||
# However, we do not have 32-bit ARM CI, so we use i386 for testing 32bit stuff. | ||
# We are not interested in providing official support for i386. | ||
|
Oops, something went wrong.