Skip to content

Commit b0a859f

Browse files
committed
Add build-scx-scheds actions
This action can be used to produce sched-ext [1] build artifacts. [1] https://github.com/sched-ext/scx Signed-off-by: Ihor Solodrai <[email protected]>
1 parent 35eef64 commit b0a859f

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

build-scx-scheds/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Build sched_ext schedulers
2+
3+
This action builds schedulers from https://github.com/sched-ext/scx/
4+
5+
## Required inputs
6+
7+
* `output-dir` - Path to the output directory, where built artifacts will be placed.
8+
9+
## Environment variables
10+
11+
* `LLVM_VERSION` - LLVM (clang) version. Default: `20`.
12+
* `SCX_ROOT` - Path to the SCX repository. If not set (default), the action will clone the main branch of https://github.com/sched-ext/scx to a temporary directory.

build-scx-scheds/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Build sched-ext/scx'
2+
inputs:
3+
output-dir:
4+
description: 'Path to the output of scx build'
5+
required: true
6+
7+
runs:
8+
using: "composite"
9+
steps:
10+
11+
- name: Install sched-ext/scx dependencies
12+
shell: bash
13+
run: ${GITHUB_ACTION_PATH}/install-dependencies.sh
14+
15+
- name: Build sched-ext/scx
16+
env:
17+
OUTPUT_DIR: ${{ inputs.output-dir }}
18+
shell: bash
19+
run: ${GITHUB_ACTION_PATH}/build-scheds.sh

build-scx-scheds/build-scheds.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
export LLVM_VERSION=${LLVM_VERSION:-20}
6+
export SCX_ROOT=${SCX_ROOT:-}
7+
8+
if [[ -z "$SCX_ROOT" ]]; then
9+
export SCX_ROOT=$(mktemp -d scx.XXXX)
10+
git clone --depth=1 --branch=main https://github.com/sched-ext/scx.git $SCX_ROOT
11+
fi
12+
13+
pushd $SCX_ROOT
14+
. $HOME/.cargo/env
15+
meson setup build
16+
meson compile -C build
17+
rm -rf $OUTPUT_DIR
18+
mv build $OUTPUT_DIR
19+
popd
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
export DEBIAN_FRONTEND=noninteractive
6+
export LLVM_VERSION=${LLVM_VERSION:-20}
7+
8+
# Assume Ubuntu/Debian
9+
sudo -E apt-get -y update
10+
11+
# Install LLVM
12+
sudo -E apt-get -y install lsb-release wget software-properties-common gnupg
13+
wget https://apt.llvm.org/llvm.sh
14+
chmod +x llvm.sh
15+
sudo -E ./llvm.sh ${LLVM_VERSION}
16+
rm llvm.sh
17+
18+
# We have to set up the alternatives because meson expects
19+
# clang and llvm-strip commands to be available
20+
sudo update-alternatives --install \
21+
/usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 10
22+
sudo update-alternatives --install \
23+
/usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-${LLVM_VERSION} 10
24+
25+
# Install Rust
26+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
27+
28+
sudo -E apt-get -y install \
29+
build-essential libssl-dev libelf-dev meson cmake pkg-config jq \
30+
protobuf-compiler libseccomp-dev

0 commit comments

Comments
 (0)