Skip to content

Commit 52bd9fd

Browse files
authored
Merge pull request #4142 from AkihiroSuda/actuated
CI: add actuated-arm64
2 parents 6a2813f + 00238f5 commit 52bd9fd

File tree

7 files changed

+102
-19
lines changed

7 files changed

+102
-19
lines changed

.github/workflows/test.yml

Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
os: [ubuntu-20.04, ubuntu-22.04]
26+
os: [ubuntu-20.04, ubuntu-22.04, actuated-arm64-6cpu-8gb]
2727
go-version: [1.20.x, 1.21.x]
2828
rootless: ["rootless", ""]
2929
race: ["-race", ""]
@@ -50,15 +50,81 @@ jobs:
5050
rootless: rootless
5151
- dmz: runc_nodmz
5252
race: -race
53+
- go-version: 1.20.x
54+
os: actuated-arm64-6cpu-8gb
55+
- race: "-race"
56+
os: actuated-arm64-6cpu-8gb
57+
- criu: criu-dev
58+
os: actuated-arm64-6cpu-8gb
59+
- dmz: runc_nodmz
60+
os: actuated-arm64-6cpu-8gb
61+
5362
runs-on: ${{ matrix.os }}
5463

5564
steps:
65+
# https://gist.github.com/alexellis/1f33e581c75e11e161fe613c46180771#file-metering-gha-md
66+
# vmmeter start
67+
- name: Prepare arkade
68+
uses: alexellis/arkade-get@master
69+
if: matrix.os == 'actuated-arm64-6cpu-8gb'
70+
with:
71+
crane: latest
72+
print-summary: false
73+
74+
- name: Install vmmeter
75+
if: matrix.os == 'actuated-arm64-6cpu-8gb'
76+
run: |
77+
crane export --platform linux/arm64 ghcr.io/openfaasltd/vmmeter:latest | sudo tar -xvf - -C /usr/local/bin
78+
79+
- name: Run vmmeter
80+
uses: self-actuated/vmmeter-action@master
81+
if: matrix.os == 'actuated-arm64-6cpu-8gb'
82+
# vmmeter end
5683

5784
- name: checkout
5885
uses: actions/checkout@v4
5986

87+
- name: Show host info
88+
run: |
89+
set -x
90+
# Sync `set -x` outputs with command ouputs
91+
exec 2>&1
92+
# Version
93+
uname -a
94+
cat /etc/os-release
95+
# Hardware
96+
cat /proc/cpuinfo
97+
free -mt
98+
# cgroup
99+
ls -F /sys/fs/cgroup
100+
cat /proc/self/cgroup
101+
if [ -e /sys/fs/cgroup/cgroup.controllers ]; then
102+
cat /sys/fs/cgroup/cgroup.controllers
103+
cat /sys/fs/cgroup/cgroup.subtree_control
104+
ls -F /sys/fs/cgroup$(grep -oP '0::\K.*' /proc/self/cgroup)
105+
fi
106+
# kernel config
107+
script/check-config.sh
108+
109+
- name: start sshd (used for testing rootless with systemd user session)
110+
if: ${{ matrix.os == 'actuated-arm64-6cpu-8gb' && matrix.rootless == 'rootless' }}
111+
run: |
112+
# Generate new keys to fix "sshd: no hostkeys available -- exiting."
113+
sudo ssh-keygen -A
114+
if ! sudo systemctl start ssh.service; then
115+
sudo journalctl -xeu ssh.service
116+
exit 1
117+
fi
118+
ps auxw | grep sshd
119+
60120
- name: install deps
61-
if: matrix.criu == ''
121+
run: |
122+
sudo apt update
123+
sudo apt -y install libseccomp-dev sshfs uidmap
124+
125+
- name: install CRIU
126+
# TODO: enable CRIU for actuated: https://github.com/opencontainers/runc/pull/4142#issuecomment-1945408382
127+
if: ${{ matrix.os != 'actuated-arm64-6cpu-8gb' && matrix.criu == '' }}
62128
env:
63129
PREFIX: https://download.opensuse.org/repositories/devel:/tools:/criu/xUbuntu
64130
run: |
@@ -67,13 +133,12 @@ jobs:
67133
curl -fSsLl $REPO/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_tools_criu.gpg > /dev/null
68134
echo "deb $REPO/ /" | sudo tee /etc/apt/sources.list.d/criu.list
69135
sudo apt update
70-
sudo apt install libseccomp-dev criu sshfs
136+
sudo apt -y install criu
71137
72-
- name: install deps (criu ${{ matrix.criu }})
73-
if: matrix.criu != ''
138+
- name: install CRIU (criu ${{ matrix.criu }})
139+
if: ${{ matrix.os != 'actuated-arm64-6cpu-8gb' && matrix.criu != '' }}
74140
run: |
75-
sudo apt -q update
76-
sudo apt -q install libseccomp-dev sshfs \
141+
sudo apt -qy install \
77142
libcap-dev libnet1-dev libnl-3-dev \
78143
libprotobuf-c-dev libprotobuf-dev protobuf-c-compiler protobuf-compiler
79144
git clone https://github.com/checkpoint-restore/criu.git ~/criu
@@ -151,7 +216,7 @@ jobs:
151216
sudo add-apt-repository -y ppa:criu/ppa
152217
# apt-add-repository runs apt update so we don't have to.
153218
154-
sudo apt -q install libseccomp-dev libseccomp-dev:i386 gcc-multilib libgcc-s1:i386 criu
219+
sudo apt -qy install libseccomp-dev libseccomp-dev:i386 gcc-multilib libgcc-s1:i386 criu
155220
156221
- name: install go
157222
uses: actions/setup-go@v5

.github/workflows/validate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: install deps
3939
run: |
4040
sudo apt -q update
41-
sudo apt -q install libseccomp-dev
41+
sudo apt -qy install libseccomp-dev
4242
- uses: golangci/golangci-lint-action@v4
4343
with:
4444
version: v1.54
@@ -153,7 +153,7 @@ jobs:
153153
- name: install deps
154154
run: |
155155
sudo apt -qq update
156-
sudo apt -qq install indent
156+
sudo apt -qqy install indent
157157
- name: cfmt
158158
run: |
159159
make cfmt

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![gha/validate](https://github.com/opencontainers/runc/workflows/validate/badge.svg)](https://github.com/opencontainers/runc/actions?query=workflow%3Avalidate)
77
[![gha/ci](https://github.com/opencontainers/runc/workflows/ci/badge.svg)](https://github.com/opencontainers/runc/actions?query=workflow%3Aci)
88
[![CirrusCI](https://api.cirrus-ci.com/github/opencontainers/runc.svg)](https://cirrus-ci.com/github/opencontainers/runc)
9+
<a href="https://actuated.dev"><img alt="Arm CI sponsored by Actuated" src="https://docs.actuated.dev/images/actuated-badge.png" width="120px"></img></a>
910

1011
## Introduction
1112

tests/integration/cgroups.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function setup() {
132132
}
133133

134134
@test "runc run (blkio weight)" {
135-
requires cgroups_v2
135+
requires cgroups_v2 cgroups_io_weight
136136
[ $EUID -ne 0 ] && requires rootless_cgroup
137137

138138
set_cgroups_path

tests/integration/helpers.bash

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,31 @@ function requires() {
465465
p="$CGROUP_CPU_BASE_PATH"
466466
f="cpu.cfs_burst_us"
467467
elif [ -v CGROUP_V2 ]; then
468+
# https://github.com/torvalds/linux/commit/f4183717b370ad28dd0c0d74760142b20e6e7931
469+
requires_kernel 5.14
468470
p="$CGROUP_BASE_PATH"
469471
f="cpu.max.burst"
470472
fi
471473
if [ -z "$(find "$p" -name "$f" -print -quit)" ]; then
472474
skip_me=1
473475
fi
474476
;;
477+
cgroups_io_weight)
478+
local p f1 f2
479+
init_cgroup_paths
480+
if [ -v CGROUP_V1 ]; then
481+
p="$CGROUP_CPU_BASE_PATH"
482+
f1="blkio.weight"
483+
f2="blkio.bfq.weight"
484+
elif [ -v CGROUP_V2 ]; then
485+
p="$CGROUP_BASE_PATH"
486+
f1="io.weight"
487+
f2="io.bfq.weight"
488+
fi
489+
if [ -z "$(find "$p" -type f \( -name "$f1" -o -name "$f2" \) -print -quit)" ]; then
490+
skip_me=1
491+
fi
492+
;;
475493
cgroupns)
476494
if [ ! -e "/proc/self/ns/cgroup" ]; then
477495
skip_me=1

tests/integration/testdata/seccomp_syscall_test1.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ int main(void)
5757
syscall_assert(raw(process_vm_writev, 0, NULL, 0, NULL, 0, ~0), -EPERM);
5858

5959
// Multiple arguments with AND rules.
60-
syscall_assert(raw(kcmp, 0, 1337, 0, 0, 0), -ESRCH);
61-
syscall_assert(raw(kcmp, 0, 0, 0, 0, 0), -EPERM);
62-
syscall_assert(raw(kcmp, 500, 1337, 0, 0, 0), -EPERM);
63-
syscall_assert(raw(kcmp, 500, 500, 0, 0, 0), -EPERM);
60+
syscall_assert(raw(ftruncate, 123456789, 1337), -EBADF);
61+
syscall_assert(raw(ftruncate, 123456789, 0), -EPERM);
62+
syscall_assert(raw(ftruncate, 500, 1337), -EPERM);
63+
syscall_assert(raw(ftruncate, 500, 500), -EPERM);
6464

6565
// Multiple rules for the same syscall.
6666
syscall_assert(raw(dup3, 0, -100, 0xFFFF), -EPERM);

tests/integration/testdata/seccomp_syscall_test1.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@
7979
"fstatfs",
8080
"fstatfs64",
8181
"fsync",
82-
"ftruncate",
83-
"ftruncate64",
8482
"futex",
8583
"futex_time64",
8684
"futimesat",
@@ -380,12 +378,13 @@
380378
{
381379
"action": "SCMP_ACT_ALLOW",
382380
"names": [
383-
"kcmp"
381+
"ftruncate",
382+
"ftruncate64"
384383
],
385384
"args": [
386385
{
387386
"index": 0,
388-
"value": 0,
387+
"value": 123456789,
389388
"op": "SCMP_CMP_EQ"
390389
},
391390
{

0 commit comments

Comments
 (0)