From 3f3bfad6c925990d7b0314a22d530f3bacd5dd3e Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 10 Apr 2025 18:18:55 +0100 Subject: [PATCH] lava: Install the kselftest tarball using an overlay Currently the kselftest LAVA jobs that KernelCI generates have the test job download the kselftest tarball onto the device. This has a couple of disadvantages: - Any caching that is configured for the LAVA worker will be bypassed, increasing network traffic both for the lab and for the KernelCI storage server. - The entire kselftest tarball has to be downloaded onto the test system, and if (as is usual) it is a NFS filesystem then an uncompressed copy written over the network to the LAVA worker. The test-definitions integration for kselftest also supports running a copy that is already installed in the filesystem, and LAVA supports adding files onto the root filesystem via it's overlay mechanism, so we can avoid the overheads of downloading directly to the device by having LAVA apply the kselftest tarball to the root filesystem as an overlay instead. A commit was previously merged doing this for the legacy LAVA templates, this updates the Maestro ones. Signed-off-by: Mark Brown --- config/runtime/boot/depthcharge.jinja2 | 9 +++++++++ config/runtime/boot/fastboot.jinja2 | 8 ++++++++ config/runtime/boot/grub.jinja2 | 9 +++++++++ config/runtime/boot/u-boot.jinja2 | 9 +++++++++ .../runtime/tests/kselftest-platform-parameters.jinja2 | 2 +- config/runtime/tests/kselftest.jinja2 | 2 +- 6 files changed, 37 insertions(+), 2 deletions(-) diff --git a/config/runtime/boot/depthcharge.jinja2 b/config/runtime/boot/depthcharge.jinja2 index 6a7c7fba00..880a718790 100644 --- a/config/runtime/boot/depthcharge.jinja2 +++ b/config/runtime/boot/depthcharge.jinja2 @@ -27,7 +27,16 @@ {%- if boot_commands == 'nfs' and nfsroot %} nfsrootfs: compression: xz + format: tar url: '{{ nfsroot }}/full.rootfs.tar.xz' + {%- if node.artifacts.kselftest_tar_gz %} + overlays: + kselftest: + url: {{ node.artifacts.kselftest_tar_gz }} + compression: gz + format: tar + path: /opt/kselftest + {%- endif %} ramdisk: compression: gz url: '{{ nfsroot }}/initrd.cpio.gz' diff --git a/config/runtime/boot/fastboot.jinja2 b/config/runtime/boot/fastboot.jinja2 index 9b1a44ac8d..f4892a0e4e 100644 --- a/config/runtime/boot/fastboot.jinja2 +++ b/config/runtime/boot/fastboot.jinja2 @@ -10,6 +10,14 @@ format: cpio.newc overlays: lava: true + {%- if node.artifacts.kselftest_tar_gz %} + kselftest: + url: {{ node.artifacts.kselftest_tar_gz }} + compression: gz + format: tar + path: /opt/kselftest + {%- endif %} + postprocess: docker: image: ghcr.io/mwasilew/docker-mkbootimage:master diff --git a/config/runtime/boot/grub.jinja2 b/config/runtime/boot/grub.jinja2 index a7681525f7..d149f53c2d 100644 --- a/config/runtime/boot/grub.jinja2 +++ b/config/runtime/boot/grub.jinja2 @@ -6,7 +6,16 @@ {%- if boot_commands == 'nfs' %} nfsrootfs: url: '{{ nfsroot }}/full.rootfs.tar.xz' + format: tar compression: xz + {%- if node.artifacts.kselftest_tar_gz %} + overlays: + kselftest: + url: {{ node.artifacts.kselftest_tar_gz }} + compression: gz + format: tar + path: /opt/kselftest + {%- endif %} ramdisk: url: '{{ nfsroot }}/initrd.cpio.gz' compression: gz diff --git a/config/runtime/boot/u-boot.jinja2 b/config/runtime/boot/u-boot.jinja2 index 8907cc999e..127f77e5ee 100644 --- a/config/runtime/boot/u-boot.jinja2 +++ b/config/runtime/boot/u-boot.jinja2 @@ -16,7 +16,16 @@ {%- if boot_commands == 'nfs' %} nfsrootfs: url: '{{ nfsroot }}/full.rootfs.tar.xz' + format: tar compression: xz + {%- if node.artifacts.kselftest_tar_gz %} + overlays: + kselftest: + url: {{ node.artifacts.kselftest_tar_gz }} + compression: gz + format: tar + path: /opt/kselftest + {%- endif %} ramdisk: url: '{{ nfsroot }}/initrd.cpio.gz' compression: gz diff --git a/config/runtime/tests/kselftest-platform-parameters.jinja2 b/config/runtime/tests/kselftest-platform-parameters.jinja2 index ee2c25eca6..8b193401f0 100644 --- a/config/runtime/tests/kselftest-platform-parameters.jinja2 +++ b/config/runtime/tests/kselftest-platform-parameters.jinja2 @@ -33,7 +33,7 @@ path: automated/linux/kselftest/kselftest.yaml name: '{{ node.name }}' parameters: - TESTPROG_URL: '{{ node.artifacts.kselftest_tar_gz }}' + KSELFTEST_PATH: /opt/kselftest SKIPFILE: /dev/null TST_CMDFILES: '{{ collections }}' TST_CASENAME: '{{ tests }}' diff --git a/config/runtime/tests/kselftest.jinja2 b/config/runtime/tests/kselftest.jinja2 index 05ceb15ef1..1b66978524 100644 --- a/config/runtime/tests/kselftest.jinja2 +++ b/config/runtime/tests/kselftest.jinja2 @@ -20,7 +20,7 @@ path: automated/linux/kselftest/kselftest.yaml name: '{{ node.name }}' parameters: - TESTPROG_URL: '{{ node.artifacts.kselftest_tar_gz }}' + KSELFTEST_PATH: /opt/kselftest SKIPFILE: {{ skipfile if skipfile else '/dev/null' }} TST_CMDFILES: '{{ collections }}' TST_CASENAME: '{{ tests }}'