2023-12-15 22:07:51 +00:00
|
|
|
name: build-scheds
|
|
|
|
run-name: ${{ github.actor }} PR run
|
2024-02-04 22:12:46 +00:00
|
|
|
on: [pull_request]
|
2023-12-15 22:07:51 +00:00
|
|
|
jobs:
|
|
|
|
build-schedulers:
|
2023-12-19 21:25:50 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2023-12-15 22:07:51 +00:00
|
|
|
steps:
|
2023-12-19 21:25:50 +00:00
|
|
|
### OTHER REPOS ####
|
|
|
|
|
|
|
|
# Hard turn-off interactive mode
|
|
|
|
- run: echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
|
2023-12-15 22:07:51 +00:00
|
|
|
|
ci: use virtme-ng to test the schedulers
Use virtme-ng to run the schedulers after they're built; virtme-ng
allows to pick an arbitrary sched-ext enabled kernel and run it
virtualizing the entire user-space root filesystem, so we can basically
exceute the recompiled schedulers inside such kernel.
This should allow to catch potential run-time issue in advance (both in
the kernel and the schedulers).
The sched-ext kernel is taken from the Ubuntu ppa (ppa:arighi/sched-ext)
at the moment, since it is the easiest / fastest way to get a
precompiled sched-ext kernel to run inside the Ubuntu 22.04 testing
environment.
The schedulers are tested using the new meson target "test_sched", the
specific actions are defined in meson-scripts/test_sched.
By default each test has a timeout of 30 sec, after the virtme-ng
completes the boot (that should be enough to initialize the scheduler
and run the scheduler for some seconds), while the total lifetime of the
virtme-ng guest is set to 60 sec, after this time the guest will be
killed (this allows to catch potential kernel crashes / hangs).
If a single scheduler fails the test, the entire "test_sched" action
will be interrupted and the overall test result will be considered a
failure.
At the moment scx_layered is excluded from the tests, because it
requires a special configuration (we should probably pre-generate a
default config in the workflow actions and change the scheduler to use
the default config if it's executed without any argument).
Moreover, scx_flatcg is also temporarily excluded from the tests,
because of these known issues:
- https://github.com/sched-ext/scx/issues/49
- https://github.com/sched-ext/sched_ext/pull/101
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2023-12-24 08:09:25 +00:00
|
|
|
# Refresh packages list
|
|
|
|
- run: sudo apt update
|
|
|
|
|
2023-12-15 22:07:51 +00:00
|
|
|
### DOWNLOAD AND INSTALL DEPENDENCIES ###
|
|
|
|
|
|
|
|
# Download dependencies packaged by Ubuntu
|
2024-05-17 15:33:15 +01:00
|
|
|
- run: sudo apt -y install bison busybox-static cargo cmake coreutils cpio elfutils file flex gcc gcc-multilib git iproute2 jq kbd kmod libcap-dev libelf-dev libunwind-dev libvirt-clients libzstd-dev linux-headers-generic linux-tools-common linux-tools-generic make ninja-build pahole pkg-config python3-dev python3-pip python3-requests qemu-kvm rsync rustc stress-ng udev zstd
|
2023-12-15 22:07:51 +00:00
|
|
|
|
|
|
|
# clang 17
|
2023-12-19 21:25:50 +00:00
|
|
|
# Use a custom llvm.sh script which includes the -y flag for
|
|
|
|
# add-apt-repository. Otherwise, the CI job will hang. If and when
|
|
|
|
# https://github.com/opencollab/llvm-jenkins.debian.net/pull/26 is
|
|
|
|
# merged, we can go back to using https://apt.llvm.org/llvm.sh.
|
|
|
|
- run: wget https://raw.githubusercontent.com/Decave/llvm-jenkins.debian.net/fix_llvmsh/llvm.sh
|
2023-12-15 22:07:51 +00:00
|
|
|
- run: chmod +x llvm.sh
|
|
|
|
- run: sudo ./llvm.sh all
|
|
|
|
- run: sudo ln -sf /usr/bin/clang-17 /usr/bin/clang
|
|
|
|
- run: sudo ln -sf /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
|
|
|
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
# meson
|
|
|
|
- run: pip install meson
|
|
|
|
|
ci: use virtme-ng to test the schedulers
Use virtme-ng to run the schedulers after they're built; virtme-ng
allows to pick an arbitrary sched-ext enabled kernel and run it
virtualizing the entire user-space root filesystem, so we can basically
exceute the recompiled schedulers inside such kernel.
This should allow to catch potential run-time issue in advance (both in
the kernel and the schedulers).
The sched-ext kernel is taken from the Ubuntu ppa (ppa:arighi/sched-ext)
at the moment, since it is the easiest / fastest way to get a
precompiled sched-ext kernel to run inside the Ubuntu 22.04 testing
environment.
The schedulers are tested using the new meson target "test_sched", the
specific actions are defined in meson-scripts/test_sched.
By default each test has a timeout of 30 sec, after the virtme-ng
completes the boot (that should be enough to initialize the scheduler
and run the scheduler for some seconds), while the total lifetime of the
virtme-ng guest is set to 60 sec, after this time the guest will be
killed (this allows to catch potential kernel crashes / hangs).
If a single scheduler fails the test, the entire "test_sched" action
will be interrupted and the overall test result will be considered a
failure.
At the moment scx_layered is excluded from the tests, because it
requires a special configuration (we should probably pre-generate a
default config in the workflow actions and change the scheduler to use
the default config if it's executed without any argument).
Moreover, scx_flatcg is also temporarily excluded from the tests,
because of these known issues:
- https://github.com/sched-ext/scx/issues/49
- https://github.com/sched-ext/sched_ext/pull/101
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2023-12-24 08:09:25 +00:00
|
|
|
# Install virtme-ng
|
|
|
|
- run: pip install virtme-ng
|
|
|
|
|
2024-07-15 00:24:59 +01:00
|
|
|
# Get the latest sched-ext enabled kernel directly from the korg
|
|
|
|
# for-next branch
|
|
|
|
- run: git clone --single-branch -b for-next --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git linux
|
2024-01-18 08:05:38 +00:00
|
|
|
|
2024-01-25 20:18:37 +00:00
|
|
|
# Print the latest commit of the checked out sched-ext kernel
|
|
|
|
- run: cd linux && git log -1 --pretty=format:"%h %ad %s" --date=short
|
|
|
|
|
2024-01-18 08:05:38 +00:00
|
|
|
# Build a minimal kernel (with sched-ext enabled) using virtme-ng
|
2024-07-15 06:10:07 +01:00
|
|
|
- run: cd linux && vng -v --build --config ../.github/workflows/sched-ext.config
|
ci: use virtme-ng to test the schedulers
Use virtme-ng to run the schedulers after they're built; virtme-ng
allows to pick an arbitrary sched-ext enabled kernel and run it
virtualizing the entire user-space root filesystem, so we can basically
exceute the recompiled schedulers inside such kernel.
This should allow to catch potential run-time issue in advance (both in
the kernel and the schedulers).
The sched-ext kernel is taken from the Ubuntu ppa (ppa:arighi/sched-ext)
at the moment, since it is the easiest / fastest way to get a
precompiled sched-ext kernel to run inside the Ubuntu 22.04 testing
environment.
The schedulers are tested using the new meson target "test_sched", the
specific actions are defined in meson-scripts/test_sched.
By default each test has a timeout of 30 sec, after the virtme-ng
completes the boot (that should be enough to initialize the scheduler
and run the scheduler for some seconds), while the total lifetime of the
virtme-ng guest is set to 60 sec, after this time the guest will be
killed (this allows to catch potential kernel crashes / hangs).
If a single scheduler fails the test, the entire "test_sched" action
will be interrupted and the overall test result will be considered a
failure.
At the moment scx_layered is excluded from the tests, because it
requires a special configuration (we should probably pre-generate a
default config in the workflow actions and change the scheduler to use
the default config if it's executed without any argument).
Moreover, scx_flatcg is also temporarily excluded from the tests,
because of these known issues:
- https://github.com/sched-ext/scx/issues/49
- https://github.com/sched-ext/sched_ext/pull/101
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2023-12-24 08:09:25 +00:00
|
|
|
|
2024-04-04 09:44:30 +01:00
|
|
|
# Generate kernel headers
|
|
|
|
- run: cd linux && make headers
|
|
|
|
|
2024-08-29 13:50:06 +01:00
|
|
|
# veristat
|
|
|
|
- run: wget https://github.com/libbpf/veristat/releases/download/v0.3.2/veristat-v0.3.2-amd64.tar.gz
|
|
|
|
- run: tar -xvf veristat-v0.3.2-amd64.tar.gz && sudo cp veristat /usr/bin/
|
|
|
|
- run: sudo chmod +x /usr/bin/veristat && sudo chmod 755 /usr/bin/veristat
|
|
|
|
|
2023-12-15 22:07:51 +00:00
|
|
|
### END DEPENDENCIES ###
|
|
|
|
|
|
|
|
# The actual build:
|
2024-05-17 15:33:15 +01:00
|
|
|
- run: meson setup build -Dkernel=$(pwd)/linux -Dkernel_headers=./linux/usr/include -Denable_stress=true
|
2024-04-04 09:45:27 +01:00
|
|
|
- run: meson compile -C build --jobs=1
|
2023-12-19 21:25:50 +00:00
|
|
|
|
2024-01-18 08:05:38 +00:00
|
|
|
# Print CPU model before running the tests (this can be useful for
|
|
|
|
# debugging purposes)
|
|
|
|
- run: grep 'model name' /proc/cpuinfo | head -1
|
|
|
|
|
2024-05-03 22:20:10 +01:00
|
|
|
# Setup KVM support
|
|
|
|
- run: |
|
|
|
|
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
|
|
sudo udevadm control --reload-rules
|
|
|
|
sudo udevadm trigger --name-match=kvm
|
|
|
|
|
ci: use virtme-ng to test the schedulers
Use virtme-ng to run the schedulers after they're built; virtme-ng
allows to pick an arbitrary sched-ext enabled kernel and run it
virtualizing the entire user-space root filesystem, so we can basically
exceute the recompiled schedulers inside such kernel.
This should allow to catch potential run-time issue in advance (both in
the kernel and the schedulers).
The sched-ext kernel is taken from the Ubuntu ppa (ppa:arighi/sched-ext)
at the moment, since it is the easiest / fastest way to get a
precompiled sched-ext kernel to run inside the Ubuntu 22.04 testing
environment.
The schedulers are tested using the new meson target "test_sched", the
specific actions are defined in meson-scripts/test_sched.
By default each test has a timeout of 30 sec, after the virtme-ng
completes the boot (that should be enough to initialize the scheduler
and run the scheduler for some seconds), while the total lifetime of the
virtme-ng guest is set to 60 sec, after this time the guest will be
killed (this allows to catch potential kernel crashes / hangs).
If a single scheduler fails the test, the entire "test_sched" action
will be interrupted and the overall test result will be considered a
failure.
At the moment scx_layered is excluded from the tests, because it
requires a special configuration (we should probably pre-generate a
default config in the workflow actions and change the scheduler to use
the default config if it's executed without any argument).
Moreover, scx_flatcg is also temporarily excluded from the tests,
because of these known issues:
- https://github.com/sched-ext/scx/issues/49
- https://github.com/sched-ext/sched_ext/pull/101
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2023-12-24 08:09:25 +00:00
|
|
|
# Test schedulers
|
|
|
|
- run: meson compile -C build test_sched
|
2024-05-17 15:33:15 +01:00
|
|
|
# Stress schedulers
|
|
|
|
- run: meson compile -C build stress_tests
|
2024-08-29 13:50:06 +01:00
|
|
|
- run: meson compile -C build veristat
|