Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/install-nix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
- name: Load dependencies
if: ${{ runner.environment == 'self-hosted' }}
run: |
nix run ./.github/include#nix-develop-gha -- ./.github/include#gha-common
nix run ./.nix#nix-develop-gha -- ./.nix#gha-common
shell: bash

- uses: cachix/cachix-action@v14
Expand Down
8 changes: 4 additions & 4 deletions .github/include/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async def get_kernel_path(kernel_name: str) -> str:
"build",
"--no-link",
"--print-out-paths",
f"./.github/include#kernel_{kernel_name}",
f"./.nix#kernel_{kernel_name}",
]
)
return stdout.strip() + "/bzImage"
Expand Down Expand Up @@ -219,8 +219,8 @@ async def run_format():
if nix_files:
await run_command(
["nix", "--extra-experimental-features", "nix-command flakes", "fmt"]
+ [os.path.join("../../", x) for x in nix_files],
cwd=".github/include",
+ [os.path.join("../", x) for x in nix_files],
cwd=".nix",
no_capture=True,
)

Expand Down Expand Up @@ -600,7 +600,7 @@ async def generate_readable_output(result):
if verdict != "success":
prog_name = cleaned_row.get("prog_name", "")
if prog_name:
reproduction_cmd = f"nix run \".github/include#ci\" veristat {result['kernel']} {result['scheduler']} {prog_name}"
reproduction_cmd = f"nix run \".nix#ci\" veristat {result['kernel']} {result['scheduler']} {prog_name}"
reproduction_cmds.add(reproduction_cmd)

for cmd in sorted(reproduction_cmds):
Expand Down
Empty file modified .github/include/list-integration-tests.py
100644 → 100755
Empty file.
Empty file modified .github/include/update-kernels.py
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions .github/workflows/build-kernels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
cachix-auth-token: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Load dependencies
run: nix run ./.github/include#nix-develop-gha -- ./.github/include#gha-build-kernels
run: nix run ./.nix#nix-develop-gha -- ./.nix#gha-build-kernels

- name: Build all kernels
id: nix-build
run: |
drvnames=$(nix flake show ./.github/include --json | jq -r '
drvnames=$(nix flake show ./.nix --json | jq -r '
.packages["x86_64-linux"] | keys[] | select(startswith("kernel_"))' |
awk '{ print "./.github/include#" $0 "\n./.github/include#" $0 ".headers" }')
awk '{ print "./.nix#" $0 "\n./.nix#" $0 ".headers" }')

echo 'kernel-paths<<EOF' >> $GITHUB_OUTPUT
xargs nix build --no-link --print-out-paths <<< "$drvnames" >>$GITHUB_OUTPUT
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/caching-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
cachix-auth-token: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Format
run: nix run ./.github/include#ci -- format
run: nix run ./.nix#ci -- format

- name: Clippy
run: nix run ./.github/include#ci -- clippy
run: nix run ./.nix#ci -- clippy

build-and-test:
runs-on: ${{ github.repository_owner == 'sched-ext' && fromJSON('[ "self-hosted", "linux", "x64", "metal:nixos" ]') || 'ubuntu-latest' }}
Expand All @@ -40,13 +40,13 @@ jobs:
cachix-auth-token: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Build
run: nix run ./.github/include#ci -- build
run: nix run ./.nix#ci -- build

- name: Test
run: nix run ./.github/include#ci -- test
run: nix run ./.nix#ci -- test

- name: Veristat
run: nix run ./.github/include#ci -- veristat
run: nix run ./.nix#ci -- veristat

integration-test:
uses: ./.github/workflows/integration-tests.yml
Expand All @@ -65,7 +65,7 @@ jobs:
NEEDS_CONTEXT: ${{ toJSON(needs) }}
steps:
- uses: actions/checkout@v4
- run: nix run ./.github/include#nix-develop-gha -- ./.github/include#gha-build-kernels
- run: nix run ./.nix#nix-develop-gha -- ./.nix#gha-build-kernels
- run: echo "$NEEDS_CONTEXT" | jq -e 'to_entries | all(.value.result == "success")'

pages:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: List tests
id: output
run: nix run ./.github/include#list-integration-tests -- "${{ inputs.repo-name }}" >> $GITHUB_OUTPUT
run: nix run ./.nix#list-integration-tests -- "${{ inputs.repo-name }}" >> $GITHUB_OUTPUT

integration-test:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -67,8 +67,8 @@ jobs:
fi

echo "KERNEL_NAME=$KERNEL_NAME" >> $GITHUB_ENV
echo "KERNEL_STORE_PATH=$(nix build --no-link --print-out-paths ./.github/include#"kernel_${KERNEL_NAME}")" >> $GITHUB_ENV
echo "KERNEL_HEADERS_STORE_PATH=$(nix build --no-link --print-out-paths ./.github/include#"kernel_${KERNEL_NAME}".headers)" >> $GITHUB_ENV
echo "KERNEL_STORE_PATH=$(nix build --no-link --print-out-paths ./.nix#"kernel_${KERNEL_NAME}")" >> $GITHUB_ENV
echo "KERNEL_HEADERS_STORE_PATH=$(nix build --no-link --print-out-paths ./.nix#"kernel_${KERNEL_NAME}".headers)" >> $GITHUB_ENV

# cache virtiofsd (goes away w/ 24.04)
- name: Cache virtiofsd
Expand Down Expand Up @@ -133,5 +133,5 @@ jobs:
NEEDS_CONTEXT: ${{ toJSON(needs) }}
steps:
- uses: actions/checkout@v4
- run: nix run ./.github/include#nix-develop-gha -- ./.github/include#gha-build-kernels
- run: nix run ./.nix#nix-develop-gha -- ./.nix#gha-build-kernels
- run: echo "$NEEDS_CONTEXT" | jq -e 'to_entries | all(.value.result == "success")'
6 changes: 3 additions & 3 deletions .github/workflows/update-kernels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
cachix-auth-token: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Load dependencies
run: nix run ./.github/include#nix-develop-gha -- ./.github/include#gha-update-kernels
run: nix run ./.nix#nix-develop-gha -- ./.nix#gha-update-kernels

- name: List kernels
id: output
Expand All @@ -45,7 +45,7 @@ jobs:
cachix-auth-token: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Load dependencies
run: nix run ./.github/include#nix-develop-gha -- ./.github/include#gha-update-kernels
run: nix run ./.nix#nix-develop-gha -- ./.nix#gha-update-kernels

- name: Update kernel
run: |
Expand All @@ -55,7 +55,7 @@ jobs:
INITIAL_COMMIT=$(git rev-parse HEAD)

git switch -c "deps/kernel/${{ matrix.version }}"
nix run ./.github/include#update-kernels -- ${{ matrix.version }}
nix run ./.nix#update-kernels -- ${{ matrix.version }}

FINAL_COMMIT=$(git rev-parse HEAD)
if [ "$INITIAL_COMMIT" != "$FINAL_COMMIT" ]; then
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions .github/include/flake.nix → .nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
src = libbpf-src;
version = "git";
});
virtme-ng = prev.callPackage ../../.nix/pkgs/virtme-ng.nix { };
virtme-ng = prev.callPackage ./pkgs/virtme-ng.nix { };
})
];
};
Expand Down Expand Up @@ -142,7 +142,7 @@
nix-develop-gha = nix-develop-gha.packages.${system}.default;
bpf-clang = makeBpfClang pkgs.llvmPackages self.packages.${system}."kernel_sched_ext/for-next";

veristat = pkgs.callPackage ../../.nix/pkgs/veristat.nix {
veristat = pkgs.callPackage ./pkgs/veristat.nix {
version = "git";
src = veristat-src;
libbpf = pkgs.libbpf-git;
Expand All @@ -159,7 +159,7 @@
rust-toolchain # requires cargo, use the toolchain to match version exactly
];

installPhase = "install -Dm755 ${./list-integration-tests.py} $out/bin/list-integration-tests";
installPhase = "install -Dm755 ${../.github/include/list-integration-tests.py} $out/bin/list-integration-tests";
};

ci = pkgs.python3Packages.buildPythonApplication rec {
Expand Down Expand Up @@ -235,16 +235,16 @@
]
] ++ (lib.mapAttrsToList (key: val: "--set ${key} \"${val}\"") build-env-vars));

installPhase = "install -Dm755 ${../include/ci.py} $out/bin/ci";
installPhase = "install -Dm755 ${../.github/include/ci.py} $out/bin/ci";
};
} // (with lib.attrsets; mapAttrs'
(name: details: nameValuePair "kernel_${name}" (pkgs.callPackage ../../.nix/pkgs/build-kernel.nix {
(name: details: nameValuePair "kernel_${name}" (pkgs.callPackage ./pkgs/build-kernel.nix {
inherit name;
inherit (details) repo branch commitHash narHash;
version = details.kernelVersion;
patches = map (patchName: ./kernel-patches + ("/" + patchName)) (details.patches or [ ]);
}))
(builtins.fromJSON (builtins.readFile ./../../kernel-versions.json)));
(builtins.fromJSON (builtins.readFile ./../kernel-versions.json)));
}) // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
Expand All @@ -271,7 +271,7 @@
nix
];

installPhase = "install -Dm755 ${../include/update-kernels.py} $out/bin/update-kernels";
installPhase = "install -Dm755 ${../.github/include/update-kernels.py} $out/bin/update-kernels";
};
in
{
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This repository has a kernel lock file at `./kernel-versions.json` where we trac
several kernels important to development.

If your change requires a new commit from a branch, you can update this file with:
`nix run ./.github/include#update-kernels`
`nix run ./.nix#update-kernels`
or with:
`python3 ./.github/include/update-kernels.py`

Expand All @@ -52,7 +52,7 @@ both updating the kernel lock and making necessary fixes to the codebase.
We use `virtme-ng` for testing in the CI environment, and it should be possible
to reproduce behaviour locally with the same pinned kernels. To get an identical
kernel to the CI with Nix installed, run:
`nix build ./.github/include#kernel_sched_ext/for-next`
`nix build ./.nix#kernel_sched_ext/for-next`
And the kernel image will be available at `result/bzImage`. Alternatively you
can clone the repo/commit from `kernel-versions.json`, but this isn't guaranteed
to be reproducible.
Expand Down