From 215199af889209c110620ede24e3f40ad0d95758 Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Thu, 7 Aug 2025 13:47:06 +0200 Subject: [PATCH] ci/lava: Use lava-job-submitter from gfx-ci repo lava-job-submitter has been moved to a new repository: https://gitlab.freedesktop.org/gfx-ci/lava-job-submitter Switch to using the containers built in that repository. The new lava-trigger container already includes lava-job-submitter pre-installed, along with the new FDO CI bash helpers from ci-templates. Signed-off-by: Valentine Burley Part-of: --- .gitlab-ci/lava/gitlab-ci.yml | 21 +++++++++++--------- .gitlab-ci/lava/lava-submit.sh | 36 +++++++++++++++++----------------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci/lava/gitlab-ci.yml b/.gitlab-ci/lava/gitlab-ci.yml index 94de061ab7f..c7c73d31395 100644 --- a/.gitlab-ci/lava/gitlab-ci.yml +++ b/.gitlab-ci/lava/gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - LAVA_SSH_CLIENT_IMAGE: "${CI_REGISTRY_IMAGE}/alpine/x86_64_lava_ssh_client:${ALPINE_X86_64_LAVA_SSH_TAG}--${MESA_TEMPLATES_COMMIT}" + LAVA_SSH_CLIENT_IMAGE: registry.freedesktop.org/gfx-ci/lava-job-submitter/alpine/x86_64_lava_ssh_client:20250908-lava-ssh .lava-test: @@ -13,7 +13,7 @@ variables: # 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}" + image: registry.freedesktop.org/gfx-ci/lava-job-submitter/alpine/x86_64_lava-trigger:20250929-lava-timeout # 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. @@ -42,8 +42,17 @@ variables: S3_RESULTS_UPLOAD: "${JOB_ARTIFACTS_BASE}" PIGLIT_NO_WINDOW: 1 VISIBILITY_GROUP: "Collabora+fdo" + # Override the default `before_script` since we don't need to download + # setup-test-env.sh. + # The LAVA containers already include the necessary FDO CI bash helpers from + # ci-templates. + before_script: + - > + export SCRIPTS_DIR=$(mktemp -d) && + curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 -O --output-dir "${SCRIPTS_DIR}" "${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/lava/lava-submit.sh" + - eval "$S3_JWT_FILE_SCRIPT" script: - - /lava/lava-submit.sh + - . ${SCRIPTS_DIR}/lava-submit.sh artifacts: name: "${CI_PROJECT_NAME}_${CI_JOB_NAME_SLUG}" when: always @@ -59,12 +68,6 @@ variables: - curl -L --retry 4 -f --retry-connrefused --retry-delay 30 -s "https://${JOB_RESULTS_PATH}" | tar --warning=no-timestamp --zstd -x needs: - !reference [.required-for-hardware-jobs, needs] - - job: alpine/x86_64_lava_ssh_client - artifacts: false - optional: true - - job: alpine/x86_64_lava-trigger - artifacts: false - optional: true .lava-x86_64-test: extends: diff --git a/.gitlab-ci/lava/lava-submit.sh b/.gitlab-ci/lava/lava-submit.sh index 02cfd3fe06c..1075762d3c2 100755 --- a/.gitlab-ci/lava/lava-submit.sh +++ b/.gitlab-ci/lava/lava-submit.sh @@ -2,21 +2,18 @@ # 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 +# shellcheck disable=SC1090 +source "${FDO_CI_BASH_HELPERS}" -. "${SCRIPTS_DIR}/setup-test-env.sh" - -section_start prepare_rootfs "Preparing root filesystem" +fdo_log_section_start_collapsed prepare_rootfs "Preparing root filesystem" set -ex # If we run in the fork (not from mesa or Marge-bot), reuse mainline kernel and rootfs, if exist. -ROOTFS_URL="$(find_s3_project_artifact "$LAVA_ROOTFS_PATH")" || +ROOTFS_URL="$(fdo_find_s3_path "$LAVA_ROOTFS_PATH")" || { set +x - error "Sorry, I couldn't find a viable built path for ${LAVA_ROOTFS_PATH} in either mainline or a fork." >&2 + fdo_log_section_error "Sorry, I couldn't find a viable built path for ${LAVA_ROOTFS_PATH} in either mainline or a fork." >&2 echo "" >&2 echo "If you're working on CI, this probably means that you're missing a dependency:" >&2 echo "this job ran ahead of the job which was supposed to upload that artifact." >&2 @@ -31,15 +28,18 @@ ROOTFS_URL="$(find_s3_project_artifact "$LAVA_ROOTFS_PATH")" || rm -rf results mkdir results -filter_env_vars > dut-env-vars.sh +fdo_filter_env_vars > dut-env-vars.sh # Set SCRIPTS_DIR to point to the Mesa install we download for the DUT echo "export SCRIPTS_DIR='$CI_PROJECT_DIR/install'" >> dut-env-vars.sh -# Prepare env vars for upload. -section_switch variables "Environment variables passed through to device:" -cat dut-env-vars.sh +fdo_log_section_end prepare_rootfs -section_switch lava_submit "Submitting job for scheduling" +# Prepare env vars for upload. +fdo_log_section_start_collapsed variables "Environment variables passed through to device:" +cat dut-env-vars.sh +fdo_log_section_end variables + +fdo_log_section_start_collapsed lava_submit "Submitting job for scheduling" touch results/lava.log tail -f results/lava.log & @@ -73,7 +73,7 @@ if [ -n "${ANDROID_CTS_TAG:-}" ]; then LAVA_EXTRA_OVERLAYS+=( - append-overlay --name=android-cts - --url="$(find_s3_project_artifact "${DATA_STORAGE_PATH}/android-cts/${ANDROID_CTS_TAG}.tar.zst")" + --url="$(fdo_find_s3_path "${DATA_STORAGE_PATH}/android-cts/${ANDROID_CTS_TAG}.tar.zst")" --path="/" --format=tar --compression=zstd @@ -83,7 +83,7 @@ if [ -n "${FLUSTER_TAG:-}" ]; then LAVA_EXTRA_OVERLAYS+=( - append-overlay --name=vkd3d-proton - --url="$(find_s3_project_artifact "${DATA_STORAGE_PATH}/fluster/${FLUSTER_TAG}/vectors.tar.zst")" + --url="$(fdo_find_s3_path "${DATA_STORAGE_PATH}/fluster/${FLUSTER_TAG}/vectors.tar.zst")" --path="/" --format=tar --compression=zstd @@ -93,7 +93,7 @@ if [ -n "${VKD3D_PROTON_TAG:-}" ]; then LAVA_EXTRA_OVERLAYS+=( - append-overlay --name=vkd3d-proton - --url="$(find_s3_project_artifact "${DATA_STORAGE_PATH}/vkd3d-proton/${VKD3D_PROTON_TAG}/${MESA_IMAGE_PATH}/vkd3d-proton.tar.zst")" + --url="$(fdo_find_s3_path "${DATA_STORAGE_PATH}/vkd3d-proton/${VKD3D_PROTON_TAG}/${MESA_IMAGE_PATH}/vkd3d-proton.tar.zst")" --path="/" --format=tar --compression=zstd @@ -126,7 +126,7 @@ if [ -n "${S3_ANDROID_ARTIFACT_NAME:-}" ]; then ) fi -PYTHONPATH=/ /lava/lava_job_submitter.py \ +lava-job-submitter \ --farm "${FARM}" \ --device-type "${DEVICE_TYPE}" \ --boot-method "${BOOT_METHOD}" \ @@ -147,7 +147,7 @@ PYTHONPATH=/ /lava/lava_job_submitter.py \ --ssh-client-image "${LAVA_SSH_CLIENT_IMAGE}" \ --project-dir "${CI_PROJECT_DIR}" \ --project-name "${CI_PROJECT_NAME}" \ - --starting-section "${CURRENT_SECTION}" \ + --starting-section lava_submit \ --job-submitted-at "${CI_JOB_STARTED_AT}" \ - append-overlay \ --name=mesa-build \