2 # Cancel job if a newer commit is pushed to the same branch
5 GIT_STRATEGY: none # testing doesn't build anything from source
7 - !reference [default, before_script]
8 # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
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"
16 name: "mesa_${CI_JOB_NAME}"
21 # Cancel job if a newer commit is pushed to the same branch
25 - .use-debian/x86_build
30 - git ls-files */{lib,app}.rs | xargs rustfmt --check
35 - .use-debian/x86_test-gl
43 - .use-debian/x86_test-vk
51 - .use-debian/x86_test-gl
58 name: "mesa_${CI_JOB_NAME}"
60 - results/vkd3d-proton.log
62 - ./install/vkd3d-proton/run.sh
66 name: "mesa_${CI_JOB_NAME}"
70 junit: results/junit.xml
73 HWCI_TEST_SCRIPT: "/install/piglit/piglit-runner.sh"
75 - install/piglit/piglit-runner.sh
82 name: "mesa_${CI_JOB_NAME}"
84 junit: results/junit.xml
88 - results/*.shader_cache
90 PIGLIT_REPLAY_EXTRA_ARGS: --keep-image --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_bucket=mesa-tracie-public --jwt-file=${CI_JOB_JWT_FILE}
92 - echo -e "\e[0Ksection_start:$(date +%s):variables[collapsed=true]\r\e[0KVariables passed through:"
93 - install/common/generate-env.sh
94 - echo -e "\e[0Ksection_end:$(date +%s):variables\r\e[0K"
95 - install/piglit/piglit-traces.sh
99 - ./install/deqp-runner.sh
102 - results/*.shader_cache
104 junit: results/junit.xml
115 HWCI_TEST_SCRIPT: "/install/skqp-runner.sh"
119 - ./install/fossilize-runner.sh
122 name: "mesa_${CI_JOB_NAME}"
129 # Cancel job if a newer commit is pushed to the same branch
132 - !reference [default, before_script]
133 # Use this instead of gitlab's artifacts download because it hits packet.net
134 # instead of fd.o. Set FDO_HTTP_CACHE_URI to an http cache for your test lab to
135 # improve it even more (see https://docs.mesa3d.org/ci/bare-metal.html for
137 - echo -e "\e[0Ksection_start:$(date +%s):artifacts_download[collapsed=true]\r\e[0KDownloading artifacts from minio"
138 - wget ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.zst -S --progress=dot:giga -O- | tar --zstd -x
139 - echo -e "\e[0Ksection_end:$(date +%s):artifacts_download\r\e[0K"
142 name: "mesa_${CI_JOB_NAME}"
147 - results/*.shader_cache
149 junit: results/junit.xml
151 # ARM testing of bare-metal boards attached to an x86 gitlab-runner system
152 .baremetal-test-armhf:
155 - .use-debian/arm_test
157 BM_ROOTFS: /rootfs-armhf
158 MINIO_ARTIFACT_NAME: mesa-armhf
164 # ARM64 testing of bare-metal boards attached to an x86 gitlab-runner system
165 .baremetal-test-arm64:
168 - .use-debian/arm_test
170 BM_ROOTFS: /rootfs-arm64
171 MINIO_ARTIFACT_NAME: mesa-arm64
177 # ARM64 testing of bare-metal boards attached to an x86 gitlab-runner system, using an asan mesa build
178 .baremetal-arm64-asan-test:
181 - .use-debian/arm_test
183 DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.6:/install/lib/libdlclose-skip.so"
184 MINIO_ARTIFACT_NAME: mesa-arm64-asan
187 - job: debian-arm64-asan
190 .baremetal-deqp-test:
192 HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
193 FDO_CI_CONCURRENT: 0 # Default to number of CPUs
195 # For Valve's bare-metal testing farm jobs.
197 # It would be nice to use ci-templates within Mesa CI for this job's
198 # image:, but the integration is not possible for the current
199 # use-case. Within this job, two containers are managed. 1) the
200 # gitlab runner container from which the job is submitted to the
201 # DUT, and 2) the test container (e.g. debian/x86_test-vk) within
202 # which the test cases will run on the DUT. Since ci-templates and
203 # the associated image setting macros in this file rely on variables
204 # like FDO_DISTRIBUTION_TAG for *the* image, there is no way to
205 # depend on more than one image per job. So, the job container is
206 # built as part of the CI in the boot2container project.
207 image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2022-03-03.2
210 # No need by default to pull the whole repo
212 # boot2container initrd configuration parameters.
213 B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/144/download' # 5.17.1
214 B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.8/downloads/initramfs.linux_amd64.cpio.xz'
215 B2C_JOB_SUCCESS_REGEX: '\[.*\]: Execution is over, pipeline status: 0\r$'
216 B2C_JOB_WARN_REGEX: '\*ERROR\* ring .* timeout, but soft recovered'
218 B2C_POWEROFF_DELAY: 15
219 B2C_SESSION_END_REGEX: '^.*It''s now safe to turn off your computer\r$'
220 B2C_SESSION_REBOOT_REGEX: '(GPU hang detected!|\*ERROR\* ring [^\s]+ timeout(?!, but soft recovered)|The CS has been cancelled because the context is lost)'
221 B2C_TIMEOUT_BOOT_MINUTES: 45
222 B2C_TIMEOUT_BOOT_RETRIES: 1
223 B2C_TIMEOUT_FIRST_MINUTES: 5
224 B2C_TIMEOUT_FIRST_RETRIES: 3
225 B2C_TIMEOUT_MINUTES: 2
226 B2C_TIMEOUT_OVERALL_MINUTES: 90
227 B2C_TIMEOUT_RETRIES: 0
229 # As noted in the top description, we make a distinction between the
230 # container used by gitlab-runner to queue the work, and the container
231 # used by the DUTs/test machines. To make this distinction quite clear,
232 # we rename the MESA_IMAGE variable into IMAGE_UNDER_TEST.
233 IMAGE_UNDER_TEST: "$MESA_IMAGE"
235 INSTALL_TARBALL_NAME: "install.tar"
236 INSTALL_TARBALL: "./artifacts/${INSTALL_TARBALL_NAME}"
237 CI_B2C_ARTIFACTS: "./artifacts/b2c"
238 CI_COMMON_SCRIPTS: "./artifacts/ci-common"
239 GENERATE_ENV_SCRIPT: "${CI_COMMON_SCRIPTS}/generate-env.sh"
240 B2C_JOB_TEMPLATE: "${CI_B2C_ARTIFACTS}/b2c.yml.jinja2.jinja2"
241 JOB_FOLDER: "job_folder"
243 # We don't want the tarball unpacking of .test, but will take the JWT bits.
244 - !reference [default, before_script]
248 # Useful as a hook point for runner admins. You may edit the
249 # config.toml for the Gitlab runner and use a bind-mount to
250 # populate the hook script with some executable commands. This
251 # allows quicker feedback than resubmitting pipelines and
252 # potentially having to wait for a debug build of Mesa to
254 if [ -x /runner-before-script.sh ]; then
255 echo "Executing runner before-script hook..."
256 sh /runner-before-script.sh
257 if [ $? -ne 0 ]; then
258 echo "Runner hook failed, goodbye"
263 [ -s "$INSTALL_TARBALL" ] || exit 1
264 [ -d "$CI_B2C_ARTIFACTS" ] || exit 1
265 [ -d "$CI_COMMON_SCRIPTS" ] || exit 1
268 B2C_TEST_SCRIPT="bash -c 'source ./set-job-env-vars.sh; tar xf ${INSTALL_TARBALL_NAME}; ${B2C_TEST_SCRIPT}'"
270 # The Valve CI gateway receives jobs in a YAML format. Create a
271 # job description from the CI environment.
272 python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py \
273 --ci-job-id "${CI_JOB_ID}" \
274 --container-cmd "${B2C_TEST_SCRIPT}" \
275 --initramfs-url "${B2C_INITRAMFS_URL}" \
276 --job-success-regex "${B2C_JOB_SUCCESS_REGEX}" \
277 --job-warn-regex "${B2C_JOB_WARN_REGEX}" \
278 --kernel-url "${B2C_KERNEL_URL}" \
279 --log-level "${B2C_LOG_LEVEL}" \
280 --poweroff-delay "${B2C_POWEROFF_DELAY}" \
281 --session-end-regex "${B2C_SESSION_END_REGEX}" \
282 --session-reboot-regex "${B2C_SESSION_REBOOT_REGEX}" \
283 --tags "${CI_RUNNER_TAGS}" \
284 --template "${B2C_JOB_TEMPLATE}" \
285 --timeout-boot-minutes "${B2C_TIMEOUT_BOOT_MINUTES}" \
286 --timeout-boot-retries "${B2C_TIMEOUT_BOOT_RETRIES}" \
287 --timeout-first-minutes "${B2C_TIMEOUT_FIRST_MINUTES}" \
288 --timeout-first-retries "${B2C_TIMEOUT_FIRST_RETRIES}" \
289 --timeout-minutes "${B2C_TIMEOUT_MINUTES}" \
290 --timeout-overall-minutes "${B2C_TIMEOUT_OVERALL_MINUTES}" \
291 --timeout-retries "${B2C_TIMEOUT_RETRIES}" \
292 --job-volume-exclusions "${B2C_JOB_VOLUME_EXCLUSIONS}" \
293 --local-container "${IMAGE_UNDER_TEST}" \
294 ${B2C_EXTRA_VOLUME_ARGS} \
295 --working-dir "$CI_PROJECT_DIR"
299 rm -rf ${JOB_FOLDER} || true
300 mkdir -v ${JOB_FOLDER}
301 # Create a script to regenerate the CI environment when this job
302 # begins running on the remote DUT.
304 "$CI_COMMON_SCRIPTS"/generate-env.sh > ${JOB_FOLDER}/set-job-env-vars.sh
305 chmod +x ${JOB_FOLDER}/set-job-env-vars.sh
306 echo "Variables passed through:"
307 cat ${JOB_FOLDER}/set-job-env-vars.sh
308 echo "export CI_JOB_JWT=${CI_JOB_JWT}" >> ${JOB_FOLDER}/set-job-env-vars.sh
311 # Copy the mesa install tarball to the job folder, for later extraction
312 mv "${INSTALL_TARBALL}" "${JOB_FOLDER}"
316 echo "$1" | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
319 # Submit the job to Valve's CI gateway service with the CI
320 # provisioned job_folder.
321 env PYTHONUNBUFFERED=1 executorctl \
322 run -w b2c.yml.jinja2 -j $(slugify "$CI_JOB_NAME") -s ${JOB_FOLDER}
325 # Anything our job places in results/ will be collected by the
326 # Gitlab coordinator for status presentation. results/junit.xml
327 # will be parsed by the UI for more detailed explanations of
331 name: "mesa_${CI_JOB_NAME}"
333 - ${JOB_FOLDER}/results
335 junit: ${JOB_FOLDER}/results/junit.xml
339 - .use-debian/x86_test-vk
347 - .use-debian/x86_test-gl