From 8eb3d5cf6ab13834401107e50c0dac5f54001a03 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 729a1df930..2a3524f87f 100644 --- a/config/runtime/boot/fastboot.jinja2 +++ b/config/runtime/boot/fastboot.jinja2 @@ -16,6 +16,14 @@ format: tar path: / {% set dtb = device_dtb.split('/')[-1] %} + {%- 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 9e09f7c28b..c13d664d46 100644 --- a/config/runtime/tests/kselftest-platform-parameters.jinja2 +++ b/config/runtime/tests/kselftest-platform-parameters.jinja2 @@ -35,7 +35,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 62c1ea4d9c..3ec736cd37 100644 --- a/config/runtime/tests/kselftest.jinja2 +++ b/config/runtime/tests/kselftest.jinja2 @@ -22,7 +22,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 }}'