From f684e297d1487afcacc8e56692af5b4f94f43b0d Mon Sep 17 00:00:00 2001 From: michael crosby Date: Fri, 6 Jun 2025 13:02:19 -0400 Subject: [PATCH] separate fetch-default-kernel make target Signed-off-by: michael crosby --- .../workflows/containerization-build-template.yml | 5 +++-- Makefile | 12 ++++++++---- README.md | 10 ++++++++++ kernel/README.md | 5 +++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/containerization-build-template.yml b/.github/workflows/containerization-build-template.yml index bcd8c1e3..9f9f538e 100644 --- a/.github/workflows/containerization-build-template.yml +++ b/.github/workflows/containerization-build-template.yml @@ -60,7 +60,8 @@ jobs: CURRENT_SDK: y - name: Test containerization run: | - make test integration + make fetch-default-kernel + make test integration env: REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} REGISTRY_USERNAME: ${{ github.actor }} @@ -112,4 +113,4 @@ jobs: - name: Upload Artifact uses: actions/upload-pages-artifact@v3 with: - path: "./_site" \ No newline at end of file + path: "./_site" diff --git a/Makefile b/Makefile index 3e58e671..bdd8d967 100644 --- a/Makefile +++ b/Makefile @@ -84,13 +84,17 @@ test: @$(SWIFT) test --enable-code-coverage .PHONY: integration -integration: kernel-bin +integration: +ifeq (,$(wildcard bin/vmlinux)) + @echo No bin/vmlinux kernel found. See fetch-default-kernel target. + @exit 1 +endif @echo Running the integration tests... @./bin/containerization-integration --bootlog ./bin/boot.log -.PHONY: kernel-bin -kernel-bin: - @mkdir -p .local/ +.PHONY: fetch-default-kernel +fetch-default-kernel: + @mkdir -p .local/ bin/ ifeq (,$(wildcard .local/kata.tar.gz)) @curl -SsL -o .local/kata.tar.gz ${KATA_BINARY_PACKAGE} endif diff --git a/README.md b/README.md index bb845dbb..35815963 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,16 @@ Build Containerization from sources and run basic and integration tests: make all test integration ``` +A kernel is required to run integration tests. +If you do not have a kernel locally for use a default kernel can be fetched using the `make fetch-default-kernel` target. + +Fetching the default kernel only needs to happen after an initial build or after a `make clean`. + +```bash +make fetch-default-kernel +make all test integration +``` + ## Protobufs Containerization depends on specific versions of `grpc-swift` and `swift-protobuf`. You can install them and re-generate RPC interfaces with: diff --git a/kernel/README.md b/kernel/README.md index c7c1b59b..962cb804 100644 --- a/kernel/README.md +++ b/kernel/README.md @@ -10,9 +10,10 @@ This directory includes an optimized kernel configuration to produce a fast and ## Building -1. Build the `Containerization` project by running `make all kernel-bin` in the root of the repository. -2. Place the kernel you want to use in `bin/vmlinux` directory of this repository. +1. Build the `Containerization` project by running `make` in the root of the repository. +2. Place a kernel you want to use in `bin/vmlinux` directory of the repository. a. This kernel will be used to launch the build container. + b. To fetch a default kernel run `make fetch-default-kernel` in the root of the repository. 4. Run `make` in the `/kernel` directory. A `kernel/vmlinux` will be the result of the build.