diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 00000000..8f0879d7 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,39 @@ +name: Build LXCFS +description: Install dependencies and build the codebase +inputs: + fuse: + required: true + os: + required: true + compiler: + required: true +runs: + using: "composite" + steps: + - name: Install dependencies + shell: bash + run: | + sudo apt-get update -qq + sudo apt-get install -qq ${{ inputs.compiler }} + sudo apt-get install -qq lib${{ inputs.fuse }}-dev + sudo apt-get install -qq python3 python3-pip python3-setuptools pkg-config uuid-runtime + if [ "${{ inputs.os }}" = "ubuntu-22.04" ]; then + sudo pip3 install meson==0.55.1 ninja + else + sudo pip3 install meson==0.55.1 ninja --break-system-packages + fi + + - name: Compiler version + shell: bash + env: + CC: ${{ inputs.compiler }} + run: | + ${CC} --version + + - name: Build + shell: bash + env: + CC: ${{ inputs.compiler }} + run: | + meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/ + meson compile -C build diff --git a/.github/actions/testsuite/action.yml b/.github/actions/testsuite/action.yml new file mode 100644 index 00000000..b013a637 --- /dev/null +++ b/.github/actions/testsuite/action.yml @@ -0,0 +1,25 @@ +name: Test suite +description: Runs the testsuite +inputs: + fuse: + required: true + os: + required: true + compiler: + required: true +runs: + using: "composite" + steps: + - uses: ./.github/actions/build + with: + compiler: ${{ inputs.compiler }} + fuse: ${{ inputs.fuse }} + os: ${{ inputs.os }} + + - name: Test + shell: bash + env: + CC: ${{ inputs.compiler }} + run: | + echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true + sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 24ec8fca..cd5d0b03 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -10,7 +10,7 @@ permissions: jobs: coverity: name: Coverity - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml index 5481a4ef..7bc9c575 100644 --- a/.github/workflows/commits.yml +++ b/.github/workflows/commits.yml @@ -10,7 +10,7 @@ jobs: permissions: pull-requests: read # for tim-actions/get-pr-commits to get list of commits from the PR name: Signed-off-by (DCO) - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Get PR Commits id: 'get-pr-commits' @@ -27,7 +27,7 @@ jobs: permissions: contents: none name: Branch target - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check branch target env: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 417ae80c..384e8445 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,102 +7,73 @@ permissions: contents: read jobs: - fuse2: - name: FUSE2 + testsuite-hosted: + name: Test suite (x86_64) strategy: fail-fast: false matrix: compiler: - gcc - clang + fuse: + - fuse + - fuse3 os: - - ubuntu-20.04 - ubuntu-22.04 + - ubuntu-24.04 runs-on: ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -qq gcc clang - sudo apt-get install -qq libfuse-dev uuid-runtime - sudo apt-get install -qq python3 python3-setuptools - sudo pip3 install meson==0.55.1 ninja - - - name: Compiler version - env: - CC: ${{ matrix.compiler }} - run: | - ${CC} --version + - uses: ./.github/actions/testsuite + with: + compiler: ${{ matrix.compiler }} + fuse: ${{ matrix.fuse }} + os: ${{ matrix.os }} - - name: Build - env: - CC: ${{ matrix.compiler }} - run: | - meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/ - meson compile -C build - - name: Test - env: - CC: ${{ matrix.compiler }} - run: | - echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true - sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh - - fuse3: - name: FUSE3 + testsuite-self-hosted: + name: Test suite (aarch64) strategy: fail-fast: false matrix: compiler: - gcc - clang + fuse: + - fuse + - fuse3 os: - - ubuntu-20.04 - ubuntu-22.04 - runs-on: ${{ matrix.os }} + - ubuntu-24.04 + runs-on: + - self-hosted + - cpu-4 + - mem-4G + - disk-50G + - arch-arm64 + - image-${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo add-apt-repository universe - sudo apt-get update -qq - sudo apt-get install -qq gcc clang - sudo apt-get install -qq libfuse3-dev uuid-runtime - sudo apt-get install -qq python3 python3-setuptools - sudo pip3 install meson==0.55.1 ninja + - uses: ./.github/actions/testsuite + with: + compiler: ${{ matrix.compiler }} + fuse: ${{ matrix.fuse }} + os: ${{ matrix.os }} - - name: Compiler version - env: - CC: ${{ matrix.compiler }} - run: | - ${CC} --version - - - name: Build - env: - CC: ${{ matrix.compiler }} - run: | - meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/ - meson compile -C build - - name: Test - env: - CC: ${{ matrix.compiler }} - run: | - echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true - sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh - - live-upgrade-compatibility: - name: Live upgrade test + upgrade-test: + name: Upgrade test strategy: fail-fast: false matrix: compiler: - gcc + fuse: + - fuse3 os: - - ubuntu-22.04 + - ubuntu-24.04 branch: - stable-5.0 - stable-6.0 @@ -112,27 +83,11 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo add-apt-repository universe - sudo apt-get update -qq - sudo apt-get install -qq gcc clang - sudo apt-get install -qq libfuse3-dev uuid-runtime - sudo apt-get install -qq python3 python3-setuptools - sudo pip3 install meson==0.55.1 ninja - - - name: Compiler version - env: - CC: ${{ matrix.compiler }} - run: | - ${CC} --version - - - name: Build PR head version - env: - CC: ${{ matrix.compiler }} - run: | - meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/ - meson compile -C build + - uses: ./.github/actions/build + with: + compiler: ${{ matrix.compiler }} + fuse: ${{ matrix.fuse }} + os: ${{ matrix.os }} - name: Build upstream head version env: diff --git a/tests/test_proc.in b/tests/test_proc.in index e1384c19..9232631b 100755 --- a/tests/test_proc.in +++ b/tests/test_proc.in @@ -37,7 +37,7 @@ if [ "$IS_CGROUP_V2" = "1" ]; then echo 1 > ${hierarchy_path}/lxcfs_test_proc/cgroup.procs - echo '+cpu +memory' > ${hierarchy_path}/cgroup.subtree_control + echo '+cpu +cpuset +memory' > ${hierarchy_path}/cgroup.subtree_control memory_limit_file=memory.max else