1#!/bin/bash 2# SPDX-License-Identifier: MIT 3 4set -e 5set -x 6 7# Try to use the kernel and rootfs built in mainline first, so we're more 8# likely to hit cache 9if curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -s "https://${BASE_SYSTEM_MAINLINE_HOST_PATH}/done"; then 10 BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_MAINLINE_HOST_PATH}" 11else 12 BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_FORK_HOST_PATH}" 13fi 14 15rm -rf results 16mkdir -p results/job-rootfs-overlay/ 17 18cp artifacts/ci-common/capture-devcoredump.sh results/job-rootfs-overlay/ 19cp artifacts/ci-common/init-*.sh results/job-rootfs-overlay/ 20cp artifacts/ci-common/intel-gpu-freq.sh results/job-rootfs-overlay/ 21cp "$SCRIPTS_DIR"/setup-test-env.sh results/job-rootfs-overlay/ 22 23# Prepare env vars for upload. 24section_start variables "Variables passed through:" 25KERNEL_IMAGE_BASE="https://${BASE_SYSTEM_HOST_PATH}" \ 26 artifacts/ci-common/generate-env.sh | tee results/job-rootfs-overlay/set-job-env-vars.sh 27section_end variables 28 29tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ . 30ci-fairy s3cp --token-file "${S3_JWT_FILE}" job-rootfs-overlay.tar.gz "https://${JOB_ROOTFS_OVERLAY_PATH}" 31 32touch results/lava.log 33tail -f results/lava.log & 34 35PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \ 36 submit \ 37 --dump-yaml \ 38 --pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \ 39 --rootfs-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \ 40 --kernel-url-prefix "https://${PIPELINE_ARTIFACTS_BASE}/${DEBIAN_ARCH}" \ 41 --build-url "${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${DEBIAN_ARCH}/kernel-files.tar.zst" \ 42 --job-rootfs-overlay-url "${FDO_HTTP_CACHE_URI:-}https://${JOB_ROOTFS_OVERLAY_PATH}" \ 43 --job-timeout-min ${JOB_TIMEOUT:-80} \ 44 --first-stage-init artifacts/ci-common/init-stage1.sh \ 45 --ci-project-dir "${CI_PROJECT_DIR}" \ 46 --device-type "${DEVICE_TYPE}" \ 47 --farm "${FARM}" \ 48 --dtb-filename "${DTB}" \ 49 --jwt-file "${S3_JWT_FILE}" \ 50 --kernel-image-name "${KERNEL_IMAGE_NAME}" \ 51 --kernel-image-type "${KERNEL_IMAGE_TYPE}" \ 52 --boot-method "${BOOT_METHOD}" \ 53 --visibility-group "${VISIBILITY_GROUP}" \ 54 --lava-tags "${LAVA_TAGS}" \ 55 --mesa-job-name "$CI_JOB_NAME" \ 56 --structured-log-file "results/lava_job_detail.json" \ 57 --ssh-client-image "${LAVA_SSH_CLIENT_IMAGE}" \ 58 >> results/lava.log 59