Skip to content

docker: images to build kernels, run static tests and selftests - #91

Merged
kuba-moo merged 5 commits into
linux-netdev:mainfrom
matttbe:docker-runner
Aug 26, 2026
Merged

docker: images to build kernels, run static tests and selftests#91
kuba-moo merged 5 commits into
linux-netdev:mainfrom
matttbe:docker-runner

Conversation

@matttbe

@matttbe matttbe commented Aug 24, 2026

Copy link
Copy Markdown
Member

The idea here is to have some docker images that are closed to the current CI environment, to easily run the same tests as the ones executed on NIPA. So instead of installing a bunch of dependences, and trying to guess which versions are used on NIPA, these containers can be used. The CI is not currently using these images, but that might be the case later.

These images are supposed to be easy to use and maintain. They are going to be built and pushed to the GitHub registry each time the related files are modified. The Dockerfile are also kept simple to let more people modifying them if needed: at the end it is just a bunch of commands someone would execute to install programs on their side.

To use them, that's easy: for the selftests, simply follow the instructions from the wiki and prefix each vng and make command by something like this:

cd $linux
docker run \
    -v "${CCACHE_DIR}:/home/nipa/.ccache:rw" \
    -v "${PWD}:${PWD}:rw" \
    -w "${PWD}" \
    -u "${RUID:-$(id -u)}:${RGID:-$(id -g)}" \
    --group-add "$(grep "^kvm:" /etc/group | cut -d: -f3)" \
    --rm \
    -i -t \
    --privileged \
    --pull always \
    ghcr.io/linux-netdev/nipa-selftests:latest \
    <vng|make> (...)

(--privileged is needed to access /dev/kvm, -t shouldn't be used if there is no tty)

For the static/build tests:

cd $linux
b4 send -o /tmp/b4

cd $nipa
docker run \
    -v "${CCACHE_DIR}:/home/nipa/.ccache:rw" \
    -v "${PWD}:${PWD}:rw" \
    -v "${linux}:${linux}:rw" \
    -v "/tmp/b4:/tmp/b4:ro" \
    -w "${PWD}" \
    -u "${RUID:-$(id -u)}:${RGID:-$(id -g)}" \
    --rm \
    -i -t \
    --pull always \
    ghcr.io/linux-netdev/nipa-build:latest \
    ./ingest_mdir.py \
          --mdir /tmp/b4 --tree $linux --result-dir out

An alias (or script) can be used to avoid typing such long commands.

Once merge, the wiki page will be updated.

In preparation to new images.

Note that this image is outdated: various packages are missing to run
ingest_mdir.py.

Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
This base will be used in the following commits to be able to run the
static tests on one side, and the selftests on the other.

The Dockerfile is simple: it contains a few common dependences, a 'nipa'
user with a git config and CCACHE configured.

A few simple bash scripts are added to build and run the docker images
easily:

  ./docker/build.sh        # build all images
  ./docker/<dir>/build.sh  # build a specific image
  ./docker/<dir>/run.sh    # get a prompt or execute a command from a
                           # specific docker image

The build scripts can be used with INPUT_PUSH=1 to publish the images
after having built them.

Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
This image includes all the dependences to execute the static tests from
this repo. In other words, to execute the ingest_mdir.py script.

Once built, the ingest_mdir.py script can be executed that way:

  cd $linux
  b4 send -o /tmp/b4

  cd $nipa
  ./docker/build/run.sh ./ingest_mdir.py \
      --mdir /tmp/b4 --tree $linux --result-dir out

Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
This image contains all the dependences and tools to build a kernel, and
run the net selftests. Most dependences are coming from the Fedora repo,
but others are installed from specific versions, like IPRoute2 or
virtme-ng.

After discussions with other maintainers, it has been decided to have a
single image to run all the selftests.

Once the images are built, the 'run.sh' script can be used to execute
the usual commands to build the kernel and the selftests, and run the
tests from a VM machine, e.g.

  cd $linux
  $nipa/docker/selftests/run.sh \
      vng --build --config tools/testing/selftests/net/mptcp/config

  $nipa/docker/selftests/run.sh \
      make -C tools/testing/selftests TARGETS=net/mptcp

  $nipa/docker/selftests/run.sh \
      vng -v --run . --user root --cpus 4 -- \
          make -C tools/testing/selftests TARGETS=net/mptcp run_tests

Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
A simple GitHub Action to build and publish docker images.

This is triggered on a push to the main branch and on pull requests, but
only when related files are modified.

The publication is only done when the main branch is updated.

Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
@kuba-moo
kuba-moo merged commit 53e7a79 into linux-netdev:main Aug 26, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants