Untitled conversation
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
default:
image: debian:testing
tags:
- trixie
stages:
- build
- test
- generate
- lava
check devicetrees:
stage: build
tags:
- ultra-heavyweight
variables:
DEBIAN_FRONTEND: noninteractive
GIT_SUBMODULE_STRATEGY: normal
ARCH: arm64
DEFCONFIG: defconfig
CROSS_COMPILE: aarch64-linux-gnu-
DUT: rockchip/rk3588s-rock-5a.dtb rockchip/rk3588-rock-5b.dtb rockchip/rk3588-evb1-v10.dtb rockchip/rk3576-armsom-sige5.dtb
before_script:
- apt update
- apt install -y devscripts
build-essential
crossbuild-essential-arm64
bc
bison
flex
swig
python3-dev
python3-pip
python3-setuptools
yamllint
- pip3 install --break-system-packages dtschema
script:
- make $DEFCONFIG
- make -j$(nproc) dt_binding_check
- make -j$(nproc) CHECK_DTBS=y $DUT 2> dt-warnings.txt
- if [[ $(cat dt-warnings.txt | wc -l) > 0 ]]; then cat dt-warnings.txt; exit 42; fi
allow_failure:
exit_codes:
- 42
.build debian package:
stage: build
tags:
- ultra-heavyweight
cache:
when: on_success
key: $CI_COMMIT_REF_SLUG
paths:
- ccache
variables:
DEBIAN_FRONTEND: noninteractive
GIT_SUBMODULE_STRATEGY: normal
ARCH: amd64
DEFCONFIG: defconfig
CCACHE_BASEDIR: $CI_PROJECT_DIR
CCACHE_DIR: $CI_PROJECT_DIR/ccache
before_script:
- dpkg --add-architecture arm64
- apt update
- apt install -y devscripts
build-essential
crossbuild-essential-arm64
bc
bison
ccache
flex
rsync
kmod
cpio
libelf-dev
libssl-dev
libssl-dev:arm64
# Setup ccache
- export PATH="/usr/lib/ccache:$PATH"
- ccache -s
script:
- make $DEFCONFIG
- ./scripts/config -e WLAN -e WLAN_VENDOR_BROADCOM -m BRCMUTIL -m BRCMFMAC
-e BRCMFMAC_PROTO_BCDC -e BRCMFMAC_PROTO_MSGBUF
-e BRCMFMAC_USB
-e WLAN_VENDOR_REALTEK -m RTW89 -m RTW89_CORE
-e DYNAMIC_DEBUG
-m RTW89_PCI -m RTW89_8825B -m RTW89_8852BE
-m BINFMT_MISC
-m XFS_FS -m EROFS_FS -m F2FS_FS
-m EXFAT_FS -m ISO9660_FS
- make -j$(nproc) $ADDITIONAL_BUILD_CMD bindeb-pkg
- mkdir artifacts && dcmd mv ../*.changes artifacts/
artifacts:
paths:
- artifacts
build arm64 debian package:
extends: .build debian package
variables:
ARCH: arm64
CROSS_COMPILE: aarch64-linux-gnu-
ADDITIONAL_BUILD_CMD: KBUILD_IMAGE=arch/arm64/boot/Image
generate tests:
image: debian:trixie-slim
stage: generate
tags:
- lightweight
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: "1"
needs:
- "build arm64 debian package"
before_script:
- apt update
- apt install -y wget
script:
- mkdir deb
- "for x in artifacts/linux-image*.deb ; do dpkg -x ${x} deb ; done"
- cp deb/boot/vmlinuz* vmlinuz
- mkdir -p deb/lib/firmware/arm/mali/arch10.8
- wget -O deb/lib/firmware/arm/mali/arch10.8/mali_csffw.bin "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/arm/mali/arch10.8/mali_csffw.bin"
- tar -f modules.tar.gz -C deb -c -z -v lib/modules lib/firmware
- mkdir dtbs
- cp -r deb/usr/lib/linux-image*/* dtbs
- sed -i s,%%KERNEL_BUILD_JOB%%,${CI_JOB_ID},g lava/rock5b-testjob.yaml
- sed -i s,%%KERNEL_BUILD_JOB%%,${CI_JOB_ID},g lava/sige5-testjob.yaml
artifacts:
paths:
- vmlinuz*
- modules.tar.gz
- dtbs
- lava/rock5b-testjob.yaml
- lava/sige5-testjob.yaml
lava rock5b test:
stage: lava
environment: rock5b
tags:
- lava-runner
script:
- submit lava/rock5b-testjob.yaml
needs:
- "generate tests"
artifacts:
when: always
paths:
- "*"
reports:
junit: "*_junit.xml"
lava sige5 test:
stage: lava
environment: sige5
tags:
- lava-runner
script:
- submit lava/sige5-testjob.yaml
needs:
- "generate tests"
artifacts:
when: always
paths:
- "*"
reports:
junit: "*_junit.xml"
This GitLab CI/CD configuration defines a sophisticated pipeline for building Linux kernel Debian packages, checking device trees, and then deploying/testing them on physical hardware using LAVA.
Let's break down the configuration:
The pipeline has four main stages: build, test, generate, and lava. It focuses on building an ARM64 Linux kernel and its associated components, then preparing and submitting tests to a LAVA lab for execution on specific hardware (Rock5B and Sige5 boards).
default)image: debian:testing: All jobs will use the debian:testing Docker image by default, unless overridden by a specific job.tags: - trixie: All jobs will require a GitLab Runner configured with the trixie tag, unless overridden.build: For compiling the kernel, building packages, and performing static checks.test: (Defined but currently empty, no jobs assigned to this stage).generate: For preparing artifacts (kernel image, modules, DTBs, LAVA job definitions) from the built package for testing.lava: For submitting the prepared artifacts to a LAVA lab for actual hardware testing.check devicetreesbuildultra-heavyweight - suggests this job requires a powerful runner, potentially with more CPU/RAM. Overrides the default trixie tag.ARCH: arm64, CROSS_COMPILE: aarch64-linux-gnu-: Specifies the target architecture and cross-compiler for the kernel build.DEFCONFIG: defconfig: The base kernel configuration.DUT: A space-separated list of specific DTB files to be checked.DEBIAN_FRONTEND: noninteractive, GIT_SUBMODULE_STRATEGY: normal.before_script:
build-essential, , , , , ) and Python dependencies (, , , ).crossbuild-essential-arm64bcbisonflexswigpython3-devpython3-pippython3-setuptoolsyamllintdtschema using pip3, which is used for device tree binding validation.script:
make $DEFCONFIG: Sets up the kernel configuration.make -j$(nproc) dt_binding_check: Runs checks on device tree bindings against their schemas. This ensures the DTS files adhere to the defined standards.make -j$(nproc) CHECK_DTBS=y $DUT 2> dt-warnings.txt: Compiles the specified DTBs and redirects any warnings to dt-warnings.txt. The CHECK_DTBS=y likely enables stricter checks during compilation.if [[ $(cat dt-warnings.txt | wc -l) > 0 ]]; then cat dt-warnings.txt; exit 42; fi: Checks if the dt-warnings.txt file contains any lines (i.e., warnings). If so, it prints the warnings and exits with a custom code 42.allow_failure: exit_codes: - 42. This is important: if the script exits with code 42 (meaning there were device tree warnings), the job will be marked as "allowed to fail" (often yellow/warning in GitLab UI) instead of a hard "failed" (red). This is a good practice for non-critical warnings that shouldn't block the entire pipeline..build debian package (Template Job)build.) used for building Linux kernel Debian packages. It's designed to be extended by other jobs.ultra-heavyweight - similar to check devicetrees, implying a robust runner.when: on_success: Caches the specified paths only if the job succeeds.key: $CI_COMMIT_REF_SLUG: Creates a unique cache key per branch/tag, optimizing for specific code versions.paths: - ccache: Caches the ccache directory. ccache significantly speeds up recompilations by caching previous compilation results.ARCH, DEFCONFIG: General build parameters.CCACHE_BASEDIR, CCACHE_DIR: Configuration for ccache to ensure it works correctly within the CI environment.DEBIAN_FRONTEND: noninteractive, GIT_SUBMODULE_STRATEGY: normal.before_script:
dpkg --add-architecture arm64: Configures the system to support arm64 architecture packages, crucial for cross-compilation dependencies.ccache, rsync, kmod, cpio, libelf-dev, and libssl-dev (for both amd64 and arm64).export PATH="/usr/lib/ccache:$PATH": Adds ccache to the system's PATH, ensuring that compilation commands use ccache as a wrapper.ccache -s: Shows ccache statistics, useful for debugging and verifying cache usage.script:
make $DEFCONFIG: Configures the kernel based on the default../scripts/config -e ...: Uses the kernel's scripts/config utility to enable specific features and modules (e.g., various WLAN drivers like Broadcom and Realtek, different filesystems like XFS, EROFS, F2FS, EXFAT, ISO9660, and BINFMT_MISC, DYNAMIC_DEBUG). This customizes the kernel build.make -j$(nproc) $ADDITIONAL_BUILD_CMD bindeb-pkg: The core build command. bindeb-pkg is a standard kernel make target that builds Debian kernel packages. $ADDITIONAL_BUILD_CMD is a placeholder for specific build options passed by extending jobs.mkdir artifacts && dcmd mv ../*.changes artifacts/: Creates an artifacts directory and moves the generated Debian changelog files (.changes) into it. (Note: The actual .deb files are implicitly handled, likely created directly in artifacts by bindeb-pkg or moved by a mechanism not explicitly shown here, as they are consumed later).artifacts: paths: - artifacts. Collects the contents of the artifacts directory, which should contain the built Debian kernel packages.build arm64 debian packagebuildextends: .build debian package: Inherits all configurations from the template job.arm64:
ARCH: arm64CROSS_COMPILE: aarch64-linux-gnu-ADDITIONAL_BUILD_CMD: KBUILD_IMAGE=arch/arm64/boot/Image: Specifies the kernel image to build for ARM64.generate testsgeneratedebian:trixie-slim (overrides default) - a lighter image, suitable for this stage's tasks.lightweight (overrides default).GIT_STRATEGY: fetch, GIT_DEPTH: "1": Optimizes the Git clone operation for speed, only fetching the current commit.needs: build arm64 debian package. This job will only run after build arm64 debian package completes successfully, and it will automatically download its artifacts.before_script: Installs wget for downloading files.script:
mkdir deb: Creates a directory to unpack the Debian package into.for x in artifacts/linux-image*.deb ; do dpkg -x ${x} deb ; done: Unpacks the linux-image*.deb package (obtained from the build arm64 debian package artifacts) into the deb directory.cp deb/boot/vmlinuz* vmlinuz: Copies the kernel image.mkdir -p deb/lib/firmware/arm/mali/arch10.8: Creates a directory structure for Mali firmware.wget -O ... mali_csffw.bin "https://git.kernel.org/...": Downloads a specific Mali firmware binary.tar -f modules.tar.gz -C deb -c -z -v lib/modules lib/firmware: Creates a gzipped tarball containing the kernel modules and firmware.mkdir dtbs && cp -r deb/usr/lib/linux-image*/* dtbs: Extracts the device tree blobs (DTBs) from the unpacked Debian package.sed -i s,%%KERNEL_BUILD_JOB%%,${CI_JOB_ID},g lava/rock5b-testjob.yaml: Replaces a placeholder (%%KERNEL_BUILD_JOB%%) in the LAVA test definition YAML files with the current GitLab CI job ID. This allows tracking which kernel build generated the test.artifacts: paths: - vmlinuz* - modules.tar.gz - dtbs - lava/rock5b-testjob.yaml - lava/sige5-testjob.yaml. These are the generated files that will be consumed by the LAVA test jobs.lava rock5b testlavarock5b - labels the environment in GitLab's UI.lava-runner - requires a specialized runner configured to interact with a LAVA lab.script: submit lava/rock5b-testjob.yaml - This command (assumed to be a LAVA client utility on the runner) submits the prepared LAVA job definition.needs: "generate tests" - Ensures this job runs only after generate tests has prepared all necessary artifacts.artifacts:
when: always: Collects artifacts regardless of job success or failure.paths: - "*": Collects all files in the job's working directory.reports: junit: "*_junit.xml": This is crucial for GitLab's built-in test reporting. It tells GitLab to parse any _junit.xml files generated by the LAVA test and display the results in the merge request and pipeline views.lava sige5 testlavalava rock5b test, but targets a different board (sige5).build Stage:
check devicetrees runs.build arm64 debian package runs (in parallel with check devicetrees if runners are available).generate Stage:
generate tests runs ONLY AFTER build arm64 debian package successfully completes. It consumes the artifacts (the built Debian package) from that job.lava Stage:
lava rock5b test runs ONLY AFTER generate tests successfully completes. It consumes the artifacts (kernel, modules, DTBs, LAVA job files) from generate tests.lava sige5 test runs in parallel with lava rock5b test, also ONLY AFTER generate tests completes.extends): Excellent use of .build debian package as a template to avoid repetition for similar build jobs.needs: Proper use of artifacts to pass files between stages and needs to define explicit job dependencies, ensuring correct execution order and artifact availability.ccache): Effective use of cache with ccache to speed up kernel compilation by reusing build objects across pipeline runs.tags like ultra-heavyweight and lava-runner demonstrates an environment with specialized GitLab Runners for different types of tasks (e.g., high-performance builds, physical hardware interaction).allow_failure): The allow_failure for check devicetrees is a good way to differentiate between critical failures and warnings that shouldn't halt the entire pipeline.reports: junit in the LAVA jobs is a standard and very useful feature for integrating test results directly into GitLab's UI.sed to inject the CI_JOB_ID into the LAVA job definitions allows for better traceability of test results back to the specific build.mali_csffw.bin ensures the correct version is used for testing, though it introduces an external dependency on the firmware's URL.test Stage Jobs: The test stage is defined but no jobs are currently assigned to it. This means it will be skipped. It might be a placeholder for future unit/integration tests that run before hardware deployment..changes files are explicitly moved, the generate tests job implies that the linux-image*.deb files are also available in artifacts. This suggests that either make bindeb-pkg places them there directly, or an implicit mv step is missing from the template job's script section for clarity.--break-system-packages: The pip3 install --break-system-packages flag is used. While often necessary in CI containers on recent Debian, it's generally good practice to use Python virtual environments to avoid potential conflicts with system packages if this were a more persistent environment. For ephemeral CI jobs, it's usually acceptable.