1.test: 2 # Cancel job if a newer commit is pushed to the same branch 3 interruptible: true 4 variables: 5 GIT_STRATEGY: none # testing doesn't build anything from source 6 before_script: 7 - !reference [default, before_script] 8 # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY 9 - rm -rf install 10 - tar -xf artifacts/install.tar 11 - echo -e "\e[0Ksection_start:$(date +%s):ldd_section[collapsed=true]\r\e[0KChecking ldd on driver build" 12 - LD_LIBRARY_PATH=install/lib find install/lib -name "*.so" -print -exec ldd {} \; 13 - echo -e "\e[0Ksection_end:$(date +%s):ldd_section\r\e[0K" 14 artifacts: 15 when: always 16 name: "mesa_${CI_JOB_NAME}" 17 paths: 18 - results/ 19 20.test-gl: 21 extends: 22 - .test 23 - .use-debian/x86_test-gl 24 needs: 25 - debian/x86_test-gl 26 - debian-testing 27 28.test-vk: 29 extends: 30 - .test 31 - .use-debian/x86_test-vk 32 needs: 33 - debian-testing 34 - debian/x86_test-vk 35 36.test-cl: 37 extends: 38 - .test 39 - .use-debian/x86_test-gl 40 needs: 41 - debian/x86_test-gl 42 - debian-clover-testing 43 44.vkd3d-proton-test: 45 artifacts: 46 when: on_failure 47 name: "mesa_${CI_JOB_NAME}" 48 paths: 49 - results/vkd3d-proton.log 50 script: 51 - ./install/vkd3d-proton/run.sh 52 53.piglit-test: 54 artifacts: 55 name: "mesa_${CI_JOB_NAME}" 56 paths: 57 - results 58 reports: 59 junit: results/junit.xml 60 variables: 61 PIGLIT_NO_WINDOW: 1 62 HWCI_TEST_SCRIPT: "/install/piglit/piglit-runner.sh" 63 script: 64 - install/piglit/piglit-runner.sh 65 66.piglit-traces-test: 67 extends: 68 - .piglit-test 69 cache: 70 key: ${CI_JOB_NAME} 71 paths: 72 - replayer-db/ 73 artifacts: 74 when: on_failure 75 name: "mesa_${CI_JOB_NAME}" 76 reports: 77 junit: results/junit.xml 78 paths: 79 - results/summary/ 80 - results/*.txt 81 variables: 82 PIGLIT_REPLAY_EXTRA_ARGS: --keep-image --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_bucket=mesa-tracie-public --jwt-file=${CI_JOB_JWT_FILE} 83 script: 84 - install/piglit/piglit-traces.sh 85 86.deqp-test: 87 script: 88 - ./install/deqp-runner.sh 89 artifacts: 90 exclude: 91 - results/*.shader_cache 92 reports: 93 junit: results/junit.xml 94 95.deqp-test-vk: 96 extends: 97 - .deqp-test 98 variables: 99 DEQP_VER: vk 100 101.skqp-test: 102 variables: 103 HWCI_START_XORG: 1 104 HWCI_TEST_SCRIPT: "/install/skqp-runner.sh" 105 106.fossilize-test: 107 script: 108 - ./install/fossilize-runner.sh 109 artifacts: 110 when: on_failure 111 name: "mesa_${CI_JOB_NAME}" 112 paths: 113 - results/ 114 115.baremetal-test: 116 extends: 117 - .test 118 # Cancel job if a newer commit is pushed to the same branch 119 interruptible: true 120 before_script: 121 - !reference [default, before_script] 122 # Use this instead of gitlab's artifacts download because it hits packet.net 123 # instead of fd.o. Set FDO_HTTP_CACHE_URI to an http cache for your test lab to 124 # improve it even more (see https://docs.mesa3d.org/ci/bare-metal.html for 125 # setup). 126 - echo -e "\e[0Ksection_start:$(date +%s):artifacts_download[collapsed=true]\r\e[0KDownloading artifacts from minio" 127 - wget ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.gz -S --progress=dot:giga -O- | tar -xz 128 - echo -e "\e[0Ksection_end:$(date +%s):artifacts_download\r\e[0K" 129 artifacts: 130 when: always 131 name: "mesa_${CI_JOB_NAME}" 132 paths: 133 - results/ 134 - serial*.txt 135 exclude: 136 - results/*.shader_cache 137 reports: 138 junit: results/junit.xml 139 140# ARM testing of bare-metal boards attached to an x86 gitlab-runner system 141.baremetal-test-armhf: 142 extends: 143 - .baremetal-test 144 - .use-debian/arm_test 145 variables: 146 BM_ROOTFS: /rootfs-armhf 147 MINIO_ARTIFACT_NAME: mesa-armhf 148 needs: 149 - debian/arm_test 150 - job: debian-armhf 151 artifacts: false 152 153# ARM64 testing of bare-metal boards attached to an x86 gitlab-runner system 154.baremetal-test-arm64: 155 extends: 156 - .baremetal-test 157 - .use-debian/arm_test 158 variables: 159 BM_ROOTFS: /rootfs-arm64 160 MINIO_ARTIFACT_NAME: mesa-arm64 161 needs: 162 - debian/arm_test 163 - job: debian-arm64 164 artifacts: false 165 166# ARM64 testing of bare-metal boards attached to an x86 gitlab-runner system, using an asan mesa build 167.baremetal-arm64-asan-test: 168 extends: 169 - .baremetal-test 170 - .use-debian/arm_test 171 variables: 172 DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.6:/install/lib/libdlclose-skip.so" 173 MINIO_ARTIFACT_NAME: mesa-arm64-asan 174 needs: 175 - debian/arm_test 176 - job: debian-arm64-asan 177 artifacts: false 178 179.baremetal-deqp-test: 180 variables: 181 HWCI_TEST_SCRIPT: "/install/deqp-runner.sh" 182 FDO_CI_CONCURRENT: 0 # Default to number of CPUs 183 184.baremetal-skqp-test: 185 variables: 186 HWCI_START_XORG: 1 187 HWCI_TEST_SCRIPT: "/install/skqp-runner.sh" 188 189# For Valve's bare-metal testing farm jobs. 190.b2c-test: 191 # It would be nice to use ci-templates within Mesa CI for this job's 192 # image:, but the integration is not possible for the current 193 # use-case. Within this job, two containers are managed. 1) the 194 # gitlab runner container from which the job is submitted to the 195 # DUT, and 2) the test container (e.g. debian/x86_test-vk) within 196 # which the test cases will run on the DUT. Since ci-templates and 197 # the associated image setting macros in this file rely on variables 198 # like FDO_DISTRIBUTION_TAG for *the* image, there is no way to 199 # depend on more than one image per job. So, the job container is 200 # built as part of the CI in the boot2container project. 201 image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2022-03-03.2 202 timeout: 1h 40m 203 variables: 204 # No need by default to pull the whole repo 205 GIT_STRATEGY: none 206 # boot2container initrd configuration parameters. 207 B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/144/download' # 5.17.1 208 B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.6/downloads/initramfs.linux_amd64.cpio.xz' 209 B2C_JOB_SUCCESS_REGEX: '\[.*\]: Execution is over, pipeline status: 0\r$' 210 B2C_JOB_WARN_REGEX: '\*ERROR\* ring .* timeout, but soft recovered' 211 B2C_LOG_LEVEL: 6 212 B2C_POWEROFF_DELAY: 15 213 B2C_SESSION_END_REGEX: '^.*It''s now safe to turn off your computer\r$' 214 B2C_SESSION_REBOOT_REGEX: '(GPU hang detected!|\*ERROR\* ring [^\s]+ timeout(?!, but soft recovered)|The CS has been cancelled because the context is lost)' 215 B2C_TIMEOUT_BOOT_MINUTES: 45 216 B2C_TIMEOUT_BOOT_RETRIES: 1 217 B2C_TIMEOUT_FIRST_MINUTES: 5 218 B2C_TIMEOUT_FIRST_RETRIES: 3 219 B2C_TIMEOUT_MINUTES: 2 220 B2C_TIMEOUT_OVERALL_MINUTES: 90 221 B2C_TIMEOUT_RETRIES: 0 222 223 # As noted in the top description, we make a distinction between the 224 # container used by gitlab-runner to queue the work, and the container 225 # used by the DUTs/test machines. To make this distinction quite clear, 226 # we rename the MESA_IMAGE variable into IMAGE_UNDER_TEST. 227 IMAGE_UNDER_TEST: "$MESA_IMAGE" 228 229 INSTALL_TARBALL_NAME: "install.tar" 230 INSTALL_TARBALL: "./artifacts/${INSTALL_TARBALL_NAME}" 231 CI_B2C_ARTIFACTS: "./artifacts/b2c" 232 CI_COMMON_SCRIPTS: "./artifacts/ci-common" 233 GENERATE_ENV_SCRIPT: "${CI_COMMON_SCRIPTS}/generate-env.sh" 234 B2C_JOB_TEMPLATE: "${CI_B2C_ARTIFACTS}/b2c.yml.jinja2.jinja2" 235 JOB_FOLDER: "job_folder" 236 before_script: 237 # We don't want the tarball unpacking of .test, but will take the JWT bits. 238 - !reference [default, before_script] 239 - | 240 set -x 241 242 # Useful as a hook point for runner admins. You may edit the 243 # config.toml for the Gitlab runner and use a bind-mount to 244 # populate the hook script with some executable commands. This 245 # allows quicker feedback than resubmitting pipelines and 246 # potentially having to wait for a debug build of Mesa to 247 # complete. 248 if [ -x /runner-before-script.sh ]; then 249 echo "Executing runner before-script hook..." 250 sh /runner-before-script.sh 251 if [ $? -ne 0 ]; then 252 echo "Runner hook failed, goodbye" 253 exit $? 254 fi 255 fi 256 257 [ -s "$INSTALL_TARBALL" ] || exit 1 258 [ -d "$CI_B2C_ARTIFACTS" ] || exit 1 259 [ -d "$CI_COMMON_SCRIPTS" ] || exit 1 260 261 262 B2C_TEST_SCRIPT="bash -c 'source ./set-job-env-vars.sh; tar xf ${INSTALL_TARBALL_NAME}; ${B2C_TEST_SCRIPT}'" 263 264 # The Valve CI gateway receives jobs in a YAML format. Create a 265 # job description from the CI environment. 266 python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py \ 267 --ci-job-id "${CI_JOB_ID}" \ 268 --container-cmd "${B2C_TEST_SCRIPT}" \ 269 --initramfs-url "${B2C_INITRAMFS_URL}" \ 270 --job-success-regex "${B2C_JOB_SUCCESS_REGEX}" \ 271 --job-warn-regex "${B2C_JOB_WARN_REGEX}" \ 272 --kernel-url "${B2C_KERNEL_URL}" \ 273 --log-level "${B2C_LOG_LEVEL}" \ 274 --poweroff-delay "${B2C_POWEROFF_DELAY}" \ 275 --session-end-regex "${B2C_SESSION_END_REGEX}" \ 276 --session-reboot-regex "${B2C_SESSION_REBOOT_REGEX}" \ 277 --tags "${CI_RUNNER_TAGS}" \ 278 --template "${B2C_JOB_TEMPLATE}" \ 279 --timeout-boot-minutes "${B2C_TIMEOUT_BOOT_MINUTES}" \ 280 --timeout-boot-retries "${B2C_TIMEOUT_BOOT_RETRIES}" \ 281 --timeout-first-minutes "${B2C_TIMEOUT_FIRST_MINUTES}" \ 282 --timeout-first-retries "${B2C_TIMEOUT_FIRST_RETRIES}" \ 283 --timeout-minutes "${B2C_TIMEOUT_MINUTES}" \ 284 --timeout-overall-minutes "${B2C_TIMEOUT_OVERALL_MINUTES}" \ 285 --timeout-retries "${B2C_TIMEOUT_RETRIES}" \ 286 --job-volume-exclusions "${B2C_JOB_VOLUME_EXCLUSIONS}" \ 287 --local-container "${IMAGE_UNDER_TEST}" \ 288 ${B2C_EXTRA_VOLUME_ARGS} \ 289 --working-dir "$CI_PROJECT_DIR" 290 291 cat b2c.yml.jinja2 292 293 rm -rf ${JOB_FOLDER} || true 294 mkdir -v ${JOB_FOLDER} 295 # Create a script to regenerate the CI environment when this job 296 # begins running on the remote DUT. 297 set +x 298 "$CI_COMMON_SCRIPTS"/generate-env.sh > ${JOB_FOLDER}/set-job-env-vars.sh 299 chmod +x ${JOB_FOLDER}/set-job-env-vars.sh 300 echo "Variables passed through:" 301 cat ${JOB_FOLDER}/set-job-env-vars.sh 302 echo "export CI_JOB_JWT=${CI_JOB_JWT}" >> ${JOB_FOLDER}/set-job-env-vars.sh 303 set -x 304 305 # Copy the mesa install tarball to the job folder, for later extraction 306 mv "${INSTALL_TARBALL}" "${JOB_FOLDER}" 307 308 script: | 309 slugify () { 310 echo "$1" | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z 311 } 312 313 # Submit the job to Valve's CI gateway service with the CI 314 # provisioned job_folder. 315 env PYTHONUNBUFFERED=1 executorctl \ 316 run -w b2c.yml.jinja2 -j $(slugify "$CI_JOB_NAME") -s ${JOB_FOLDER} 317 318 ls -l 319 # Anything our job places in results/ will be collected by the 320 # Gitlab coordinator for status presentation. results/junit.xml 321 # will be parsed by the UI for more detailed explanations of 322 # test execution. 323 artifacts: 324 when: always 325 name: "mesa_${CI_JOB_NAME}" 326 paths: 327 - ${JOB_FOLDER}/results 328 reports: 329 junit: ${JOB_FOLDER}/results/junit.xml 330 331.b2c-test-vk: 332 extends: 333 - .use-debian/x86_test-vk 334 - .b2c-test 335 needs: 336 - debian/x86_test-vk 337 - debian-testing 338 339.b2c-test-gl: 340 extends: 341 - .use-debian/x86_test-gl 342 - .b2c-test 343 needs: 344 - debian/x86_test-gl 345 - debian-testing 346