docker: images to build kernels, run static tests and selftests - #91
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
vngandmakecommand by something like this:(
--privilegedis needed to access/dev/kvm,-tshouldn't be used if there is no tty)For the static/build tests:
An alias (or script) can be used to avoid typing such long commands.
Once merge, the wiki page will be updated.