diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89919853cf5..2e4c4978be0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -382,6 +382,7 @@ sanity: image_tags=( ALPINE_X86_64_BUILD_TAG ALPINE_X86_64_LAVA_SSH_TAG + ALPINE_X86_64_LAVA_TRIGGER_TAG DEBIAN_BASE_TAG DEBIAN_BUILD_TAG DEBIAN_PYUTILS_TAG diff --git a/.gitlab-ci/common/init-stage1.sh b/.gitlab-ci/common/init-stage1.sh index 92222a5d4c7..77f327fc1cd 100755 --- a/.gitlab-ci/common/init-stage1.sh +++ b/.gitlab-ci/common/init-stage1.sh @@ -3,6 +3,10 @@ # Very early init, used to make sure devices and network are set up and # reachable. +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + set -ex cd / diff --git a/.gitlab-ci/container/alpine/x86_64_lava-trigger.sh b/.gitlab-ci/container/alpine/x86_64_lava-trigger.sh new file mode 100644 index 00000000000..c9698090bfb --- /dev/null +++ b/.gitlab-ci/container/alpine/x86_64_lava-trigger.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +# This is a ci-templates build script to generate a container for triggering LAVA jobs. + +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + +# shellcheck disable=SC1091 +set -e + +. .gitlab-ci/setup-test-env.sh + +set -o xtrace + +uncollapsed_section_start alpine_setup "Base Alpine system setup" + +# Ephemeral packages (installed for this script and removed again at the end) +EPHEMERAL=( + git + py3-pip +) + +# We only need these very basic packages to run the LAVA jobs +DEPS=( + curl + python3 + tar + zstd +) + +apk --no-cache add "${DEPS[@]}" "${EPHEMERAL[@]}" + +pip3 install --break-system-packages -r bin/ci/requirements-lava.txt + +cp -Rp .gitlab-ci/lava / +cp -Rp .gitlab-ci/bin/*_logger.py /lava +cp -Rp .gitlab-ci/common/init-stage1.sh /lava + +. .gitlab-ci/container/container_pre_build.sh + +############### Uninstall the build software + +uncollapsed_section_switch alpine_cleanup "Cleaning up base Alpine system" + +apk del "${EPHEMERAL[@]}" + +. .gitlab-ci/container/container_post_build.sh + +section_end alpine_cleanup diff --git a/.gitlab-ci/container/gitlab-ci.yml b/.gitlab-ci/container/gitlab-ci.yml index d5731a5fae0..1019859d8dc 100644 --- a/.gitlab-ci/container/gitlab-ci.yml +++ b/.gitlab-ci/container/gitlab-ci.yml @@ -339,6 +339,13 @@ alpine/x86_64_lava_ssh_client: variables: MESA_IMAGE_TAG: &alpine-x86_64_lava_ssh_client ${ALPINE_X86_64_LAVA_SSH_TAG} +# Alpine based x86_64 image to run LAVA jobs +alpine/x86_64_lava-trigger: + extends: + - .alpine/x86_64_build-base + variables: + MESA_IMAGE_TAG: &alpine-x86_64_lava_trigger ${ALPINE_X86_64_LAVA_TRIGGER_TAG} + # Fedora based x86_64 build image fedora/x86_64_build: extends: diff --git a/.gitlab-ci/image-tags.yml b/.gitlab-ci/image-tags.yml index b6e67edae9f..19b198e61bf 100644 --- a/.gitlab-ci/image-tags.yml +++ b/.gitlab-ci/image-tags.yml @@ -32,6 +32,8 @@ variables: ALPINE_X86_64_BUILD_TAG: "20250423-rootfs" ALPINE_X86_64_LAVA_SSH_TAG: "20250423-rootfs" + ALPINE_X86_64_LAVA_TRIGGER_TAG: "20250526-byeutils" + FEDORA_X86_64_BUILD_TAG: "20250423-rootfs" KERNEL_TAG: "v6.14-mesa-dea4" diff --git a/.gitlab-ci/lava/__init__.py b/.gitlab-ci/lava/__init__.py index e69de29bb2d..449a711b384 100644 --- a/.gitlab-ci/lava/__init__.py +++ b/.gitlab-ci/lava/__init__.py @@ -0,0 +1,3 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG diff --git a/.gitlab-ci/lava/exceptions.py b/.gitlab-ci/lava/exceptions.py index 5066d337507..0a8fe0d0e8b 100644 --- a/.gitlab-ci/lava/exceptions.py +++ b/.gitlab-ci/lava/exceptions.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + from datetime import timedelta diff --git a/.gitlab-ci/lava/lava-gitlab-ci.yml b/.gitlab-ci/lava/lava-gitlab-ci.yml index 6165b4406fb..66b745aac62 100644 --- a/.gitlab-ci/lava/lava-gitlab-ci.yml +++ b/.gitlab-ci/lava/lava-gitlab-ci.yml @@ -3,6 +3,17 @@ variables: .lava-test: + # LAVA relies on two main containers: + # 1. alpine/x86_64_lava-trigger - the container used on the GitLab CI runner + # 2. the test-* container (e.g. debian/arm64_test-vk), whose derived rootfs + # is used on the DUT + # The following two containers are also used: + # 3. alpine/x86_64_lava_ssh_client - the slim SSH client container for jobs + # that use SSH instead of UART as job output + # 4. lava/health-check-docker - the slim container used for fastboot + # Set image: directly instead of extending .set-image to avoid conflicts + # with MESA_IMAGE_PATH and FDO_DISTRIBUTION_TAG between the containers. + image: "${CI_REGISTRY_IMAGE}/alpine/x86_64_lava-trigger:${ALPINE_X86_64_LAVA_TRIGGER_TAG}--${MESA_TEMPLATES_COMMIT}" # Cancel job if a newer commit is pushed to the same branch interruptible: true # The jobs themselves shouldn't actually run for an hour, of course. @@ -31,15 +42,11 @@ variables: # per-job build artifacts JOB_RESULTS_PATH: "${JOB_ARTIFACTS_BASE}/results.tar.zst" LAVA_S3_ARTIFACT_NAME: "mesa-${ARCH}-default-debugoptimized" - S3_ARTIFACT_NAME: "mesa-python-ci-artifacts" S3_RESULTS_UPLOAD: "${JOB_ARTIFACTS_BASE}" PIGLIT_NO_WINDOW: 1 VISIBILITY_GROUP: "Collabora+fdo" - before_script: - - !reference [.download_s3, before_script] script: - - . artifacts/setup-test-env.sh - - ./artifacts/lava/lava-submit.sh + - /lava/lava-submit.sh artifacts: name: "${CI_PROJECT_NAME}_${CI_JOB_NAME}" when: always @@ -57,9 +64,7 @@ variables: - !reference [.required-for-hardware-jobs, needs] - job: alpine/x86_64_lava_ssh_client artifacts: false - - job: debian/x86_64_pyutils - artifacts: false - - job: python-artifacts + - job: alpine/x86_64_lava-trigger artifacts: false .lava-x86_64-test: @@ -70,7 +75,6 @@ variables: KERNEL_IMAGE_TYPE: "zimage" BOOT_METHOD: u-boot extends: - - .use-debian/x86_64_pyutils - .lava-test needs: - !reference [.lava-test, needs] @@ -115,7 +119,6 @@ variables: KERNEL_IMAGE_TYPE: "zimage" BOOT_METHOD: u-boot extends: - - .use-debian/x86_64_pyutils - .lava-test needs: - !reference [.lava-test, needs] @@ -140,7 +143,6 @@ variables: KERNEL_IMAGE_TYPE: "image" BOOT_METHOD: u-boot extends: - - .use-debian/x86_64_pyutils - .lava-test needs: - !reference [.lava-test, needs] diff --git a/.gitlab-ci/lava/lava-submit.sh b/.gitlab-ci/lava/lava-submit.sh index ec8b253f5e6..ff7917cfc05 100755 --- a/.gitlab-ci/lava/lava-submit.sh +++ b/.gitlab-ci/lava/lava-submit.sh @@ -2,6 +2,10 @@ # shellcheck disable=SC2086 # we want word splitting # shellcheck disable=SC1091 # paths only become valid at runtime +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + # If we run in the fork (not from mesa or Marge-bot), reuse mainline kernel and rootfs, if exist. _check_artifact_path() { _url="https://${1}/${2}" @@ -76,7 +80,7 @@ if [ -n "${LAVA_FIRMWARE:-}" ]; then done fi -PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \ +PYTHONPATH=/ /lava/lava_job_submitter.py \ --farm "${FARM}" \ --device-type "${DEVICE_TYPE}" \ --boot-method "${BOOT_METHOD}" \ @@ -86,7 +90,7 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \ --rootfs-url "${ROOTFS_URL}" \ --kernel-url-prefix "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}" \ --dtb-filename "${DTB}" \ - --first-stage-init artifacts/ci-common/init-stage1.sh \ + --first-stage-init /lava/init-stage1.sh \ --env-file dut-env-vars.sh \ --jwt-file "${S3_JWT_FILE}" \ --kernel-image-name "${KERNEL_IMAGE_NAME}" \ diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py index e0aae3397fa..b6ce929096b 100755 --- a/.gitlab-ci/lava/lava_job_submitter.py +++ b/.gitlab-ci/lava/lava_job_submitter.py @@ -7,6 +7,10 @@ # # SPDX-License-Identifier: MIT +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + """Send a job to LAVA, track it and collect log back""" import contextlib diff --git a/.gitlab-ci/lava/utils/__init__.py b/.gitlab-ci/lava/utils/__init__.py index f4d4f997145..52b4bee4fbd 100644 --- a/.gitlab-ci/lava/utils/__init__.py +++ b/.gitlab-ci/lava/utils/__init__.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + from .console_format import CONSOLE_LOG from .gitlab_section import GitlabSection from .lava_job import LAVAJob diff --git a/.gitlab-ci/lava/utils/console_format.py b/.gitlab-ci/lava/utils/console_format.py index cb52625cb53..9f7458f3fc3 100644 --- a/.gitlab-ci/lava/utils/console_format.py +++ b/.gitlab-ci/lava/utils/console_format.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + CONSOLE_LOG = { "FG_GREEN": "\x1b[0;32m", "FG_BOLD_GREEN": "\x1b[0;1;32m", diff --git a/.gitlab-ci/lava/utils/constants.py b/.gitlab-ci/lava/utils/constants.py index 23ddfd27a49..8b31ca8cb7c 100644 --- a/.gitlab-ci/lava/utils/constants.py +++ b/.gitlab-ci/lava/utils/constants.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + from os import getenv # How many attempts should be made when a timeout happen during LAVA device boot. diff --git a/.gitlab-ci/lava/utils/gitlab_section.py b/.gitlab-ci/lava/utils/gitlab_section.py index 4df0abdde67..4627db32f5c 100644 --- a/.gitlab-ci/lava/utils/gitlab_section.py +++ b/.gitlab-ci/lava/utils/gitlab_section.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + from __future__ import annotations import re diff --git a/.gitlab-ci/lava/utils/lava_farm.py b/.gitlab-ci/lava/utils/lava_farm.py index aafcedbebd9..1a0bbecb378 100644 --- a/.gitlab-ci/lava/utils/lava_farm.py +++ b/.gitlab-ci/lava/utils/lava_farm.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + import logging import os diff --git a/.gitlab-ci/lava/utils/lava_job.py b/.gitlab-ci/lava/utils/lava_job.py index 6fd52555e54..4dcd2c0cf26 100644 --- a/.gitlab-ci/lava/utils/lava_job.py +++ b/.gitlab-ci/lava/utils/lava_job.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + import re import xmlrpc from collections import defaultdict diff --git a/.gitlab-ci/lava/utils/lava_job_definition.py b/.gitlab-ci/lava/utils/lava_job_definition.py index 7861bdd4de0..98a95f4fe4e 100644 --- a/.gitlab-ci/lava/utils/lava_job_definition.py +++ b/.gitlab-ci/lava/utils/lava_job_definition.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + from io import StringIO from typing import TYPE_CHECKING, Any import base64 diff --git a/.gitlab-ci/lava/utils/lava_log_hints.py b/.gitlab-ci/lava/utils/lava_log_hints.py index 3a35ae97c3c..be6ff315875 100644 --- a/.gitlab-ci/lava/utils/lava_log_hints.py +++ b/.gitlab-ci/lava/utils/lava_log_hints.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + from __future__ import annotations import re diff --git a/.gitlab-ci/lava/utils/lava_proxy.py b/.gitlab-ci/lava/utils/lava_proxy.py index ae127acbff1..a91736428c7 100644 --- a/.gitlab-ci/lava/utils/lava_proxy.py +++ b/.gitlab-ci/lava/utils/lava_proxy.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + import time import traceback import urllib diff --git a/.gitlab-ci/lava/utils/log_follower.py b/.gitlab-ci/lava/utils/log_follower.py index 877090a7b60..553ecb6bd8d 100644 --- a/.gitlab-ci/lava/utils/log_follower.py +++ b/.gitlab-ci/lava/utils/log_follower.py @@ -5,6 +5,10 @@ # # SPDX-License-Identifier: MIT +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + """ Some utilities to analyse logs, create gitlab sections and other quality of life improvements diff --git a/.gitlab-ci/lava/utils/log_section.py b/.gitlab-ci/lava/utils/log_section.py index dfae28a40f2..56faf4e761c 100644 --- a/.gitlab-ci/lava/utils/log_section.py +++ b/.gitlab-ci/lava/utils/log_section.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + import re from dataclasses import dataclass from datetime import datetime, timedelta diff --git a/.gitlab-ci/lava/utils/ssh_job_definition.py b/.gitlab-ci/lava/utils/ssh_job_definition.py index d9a7df32305..2f7f576e844 100644 --- a/.gitlab-ci/lava/utils/ssh_job_definition.py +++ b/.gitlab-ci/lava/utils/ssh_job_definition.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + """ In a few words: some devices in Mesa CI has problematic serial connection, they may hang (become silent) intermittently. Every time it hangs for minutes, the diff --git a/.gitlab-ci/lava/utils/uart_job_definition.py b/.gitlab-ci/lava/utils/uart_job_definition.py index 21b87569281..538b4565181 100644 --- a/.gitlab-ci/lava/utils/uart_job_definition.py +++ b/.gitlab-ci/lava/utils/uart_job_definition.py @@ -1,3 +1,7 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG + from typing import TYPE_CHECKING, Any if TYPE_CHECKING: diff --git a/.gitlab-ci/test-source-dep.yml b/.gitlab-ci/test-source-dep.yml index 0e289ce98fe..4c7ada8053f 100644 --- a/.gitlab-ci/test-source-dep.yml +++ b/.gitlab-ci/test-source-dep.yml @@ -122,7 +122,6 @@ LAVA_TAGS: "cbg-0" # Ensure that we are using the release build artifact LAVA_S3_ARTIFACT_NAME: mesa-${ARCH}-default-release - S3_ARTIFACT_NAME: mesa-python-ci-artifacts # Reset dependencies in performance jobs to enforce the release build artifact dependencies: null # Don't run in parallel. It is okay to performance jobs to take a little diff --git a/bin/ci/requirements-lava.txt b/bin/ci/requirements-lava.txt index 3bb33351986..fe580c1efa2 100644 --- a/bin/ci/requirements-lava.txt +++ b/bin/ci/requirements-lava.txt @@ -1,3 +1,6 @@ +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# ALPINE_X86_64_LAVA_TRIGGER_TAG filelock==3.* fire==0.5.0 lavacli==2.2.0 diff --git a/src/freedreno/ci/gitlab-ci-inc.yml b/src/freedreno/ci/gitlab-ci-inc.yml index 4d7f5c30532..298c3a60671 100644 --- a/src/freedreno/ci/gitlab-ci-inc.yml +++ b/src/freedreno/ci/gitlab-ci-inc.yml @@ -215,7 +215,6 @@ JOB_PRIORITY: 40 # Ensure that we are using the release build artifact LAVA_S3_ARTIFACT_NAME: mesa-arm64-default-release - S3_ARTIFACT_NAME: mesa-python-ci-artifacts needs: - debian/x86_64_build - debian-arm64-release diff --git a/src/gallium/drivers/virgl/ci/gitlab-ci-inc.yml b/src/gallium/drivers/virgl/ci/gitlab-ci-inc.yml index cfb41754c20..4535c47c721 100644 --- a/src/gallium/drivers/virgl/ci/gitlab-ci-inc.yml +++ b/src/gallium/drivers/virgl/ci/gitlab-ci-inc.yml @@ -37,7 +37,6 @@ variables: JOB_PRIORITY: 40 LAVA_S3_ARTIFACT_NAME: mesa-x86_64-default-release - S3_ARTIFACT_NAME: mesa-python-ci-artifacts needs: - debian/x86_64_test-gl - debian-release diff --git a/src/intel/ci/gitlab-ci-inc.yml b/src/intel/ci/gitlab-ci-inc.yml index 60a275ef601..638a2bc1fac 100644 --- a/src/intel/ci/gitlab-ci-inc.yml +++ b/src/intel/ci/gitlab-ci-inc.yml @@ -129,7 +129,6 @@ variables: JOB_PRIORITY: 40 LAVA_S3_ARTIFACT_NAME: mesa-x86_64-default-release - S3_ARTIFACT_NAME: mesa-python-ci-artifacts needs: - debian/x86_64_test-gl - debian-release @@ -451,7 +450,6 @@ LAVA_TAGS: "cbg-0" # Ensure that we are using the release build artifact LAVA_S3_ARTIFACT_NAME: mesa-x86_64-default-release - S3_ARTIFACT_NAME: mesa-python-ci-artifacts .iris-whl-traces-performance: extends: