| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 |
|
| 6 | |
| 7 | source "${FDO_CI_BASH_HELPERS}"
|
| 8 |
|
| 9 | fdo_log_section_start_collapsed prepare_rootfs "Preparing root filesystem"
|
| 10 |
|
| 11 | set -ex
|
| 12 |
|
| 13 | |
| 14 | ROOTFS_URL="$(fdo_find_s3_path "$LAVA_ROOTFS_PATH")" ||
|
| 15 | {
|
| 16 | set +x
|
| 17 | fdo_log_section_error "Sorry, I couldn't find a viable built path for ${LAVA_ROOTFS_PATH} in either mainline or a fork." >&2
|
| 18 | echo "" >&2
|
| 19 | echo "If you're working on CI, this probably means that you're missing a dependency:" >&2
|
| 20 | echo "this job ran ahead of the job which was supposed to upload that artifact." >&2
|
| 21 | echo "" >&2
|
| 22 | echo "If you aren't working on CI, please ping @mesa/ci-helpers to see if we can help." >&2
|
| 23 | echo "" >&2
|
| 24 | echo "This job is going to fail, because I can't find the resources I need. Sorry." >&2
|
| 25 | set -x
|
| 26 | exit 1
|
| 27 | }
|
| 28 |
|
| 29 | rm -rf results
|
| 30 | mkdir results
|
| 31 |
|
| 32 | fdo_filter_env_vars > dut-env-vars.sh
|
| 33 | |
| 34 | echo "export SCRIPTS_DIR='$CI_PROJECT_DIR/install'" >> dut-env-vars.sh
|
| 35 |
|
| 36 | fdo_log_section_end prepare_rootfs
|
| 37 |
|
| 38 | |
| 39 | fdo_log_section_start_collapsed variables "Environment variables passed through to device:"
|
| 40 | cat dut-env-vars.sh
|
| 41 | fdo_log_section_end variables
|
| 42 |
|
| 43 | fdo_log_section_start_collapsed lava_submit "Submitting job for scheduling"
|
| 44 |
|
| 45 | touch results/lava.log
|
| 46 | tail -f results/lava.log &
|
| 47 | |
| 48 | |
| 49 | set -x
|
| 50 |
|
| 51 | |
| 52 | LAVA_EXTRA_OVERLAYS=()
|
| 53 | if [ -n "${LAVA_FIRMWARE:-}" ]; then
|
| 54 | for fw in $LAVA_FIRMWARE; do
|
| 55 | LAVA_EXTRA_OVERLAYS+=(
|
| 56 | - append-overlay
|
| 57 | --name=linux-firmware
|
| 58 | --url="https://${S3_BASE_PATH}/${FIRMWARE_REPO}/${fw}-${FIRMWARE_TAG}.tar"
|
| 59 | --path="/"
|
| 60 | --format=tar
|
| 61 | )
|
| 62 | done
|
| 63 | fi
|
| 64 | LAVA_EXTRA_OVERLAYS+=(
|
| 65 | - append-overlay \
|
| 66 | --name=kernel-build \
|
| 67 | --url="${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${DEBIAN_ARCH}/kernel-files.tar.zst" \
|
| 68 | --compression=zstd \
|
| 69 | --path="${CI_PROJECT_DIR}" \
|
| 70 | --format=tar \
|
| 71 | )
|
| 72 |
|
| 73 | lava-job-submitter \
|
| 74 | --farm "${FARM}" \
|
| 75 | --device-type "${DEVICE_TYPE}" \
|
| 76 | --boot-method "${BOOT_METHOD}" \
|
| 77 | --job-timeout-min $((CI_JOB_TIMEOUT/60 - 5)) \
|
| 78 | --dump-yaml \
|
| 79 | --pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \
|
| 80 | --rootfs-url "${ROOTFS_URL}" \
|
| 81 | --kernel-url-prefix "https://${PIPELINE_ARTIFACTS_BASE}/${DEBIAN_ARCH}" \
|
| 82 | --dtb-filename "${DTB}" \
|
| 83 | --env-file dut-env-vars.sh \
|
| 84 | --jwt-file "${S3_JWT_FILE}" \
|
| 85 | --kernel-image-name "${KERNEL_IMAGE_NAME}" \
|
| 86 | --kernel-image-type "${KERNEL_IMAGE_TYPE}" \
|
| 87 | --visibility-group "${VISIBILITY_GROUP}" \
|
| 88 | --lava-tags "${LAVA_TAGS}" \
|
| 89 | --mesa-job-name "$CI_JOB_NAME" \
|
| 90 | --structured-log-file "results/lava_job_detail.json" \
|
| 91 | --ssh-client-image "${LAVA_SSH_CLIENT_IMAGE}" \
|
| 92 | --project-dir "${CI_PROJECT_DIR}" \
|
| 93 | --project-name "${CI_PROJECT_NAME}" \
|
| 94 | --starting-section lava_submit \
|
| 95 | --job-submitted-at "${CI_JOB_STARTED_AT}" \
|
| 96 | "${LAVA_EXTRA_OVERLAYS[@]}" \
|
| 97 | - submit \
|
| 98 | >> results/lava.log
|