Compare commits
175 Commits
mesa-24.0.
...
mesa-23.3.
Author | SHA1 | Date | |
---|---|---|---|
|
1fbdd37d4c | ||
|
421a8aaff1 | ||
|
dced0dba02 | ||
|
3ff4768692 | ||
|
54f93b1788 | ||
|
2525258917 | ||
|
94ad18d1e7 | ||
|
3ed7b95a55 | ||
|
dd56f591e5 | ||
|
c03abd2d9f | ||
|
53bafbe4fd | ||
|
b52742c018 | ||
|
090160db3a | ||
|
5e1fe5d0fd | ||
|
2d4868629f | ||
|
c73c7c0b0b | ||
|
ff6ed814f7 | ||
|
142c333748 | ||
|
c05aadcf25 | ||
|
ac66a49ba6 | ||
|
ab01f44513 | ||
|
0f94431922 | ||
|
4e9ef47839 | ||
|
16361af817 | ||
|
1a19815165 | ||
|
0b3f2e02fb | ||
|
3db740ff6c | ||
|
62455a9a25 | ||
|
ef07bc116e | ||
|
f62a7df6d1 | ||
|
a593181819 | ||
|
0ac2529959 | ||
|
64dee1015c | ||
|
5f12ed0774 | ||
|
c972359d41 | ||
|
317998e30f | ||
|
f80e96eb26 | ||
|
402553152f | ||
|
6e218edda5 | ||
|
5542b17f72 | ||
|
1a238bece9 | ||
|
c573f2437d | ||
|
61bd4b332b | ||
|
e8c975a642 | ||
|
dd46e0b6d3 | ||
|
5952462ecf | ||
|
0ecb0ec428 | ||
|
4c0233497b | ||
|
4611aef8a8 | ||
|
313457b66e | ||
|
f12636cecf | ||
|
178c046b9e | ||
|
a600a58f89 | ||
|
0960a0c5dd | ||
|
dbb2f6ed66 | ||
|
0680995b18 | ||
|
b1833834dd | ||
|
73b6b7497e | ||
|
f56bb3ec4b | ||
|
85c0b6281c | ||
|
2b38d1451e | ||
|
e194c6b9ba | ||
|
bbf099223e | ||
|
828b3966fa | ||
|
7cf359fb57 | ||
|
16ed2f180c | ||
|
eb9f7db980 | ||
|
3902e9302d | ||
|
12ab5dfd52 | ||
|
a28ea69d0a | ||
|
c6a9afc57a | ||
|
81ab4a3a01 | ||
|
30135c2a89 | ||
|
193256f9e7 | ||
|
8d9fa8ef99 | ||
|
e59c24f6b8 | ||
|
928e9db008 | ||
|
65109bc8ac | ||
|
41b7bd398c | ||
|
9d8e3aac70 | ||
|
b8112ed6db | ||
|
f30bd0074e | ||
|
765cb46e2d | ||
|
4d887245b9 | ||
|
b419916e7f | ||
|
43540839e7 | ||
|
ae337176ef | ||
|
c531ae3c80 | ||
|
1357b74292 | ||
|
cf3bd8bedc | ||
|
45368572c8 | ||
|
b328f01942 | ||
|
984d8051ef | ||
|
f103f773b6 | ||
|
3294d74e20 | ||
|
1371823a17 | ||
|
6d1b7d90d1 | ||
|
1c1382b304 | ||
|
2872c824bc | ||
|
a317466914 | ||
|
b03733fc6b | ||
|
d0d8b3508d | ||
|
ebbecb9d52 | ||
|
7afb7e9a42 | ||
|
28e36118af | ||
|
35fea70555 | ||
|
eb41ceec14 | ||
|
0afd2930fd | ||
|
4cbcc74d8f | ||
|
ab2a7f32e6 | ||
|
2cfc7776bd | ||
|
844e330299 | ||
|
6f99c62086 | ||
|
2bd7e293bf | ||
|
a8e266b7b3 | ||
|
9e45151243 | ||
|
8081cb909b | ||
|
11398ee00f | ||
|
5443e66190 | ||
|
bfbd6f22c3 | ||
|
364214f1c7 | ||
|
c97af690c9 | ||
|
2b66b23045 | ||
|
18397e51ad | ||
|
4ac0a87868 | ||
|
3cb8275141 | ||
|
14fac5200d | ||
|
4e4cd7065b | ||
|
69e6b0307b | ||
|
a33f38d2bf | ||
|
62ea10c0e0 | ||
|
49aa21e327 | ||
|
0bf24452f3 | ||
|
aab94295ea | ||
|
d282666f96 | ||
|
7b81db9f37 | ||
|
21798650de | ||
|
c03932b6e6 | ||
|
8a50c841cf | ||
|
8986b7f9ae | ||
|
5e690f4097 | ||
|
62c4a2273e | ||
|
39f9dc50f5 | ||
|
ede1cdbcaf | ||
|
2ee4ef998a | ||
|
e8e6ad5692 | ||
|
423202cae4 | ||
|
77eb71a612 | ||
|
f9337e1c78 | ||
|
65bd87bd35 | ||
|
bcfdd7476f | ||
|
336e6df3ef | ||
|
7b731ab6e8 | ||
|
199f9783a0 | ||
|
08ad7e3e0f | ||
|
1e7a25df6b | ||
|
c7822e2b6f | ||
|
dea50199a1 | ||
|
da8fcbaef5 | ||
|
8a7498e13f | ||
|
0144e4d0b3 | ||
|
a5bcd8b84f | ||
|
048a358bf5 | ||
|
b42d824822 | ||
|
eb6e3a2a89 | ||
|
4a30434a0c | ||
|
c23ba4e83a | ||
|
c9040f482e | ||
|
e3bef4dfa3 | ||
|
e0b436252f | ||
|
aac2d7f100 | ||
|
e886ef760c | ||
|
a0690566bd | ||
|
30a1ebe034 | ||
|
c8c90eb456 |
@@ -1,8 +1,9 @@
|
||||
# The following files are opted into `ninja clang-format` and
|
||||
# enforcement in the CI.
|
||||
|
||||
src/**/asahi/**/*
|
||||
src/**/panfrost/**/*
|
||||
src/gallium/drivers/i915
|
||||
src/amd/vulkan/**/*
|
||||
src/amd/compiler/**/*
|
||||
src/egl/**/*
|
||||
src/etnaviv/isa/**/*
|
||||
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -4,4 +4,3 @@
|
||||
*.png binary
|
||||
*.gif binary
|
||||
*.ico binary
|
||||
*.cl gitlab-language=c
|
||||
|
126
.gitlab-ci.yml
126
.gitlab-ci.yml
@@ -1,67 +1,24 @@
|
||||
# Types of CI pipelines:
|
||||
# | pipeline name | context | description |
|
||||
# |----------------------|-----------|-------------------------------------------------------------|
|
||||
# | merge pipeline | mesa/mesa | pipeline running for an MR; if it passes the MR gets merged |
|
||||
# | pre-merge pipeline | mesa/mesa | same as above, except its status doesn't affect the MR |
|
||||
# | post-merge pipeline | mesa/mesa | pipeline immediately after merging |
|
||||
# | fork pipeline | fork | pipeline running in a user fork |
|
||||
# | scheduled pipeline | mesa/mesa | nightly pipelines, running every morning at 4am UTC |
|
||||
# | direct-push pipeline | mesa/mesa | when commits are pushed directly to mesa/mesa, bypassing Marge and its gating pipeline |
|
||||
#
|
||||
# Note that the release branches maintained by the release manager fall under
|
||||
# the "direct push" category.
|
||||
#
|
||||
# "context" indicates the permissions that the jobs get; notably, any
|
||||
# container created in mesa/mesa gets pushed immediately for everyone to use
|
||||
# as soon as the image tag change is merged.
|
||||
#
|
||||
# Merge pipelines contain all jobs that must pass before the MR can be merged.
|
||||
# Pre-merge pipelines contain the exact same jobs as merge pipelines.
|
||||
# Post-merge pipelines contain *only* the `pages` job that deploys the new
|
||||
# version of the website.
|
||||
# Fork pipelines contain everything.
|
||||
# Scheduled pipelines only contain the container+build jobs, and some extra
|
||||
# test jobs (typically "full" variants of pre-merge jobs that only run 1/X
|
||||
# test cases), but not a repeat of the merge pipeline jobs.
|
||||
# Direct-push pipelines contain the same jobs as merge pipelines.
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
# do not duplicate pipelines on merge pipelines
|
||||
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
|
||||
when: never
|
||||
# merge pipeline
|
||||
- if: &is-merge-attempt $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
|
||||
variables:
|
||||
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${KERNEL_TAG}
|
||||
MESA_CI_PERFORMANCE_ENABLED: 1
|
||||
VALVE_INFRA_VANGOGH_JOB_PRIORITY: "" # Empty tags are ignored by gitlab
|
||||
# post-merge pipeline
|
||||
- if: &is-post-merge $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "push"
|
||||
# nightly pipeline
|
||||
- if: &is-scheduled-pipeline $CI_PIPELINE_SOURCE == "schedule"
|
||||
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH
|
||||
variables:
|
||||
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${KERNEL_TAG}
|
||||
JOB_PRIORITY: 50
|
||||
VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
|
||||
# pipeline for direct pushes that bypassed the CI
|
||||
- if: &is-direct-push $CI_PROJECT_NAMESPACE == "mesa" && $CI_PIPELINE_SOURCE == "push" && $GITLAB_USER_LOGIN != "marge-bot"
|
||||
variables:
|
||||
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${KERNEL_TAG}
|
||||
JOB_PRIORITY: 40
|
||||
VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
|
||||
# pre-merge or fork pipeline
|
||||
- if: $FORCE_KERNEL_TAG != null
|
||||
# any other pipeline
|
||||
- if: $GITLAB_USER_LOGIN != "marge-bot"
|
||||
variables:
|
||||
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${FORCE_KERNEL_TAG}
|
||||
JOB_PRIORITY: 50
|
||||
VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
|
||||
- if: $FORCE_KERNEL_TAG == null
|
||||
variables:
|
||||
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${KERNEL_TAG}
|
||||
JOB_PRIORITY: 50
|
||||
VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
|
||||
|
||||
- when: always
|
||||
|
||||
variables:
|
||||
FDO_UPSTREAM_REPO: mesa/mesa
|
||||
@@ -78,15 +35,13 @@ variables:
|
||||
PIPELINE_ARTIFACTS_BASE: ${S3_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}
|
||||
# per-job artifact storage on MinIO
|
||||
JOB_ARTIFACTS_BASE: ${PIPELINE_ARTIFACTS_BASE}/${CI_JOB_ID}
|
||||
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/gfx-ci/linux/${KERNEL_TAG}
|
||||
# reference images stored for traces
|
||||
PIGLIT_REPLAY_REFERENCE_IMAGES_BASE: "${S3_HOST}/mesa-tracie-results/$FDO_UPSTREAM_REPO"
|
||||
# For individual CI farm status see .ci-farms folder
|
||||
# Disable farm with `git mv .ci-farms{,-disabled}/$farm_name`
|
||||
# Re-enable farm with `git mv .ci-farms{-disabled,}/$farm_name`
|
||||
# NEVER MIX FARM MAINTENANCE WITH ANY OTHER CHANGE IN THE SAME MERGE REQUEST!
|
||||
ARTIFACTS_BASE_URL: https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts
|
||||
# Python scripts for structured logger
|
||||
PYTHONPATH: "$PYTHONPATH:$CI_PROJECT_DIR/install"
|
||||
|
||||
default:
|
||||
before_script:
|
||||
@@ -129,7 +84,7 @@ stages:
|
||||
- git-archive
|
||||
- build-x86_64
|
||||
- build-misc
|
||||
- code-validation
|
||||
- lint
|
||||
- amd
|
||||
- intel
|
||||
- nouveau
|
||||
@@ -167,7 +122,6 @@ include:
|
||||
- local: 'src/gallium/drivers/crocus/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/d3d12/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/i915/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/r300/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/lima/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml'
|
||||
- local: 'src/gallium/drivers/nouveau/ci/gitlab-ci.yml'
|
||||
@@ -184,25 +138,28 @@ include:
|
||||
# YAML anchors for rule conditions
|
||||
# --------------------------------
|
||||
.rules-anchors:
|
||||
# Pre-merge pipeline
|
||||
- &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
|
||||
|
||||
.never-post-merge-rules:
|
||||
rules:
|
||||
- if: *is-post-merge
|
||||
when: never
|
||||
# Post-merge pipeline
|
||||
- if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
|
||||
when: on_success
|
||||
# Post-merge pipeline, not for Marge Bot
|
||||
- if: &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
|
||||
when: on_success
|
||||
# Pre-merge pipeline
|
||||
- if: &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: on_success
|
||||
# Pre-merge pipeline for Marge Bot
|
||||
- if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: on_success
|
||||
|
||||
|
||||
.container+build-rules:
|
||||
rules:
|
||||
# Run when re-enabling a disabled farm, but not when disabling it
|
||||
- !reference [.disable-farm-mr-rules, rules]
|
||||
# Never run immediately after merging, as we just ran everything
|
||||
- !reference [.never-post-merge-rules, rules]
|
||||
# Build everything in merge pipelines, if any files affecting the pipeline
|
||||
# were changed
|
||||
- if: *is-merge-attempt
|
||||
# Run pipeline by default in the main project if any CI pipeline
|
||||
# configuration files were changed, to ensure docker images are up to date
|
||||
- if: *is-post-merge
|
||||
changes: &all_paths
|
||||
- VERSION
|
||||
- bin/git_sha1_gen.py
|
||||
@@ -211,38 +168,33 @@ include:
|
||||
# GitLab CI
|
||||
- .gitlab-ci.yml
|
||||
- .gitlab-ci/**/*
|
||||
- .ci-farms/*
|
||||
# Meson
|
||||
- meson*
|
||||
- build-support/**/*
|
||||
- subprojects/**/*
|
||||
# clang format
|
||||
- .clang-format
|
||||
- .clang-format-include
|
||||
- .clang-format-ignore
|
||||
# Source code
|
||||
- include/**/*
|
||||
- src/**/*
|
||||
when: on_success
|
||||
# Same as above, but for pre-merge pipelines
|
||||
- if: *is-pre-merge
|
||||
# Run pipeline by default if it was triggered by Marge Bot, is for a
|
||||
# merge request, and any files affecting the pipeline were changed
|
||||
- if: *is-pre-merge-for-marge
|
||||
changes:
|
||||
*all_paths
|
||||
when: manual
|
||||
# Skip everything for pre-merge and merge pipelines which don't change
|
||||
# anything in the build
|
||||
- if: *is-merge-attempt
|
||||
when: never
|
||||
- if: *is-pre-merge
|
||||
when: never
|
||||
# Build everything after someone bypassed the CI
|
||||
- if: *is-direct-push
|
||||
when: on_success
|
||||
# Build everything in scheduled pipelines
|
||||
- if: *is-scheduled-pipeline
|
||||
# Run pipeline by default in the main project if it was not triggered by
|
||||
# Marge Bot, and any files affecting the pipeline were changed
|
||||
- if: *is-post-merge-not-for-marge
|
||||
changes:
|
||||
*all_paths
|
||||
when: on_success
|
||||
# Allow building everything in fork pipelines, but build nothing unless
|
||||
# manually triggered
|
||||
# Just skip everything for MRs which don't actually change anything in the
|
||||
# build - the same rules as above, but without the file-change rules
|
||||
- if: *is-pre-merge-for-marge
|
||||
when: never
|
||||
- if: *is-post-merge
|
||||
when: never
|
||||
# Always allow user branches etc to trigger jobs manually
|
||||
- when: manual
|
||||
|
||||
|
||||
@@ -288,7 +240,7 @@ sanity:
|
||||
rules:
|
||||
- if: *is-pre-merge
|
||||
when: on_success
|
||||
- when: never
|
||||
# Other cases default to never
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
script:
|
||||
@@ -298,8 +250,6 @@ sanity:
|
||||
when: on_failure
|
||||
reports:
|
||||
junit: check-*.xml
|
||||
tags:
|
||||
- placeholder-job
|
||||
|
||||
|
||||
# Jobs that need to pass before spending hardware resources on further testing
|
||||
|
@@ -36,44 +36,3 @@ spec@!opengl 1.1@windowoverlap
|
||||
# Note that "glx-" tests don't appear in x11-skips.txt because they can be
|
||||
# run even if PIGLIT_PLATFORM=gbm (for example)
|
||||
glx@glx-copy-sub-buffer.*
|
||||
|
||||
# A majority of the tests introduced in CTS 1.3.7.0 are experiencing failures and flakes.
|
||||
# Disable these tests until someone with a more deeper understanding of EGL examines them.
|
||||
#
|
||||
# Note: on sc8280xp/a690 I get identical results (same passes and fails)
|
||||
# between freedreno, zink, and llvmpipe, so I believe this is either a
|
||||
# deqp bug or egl/wayland bug, rather than driver issue.
|
||||
#
|
||||
# With llvmpipe, the failing tests have the error message:
|
||||
#
|
||||
# "Illegal sampler view creation without bind flag"
|
||||
#
|
||||
# which might be a hint. (But some passing tests also have the same
|
||||
# error message.)
|
||||
#
|
||||
# more context from David Heidelberg on IRC: the deqp commit where these
|
||||
# started failing is: https://github.com/KhronosGroup/VK-GL-CTS/commit/79b25659bcbced0cfc2c3fe318951c585f682abe
|
||||
# prior to that they were skipping.
|
||||
wayland-dEQP-EGL.functional.color_clears.single_context.gles1.other
|
||||
wayland-dEQP-EGL.functional.color_clears.single_context.gles2.other
|
||||
wayland-dEQP-EGL.functional.color_clears.single_context.gles3.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_context.gles1.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_context.gles2.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_context.gles3.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_context.gles1_gles2.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_context.gles1_gles2_gles3.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles1.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles2.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles3.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles1_gles2.other
|
||||
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles1_gles2_gles3.other
|
||||
|
||||
# Seems to be the same is as wayland-dEQP-EGL.functional.color_clears.*
|
||||
wayland-dEQP-EGL.functional.render.single_context.gles2.other
|
||||
wayland-dEQP-EGL.functional.render.single_context.gles3.other
|
||||
wayland-dEQP-EGL.functional.render.multi_context.gles2.other
|
||||
wayland-dEQP-EGL.functional.render.multi_context.gles3.other
|
||||
wayland-dEQP-EGL.functional.render.multi_context.gles2_gles3.other
|
||||
wayland-dEQP-EGL.functional.render.multi_thread.gles2.other
|
||||
wayland-dEQP-EGL.functional.render.multi_thread.gles3.other
|
||||
wayland-dEQP-EGL.functional.render.multi_thread.gles2_gles3.other
|
||||
|
@@ -2,7 +2,12 @@ version: 1
|
||||
|
||||
# Rules to match for a machine to qualify
|
||||
target:
|
||||
id: '{{ ci_runner_id }}'
|
||||
{% if tags %}
|
||||
tags:
|
||||
{% for tag in tags %}
|
||||
- '{{ tag | trim }}'
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
timeouts:
|
||||
first_console_activity: # This limits the time it can take to receive the first console log
|
||||
@@ -54,8 +59,8 @@ deployment:
|
||||
b2c.volume={{ volume }}
|
||||
{% endfor %}
|
||||
b2c.container="-v {{ '{{' }} job_bucket }}-results:{{ working_dir }} -w {{ working_dir }} {% for mount_volume in mount_volumes %} -v {{ mount_volume }}{% endfor %} --tls-verify=false docker://{{ local_container }} {{ container_cmd }}"
|
||||
{% if kernel_cmdline_extras is defined %}
|
||||
{{ kernel_cmdline_extras }}
|
||||
{% if cmdline_extras is defined %}
|
||||
{{ cmdline_extras }}
|
||||
{% endif %}
|
||||
|
||||
initramfs:
|
||||
|
@@ -22,34 +22,86 @@
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
from argparse import ArgumentParser
|
||||
from os import environ, path
|
||||
import json
|
||||
|
||||
|
||||
# Pass all the environment variables prefixed by B2C_
|
||||
values = {
|
||||
key.removeprefix("B2C_").lower(): environ[key]
|
||||
for key in environ if key.startswith("B2C_")
|
||||
}
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('--ci-job-id')
|
||||
parser.add_argument('--container-cmd')
|
||||
parser.add_argument('--initramfs-url')
|
||||
parser.add_argument('--job-success-regex')
|
||||
parser.add_argument('--job-warn-regex')
|
||||
parser.add_argument('--kernel-url')
|
||||
parser.add_argument('--log-level', type=int)
|
||||
parser.add_argument('--poweroff-delay', type=int)
|
||||
parser.add_argument('--session-end-regex')
|
||||
parser.add_argument('--session-reboot-regex')
|
||||
parser.add_argument('--tags', nargs='?', default='')
|
||||
parser.add_argument('--template', default='b2c.yml.jinja2.jinja2')
|
||||
parser.add_argument('--timeout-boot-minutes', type=int)
|
||||
parser.add_argument('--timeout-boot-retries', type=int)
|
||||
parser.add_argument('--timeout-first-minutes', type=int)
|
||||
parser.add_argument('--timeout-first-retries', type=int)
|
||||
parser.add_argument('--timeout-minutes', type=int)
|
||||
parser.add_argument('--timeout-overall-minutes', type=int)
|
||||
parser.add_argument('--timeout-retries', type=int)
|
||||
parser.add_argument('--job-volume-exclusions', nargs='?', default='')
|
||||
parser.add_argument('--volume', action='append')
|
||||
parser.add_argument('--mount-volume', action='append')
|
||||
parser.add_argument('--local-container', default=environ.get('B2C_LOCAL_CONTAINER', 'alpine:latest'))
|
||||
parser.add_argument('--working-dir')
|
||||
args = parser.parse_args()
|
||||
|
||||
env = Environment(loader=FileSystemLoader(path.dirname(values['job_template'])),
|
||||
env = Environment(loader=FileSystemLoader(path.dirname(args.template)),
|
||||
trim_blocks=True, lstrip_blocks=True)
|
||||
|
||||
template = env.get_template(path.basename(values['job_template']))
|
||||
template = env.get_template(path.basename(args.template))
|
||||
|
||||
values['ci_job_id'] = environ['CI_JOB_ID']
|
||||
values['ci_runner_id'] = environ['CI_RUNNER_ID']
|
||||
values['job_volume_exclusions'] = [excl for excl in values['job_volume_exclusions'].split(",") if excl]
|
||||
values['working_dir'] = environ['CI_PROJECT_DIR']
|
||||
values = {}
|
||||
values['ci_job_id'] = args.ci_job_id
|
||||
values['container_cmd'] = args.container_cmd
|
||||
values['initramfs_url'] = args.initramfs_url
|
||||
values['job_success_regex'] = args.job_success_regex
|
||||
values['job_warn_regex'] = args.job_warn_regex
|
||||
values['kernel_url'] = args.kernel_url
|
||||
values['log_level'] = args.log_level
|
||||
values['poweroff_delay'] = args.poweroff_delay
|
||||
values['session_end_regex'] = args.session_end_regex
|
||||
values['session_reboot_regex'] = args.session_reboot_regex
|
||||
try:
|
||||
values['tags'] = json.loads(args.tags)
|
||||
except json.decoder.JSONDecodeError:
|
||||
values['tags'] = args.tags.split(",")
|
||||
values['template'] = args.template
|
||||
values['timeout_boot_minutes'] = args.timeout_boot_minutes
|
||||
values['timeout_boot_retries'] = args.timeout_boot_retries
|
||||
values['timeout_first_minutes'] = args.timeout_first_minutes
|
||||
values['timeout_first_retries'] = args.timeout_first_retries
|
||||
values['timeout_minutes'] = args.timeout_minutes
|
||||
values['timeout_overall_minutes'] = args.timeout_overall_minutes
|
||||
values['timeout_retries'] = args.timeout_retries
|
||||
if len(args.job_volume_exclusions) > 0:
|
||||
exclusions = args.job_volume_exclusions.split(",")
|
||||
values['job_volume_exclusions'] = [excl for excl in exclusions if len(excl) > 0]
|
||||
if args.volume is not None:
|
||||
values['volumes'] = args.volume
|
||||
if args.mount_volume is not None:
|
||||
values['mount_volumes'] = args.mount_volume
|
||||
values['working_dir'] = args.working_dir
|
||||
|
||||
assert(len(args.local_container) > 0)
|
||||
|
||||
# Use the gateway's pull-through registry caches to reduce load on fd.o.
|
||||
values['local_container'] = environ['IMAGE_UNDER_TEST']
|
||||
values['local_container'] = values['local_container'].replace(
|
||||
'registry.freedesktop.org',
|
||||
'{{ fdo_proxy_registry }}'
|
||||
)
|
||||
values['local_container'] = args.local_container
|
||||
for url, replacement in [('registry.freedesktop.org', '{{ fdo_proxy_registry }}'),
|
||||
('harbor.freedesktop.org', '{{ harbor_fdo_registry }}')]:
|
||||
values['local_container'] = values['local_container'].replace(url, replacement)
|
||||
|
||||
if 'kernel_cmdline_extras' not in values:
|
||||
values['kernel_cmdline_extras'] = ''
|
||||
if 'B2C_KERNEL_CMDLINE_EXTRAS' in environ:
|
||||
values['cmdline_extras'] = environ['B2C_KERNEL_CMDLINE_EXTRAS']
|
||||
|
||||
with open(path.splitext(path.basename(values['job_template']))[0], "w") as f:
|
||||
f.write(template.render(values))
|
||||
f = open(path.splitext(path.basename(args.template))[0], "w")
|
||||
f.write(template.render(values))
|
||||
f.close()
|
||||
|
@@ -9,7 +9,6 @@
|
||||
# We're run from the root of the repo, make a helper var for our paths
|
||||
BM=$CI_PROJECT_DIR/install/bare-metal
|
||||
CI_COMMON=$CI_PROJECT_DIR/install/common
|
||||
CI_INSTALL=$CI_PROJECT_DIR/install
|
||||
|
||||
# Runner config checks
|
||||
if [ -z "$BM_SERIAL" ]; then
|
||||
@@ -86,39 +85,21 @@ rm -rf /tftp/*
|
||||
if echo "$BM_KERNEL" | grep -q http; then
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
$BM_KERNEL -o /tftp/vmlinuz
|
||||
elif [ -n "${FORCE_KERNEL_TAG}" ]; then
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_KERNEL}" -o /tftp/vmlinuz
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/modules.tar.zst" -o modules.tar.zst
|
||||
tar --keep-directory-symlink --zstd -xf modules.tar.zst -C "/nfs/"
|
||||
rm modules.tar.zst &
|
||||
else
|
||||
cp /baremetal-files/"$BM_KERNEL" /tftp/vmlinuz
|
||||
fi
|
||||
echo "$BM_CMDLINE" > /tftp/cmdline
|
||||
|
||||
set +e
|
||||
STRUCTURED_LOG_FILE=job_detail.json
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update dut_job_type "${DEVICE_TYPE}"
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update farm "${FARM}"
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --create-dut-job dut_name "${CI_RUNNER_DESCRIPTION}"
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update-dut-time submit "${CI_JOB_STARTED_AT}"
|
||||
python3 $BM/cros_servo_run.py \
|
||||
--cpu $BM_SERIAL \
|
||||
--ec $BM_SERIAL_EC \
|
||||
--test-timeout ${TEST_PHASE_TIMEOUT:-20}
|
||||
ret=$?
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close-dut-job
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close
|
||||
set -e
|
||||
|
||||
# Bring artifacts back from the NFS dir to the build dir where gitlab-runner
|
||||
# will look for them.
|
||||
cp -Rp /nfs/results/. results/
|
||||
if [ -f "${STRUCTURED_LOG_FILE}" ]; then
|
||||
cp -p ${STRUCTURED_LOG_FILE} results/
|
||||
echo "Structured log file is available at https://${CI_PROJECT_ROOT_NAMESPACE}.pages.freedesktop.org/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts/results/${STRUCTURED_LOG_FILE}"
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
|
@@ -7,12 +7,11 @@ import argparse
|
||||
import re
|
||||
import sys
|
||||
|
||||
from custom_logger import CustomLogger
|
||||
from serial_buffer import SerialBuffer
|
||||
|
||||
|
||||
class CrosServoRun:
|
||||
def __init__(self, cpu, ec, test_timeout, logger):
|
||||
def __init__(self, cpu, ec, test_timeout):
|
||||
self.cpu_ser = SerialBuffer(
|
||||
cpu, "results/serial.txt", "R SERIAL-CPU> ")
|
||||
# Merge the EC serial into the cpu_ser's line stream so that we can
|
||||
@@ -20,7 +19,6 @@ class CrosServoRun:
|
||||
self.ec_ser = SerialBuffer(
|
||||
ec, "results/serial-ec.txt", "R SERIAL-EC> ", line_queue=self.cpu_ser.line_queue)
|
||||
self.test_timeout = test_timeout
|
||||
self.logger = logger
|
||||
|
||||
def close(self):
|
||||
self.ec_ser.close()
|
||||
@@ -38,7 +36,6 @@ class CrosServoRun:
|
||||
RED = '\033[0;31m'
|
||||
NO_COLOR = '\033[0m'
|
||||
print(RED + message + NO_COLOR)
|
||||
self.logger.update_status_fail(message)
|
||||
|
||||
def run(self):
|
||||
# Flush any partial commands in the EC's prompt, then ask for a reboot.
|
||||
@@ -46,7 +43,6 @@ class CrosServoRun:
|
||||
self.ec_write("reboot\n")
|
||||
|
||||
bootloader_done = False
|
||||
self.logger.create_job_phase("boot")
|
||||
tftp_failures = 0
|
||||
# This is emitted right when the bootloader pauses to check for input.
|
||||
# Emit a ^N character to request network boot, because we don't have a
|
||||
@@ -83,10 +79,9 @@ class CrosServoRun:
|
||||
return 1
|
||||
|
||||
if not bootloader_done:
|
||||
self.print_error("Failed to make it through bootloader, abandoning run.")
|
||||
print("Failed to make it through bootloader, abandoning run.")
|
||||
return 1
|
||||
|
||||
self.logger.create_job_phase("test")
|
||||
for line in self.cpu_ser.lines(timeout=self.test_timeout, phase="test"):
|
||||
if re.search("---. end Kernel panic", line):
|
||||
return 1
|
||||
@@ -130,10 +125,8 @@ class CrosServoRun:
|
||||
result = re.search("hwci: mesa: (\S*)", line)
|
||||
if result:
|
||||
if result.group(1) == "pass":
|
||||
self.logger.update_dut_job("status", "pass")
|
||||
return 0
|
||||
else:
|
||||
self.logger.update_status_fail("test fail")
|
||||
return 1
|
||||
|
||||
self.print_error(
|
||||
@@ -151,14 +144,11 @@ def main():
|
||||
'--test-timeout', type=int, help='Test phase timeout (minutes)', required=True)
|
||||
args = parser.parse_args()
|
||||
|
||||
logger = CustomLogger("job_detail.json")
|
||||
logger.update_dut_time("start", None)
|
||||
servo = CrosServoRun(args.cpu, args.ec, args.test_timeout * 60, logger)
|
||||
servo = CrosServoRun(args.cpu, args.ec, args.test_timeout * 60)
|
||||
retval = servo.run()
|
||||
|
||||
# power down the CPU on the device
|
||||
servo.ec_write("power off\n")
|
||||
logger.update_dut_time("end", None)
|
||||
servo.close()
|
||||
|
||||
sys.exit(retval)
|
||||
|
@@ -96,30 +96,22 @@ else
|
||||
popd
|
||||
fi
|
||||
|
||||
# Make the combined kernel image and dtb for passing to fastboot. For normal
|
||||
# Mesa development, we build the kernel and store it in the docker container
|
||||
# that this script is running in.
|
||||
#
|
||||
# However, container builds are expensive, so when you're hacking on the
|
||||
# kernel, it's nice to be able to skip the half hour container build and plus
|
||||
# moving that container to the runner. So, if BM_KERNEL+BM_DTB are URLs,
|
||||
# fetch them instead of looking in the container.
|
||||
if echo "$BM_KERNEL $BM_DTB" | grep -q http; then
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"$BM_KERNEL" -o kernel
|
||||
# FIXME: modules should be supplied too
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"$BM_DTB" -o dtb
|
||||
|
||||
cat kernel dtb > Image.gz-dtb
|
||||
|
||||
elif [ -n "${FORCE_KERNEL_TAG}" ]; then
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_KERNEL}" -o kernel
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/modules.tar.zst" -o modules.tar.zst
|
||||
|
||||
if [ -n "$BM_DTB" ]; then
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_DTB}.dtb" -o dtb
|
||||
fi
|
||||
|
||||
cat kernel dtb > Image.gz-dtb || echo "No DTB available, using pure kernel."
|
||||
rm kernel
|
||||
tar --keep-directory-symlink --zstd -xf modules.tar.zst -C "$BM_ROOTFS/"
|
||||
rm modules.tar.zst &
|
||||
else
|
||||
cat /baremetal-files/"$BM_KERNEL" /baremetal-files/"$BM_DTB".dtb > Image.gz-dtb
|
||||
cp /baremetal-files/"$BM_DTB".dtb dtb
|
||||
|
@@ -12,7 +12,6 @@
|
||||
# We're run from the root of the repo, make a helper var for our paths
|
||||
BM=$CI_PROJECT_DIR/install/bare-metal
|
||||
CI_COMMON=$CI_PROJECT_DIR/install/common
|
||||
CI_INSTALL=$CI_PROJECT_DIR/install
|
||||
|
||||
# Runner config checks
|
||||
if [ -z "$BM_SERIAL" ]; then
|
||||
@@ -61,8 +60,8 @@ if [ -z "$BM_ROOTFS" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$BM_BOOTFS" ] && { [ -z "$BM_KERNEL" ] || [ -z "$BM_DTB" ]; } ; then
|
||||
echo "Must set /boot files for the TFTP boot in the job's variables or set kernel and dtb"
|
||||
if [ -z "$BM_BOOTFS" ]; then
|
||||
echo "Must set /boot files for the TFTP boot in the job's variables"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -71,6 +70,11 @@ if [ -z "$BM_CMDLINE" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$BM_BOOTCONFIG" ]; then
|
||||
echo "Must set BM_BOOTCONFIG to your board's required boot configuration arguments"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -ex
|
||||
|
||||
date +'%F %T'
|
||||
@@ -95,50 +99,23 @@ fi
|
||||
date +'%F %T'
|
||||
|
||||
# If BM_BOOTFS is a file, assume it is a tarball and uncompress it
|
||||
if [ -f "${BM_BOOTFS}" ]; then
|
||||
if [ -f $BM_BOOTFS ]; then
|
||||
mkdir -p /tmp/bootfs
|
||||
tar xf $BM_BOOTFS -C /tmp/bootfs
|
||||
BM_BOOTFS=/tmp/bootfs
|
||||
fi
|
||||
|
||||
# If BM_KERNEL and BM_DTS is present
|
||||
if [ -n "${FORCE_KERNEL_TAG}" ]; then
|
||||
if [ -z "${BM_KERNEL}" ] || [ -z "${BM_DTB}" ]; then
|
||||
echo "This machine cannot be tested with external kernel since BM_KERNEL or BM_DTB missing!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_KERNEL}" -o "${BM_KERNEL}"
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_DTB}.dtb" -o "${BM_DTB}.dtb"
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/modules.tar.zst" -o modules.tar.zst
|
||||
fi
|
||||
|
||||
date +'%F %T'
|
||||
|
||||
# Install kernel modules (it could be either in /lib/modules or
|
||||
# /usr/lib/modules, but we want to install in the latter)
|
||||
if [ -n "${FORCE_KERNEL_TAG}" ]; then
|
||||
tar --keep-directory-symlink --zstd -xf modules.tar.zst -C /nfs/
|
||||
rm modules.tar.zst &
|
||||
elif [ -n "${BM_BOOTFS}" ]; then
|
||||
[ -d $BM_BOOTFS/usr/lib/modules ] && rsync -a $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/
|
||||
[ -d $BM_BOOTFS/lib/modules ] && rsync -a $BM_BOOTFS/lib/modules/ /nfs/lib/modules/
|
||||
else
|
||||
echo "No modules!"
|
||||
fi
|
||||
|
||||
[ -d $BM_BOOTFS/usr/lib/modules ] && rsync -a $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/
|
||||
[ -d $BM_BOOTFS/lib/modules ] && rsync -a $BM_BOOTFS/lib/modules/ /nfs/lib/modules/
|
||||
|
||||
date +'%F %T'
|
||||
|
||||
# Install kernel image + bootloader files
|
||||
if [ -n "${FORCE_KERNEL_TAG}" ] || [ -z "$BM_BOOTFS" ]; then
|
||||
mv "${BM_KERNEL}" "${BM_DTB}.dtb" /tftp/
|
||||
else # BM_BOOTFS
|
||||
rsync -aL --delete $BM_BOOTFS/boot/ /tftp/
|
||||
fi
|
||||
rsync -aL --delete $BM_BOOTFS/boot/ /tftp/
|
||||
|
||||
date +'%F %T'
|
||||
|
||||
@@ -170,31 +147,19 @@ LABEL primary
|
||||
EOF
|
||||
|
||||
# Create the rootfs in the NFS directory
|
||||
mkdir -p /nfs/results
|
||||
. $BM/rootfs-setup.sh /nfs
|
||||
|
||||
date +'%F %T'
|
||||
|
||||
echo "$BM_CMDLINE" > /tftp/cmdline.txt
|
||||
|
||||
# Add some options in config.txt, if defined
|
||||
if [ -n "$BM_BOOTCONFIG" ]; then
|
||||
printf "$BM_BOOTCONFIG" >> /tftp/config.txt
|
||||
fi
|
||||
# Add some required options in config.txt
|
||||
printf "$BM_BOOTCONFIG" >> /tftp/config.txt
|
||||
|
||||
set +e
|
||||
STRUCTURED_LOG_FILE=job_detail.json
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update dut_job_type "${DEVICE_TYPE}"
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update farm "${FARM}"
|
||||
ATTEMPTS=3
|
||||
first_attempt=True
|
||||
while [ $((ATTEMPTS--)) -gt 0 ]; do
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --create-dut-job dut_name "${CI_RUNNER_DESCRIPTION}"
|
||||
# Update subtime time to CI_JOB_STARTED_AT only for the first run
|
||||
if [ "$first_attempt" = "True" ]; then
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update-dut-time submit "${CI_JOB_STARTED_AT}"
|
||||
else
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update-dut-time submit
|
||||
fi
|
||||
python3 $BM/poe_run.py \
|
||||
--dev="$BM_SERIAL" \
|
||||
--powerup="$BM_POWERUP" \
|
||||
@@ -204,14 +169,10 @@ while [ $((ATTEMPTS--)) -gt 0 ]; do
|
||||
|
||||
if [ $ret -eq 2 ]; then
|
||||
echo "Did not detect boot sequence, retrying..."
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close-dut-job
|
||||
first_attempt=False
|
||||
else
|
||||
ATTEMPTS=0
|
||||
fi
|
||||
done
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close-dut-job
|
||||
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close
|
||||
set -e
|
||||
|
||||
date +'%F %T'
|
||||
@@ -219,10 +180,6 @@ date +'%F %T'
|
||||
# Bring artifacts back from the NFS dir to the build dir where gitlab-runner
|
||||
# will look for them.
|
||||
cp -Rp /nfs/results/. results/
|
||||
if [ -f "${STRUCTURED_LOG_FILE}" ]; then
|
||||
cp -p ${STRUCTURED_LOG_FILE} results/
|
||||
echo "Structured log file is available at ${ARTIFACTS_BASE_URL}/results/${STRUCTURED_LOG_FILE}"
|
||||
fi
|
||||
|
||||
date +'%F %T'
|
||||
|
||||
|
@@ -24,26 +24,23 @@
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
from serial_buffer import SerialBuffer
|
||||
import sys
|
||||
import threading
|
||||
|
||||
from custom_logger import CustomLogger
|
||||
from serial_buffer import SerialBuffer
|
||||
|
||||
class PoERun:
|
||||
def __init__(self, args, test_timeout, logger):
|
||||
def __init__(self, args, test_timeout):
|
||||
self.powerup = args.powerup
|
||||
self.powerdown = args.powerdown
|
||||
self.ser = SerialBuffer(
|
||||
args.dev, "results/serial-output.txt", "")
|
||||
self.test_timeout = test_timeout
|
||||
self.logger = logger
|
||||
|
||||
def print_error(self, message):
|
||||
RED = '\033[0;31m'
|
||||
NO_COLOR = '\033[0m'
|
||||
print(RED + message + NO_COLOR)
|
||||
self.logger.update_status_fail(message)
|
||||
|
||||
def logged_system(self, cmd):
|
||||
print("Running '{}'".format(cmd))
|
||||
@@ -51,11 +48,9 @@ class PoERun:
|
||||
|
||||
def run(self):
|
||||
if self.logged_system(self.powerup) != 0:
|
||||
self.logger.update_status_fail("powerup failed")
|
||||
return 1
|
||||
|
||||
boot_detected = False
|
||||
self.logger.create_job_phase("boot")
|
||||
for line in self.ser.lines(timeout=5 * 60, phase="bootloader"):
|
||||
if re.search("Booting Linux", line):
|
||||
boot_detected = True
|
||||
@@ -66,10 +61,8 @@ class PoERun:
|
||||
"Something wrong; couldn't detect the boot start up sequence")
|
||||
return 1
|
||||
|
||||
self.logger.create_job_phase("test")
|
||||
for line in self.ser.lines(timeout=self.test_timeout, phase="test"):
|
||||
if re.search("---. end Kernel panic", line):
|
||||
self.logger.update_status_fail("kernel panic")
|
||||
return 1
|
||||
|
||||
# Binning memory problems
|
||||
@@ -89,10 +82,8 @@ class PoERun:
|
||||
result = re.search("hwci: mesa: (\S*)", line)
|
||||
if result:
|
||||
if result.group(1) == "pass":
|
||||
self.logger.update_dut_job("status", "pass")
|
||||
return 0
|
||||
else:
|
||||
self.logger.update_status_fail("test fail")
|
||||
return 1
|
||||
|
||||
self.print_error(
|
||||
@@ -112,13 +103,10 @@ def main():
|
||||
'--test-timeout', type=int, help='Test phase timeout (minutes)', required=True)
|
||||
args = parser.parse_args()
|
||||
|
||||
logger = CustomLogger("job_detail.json")
|
||||
logger.update_dut_time("start", None)
|
||||
poe = PoERun(args, args.test_timeout * 60, logger)
|
||||
poe = PoERun(args, args.test_timeout * 60)
|
||||
retval = poe.run()
|
||||
|
||||
poe.logged_system(args.powerdown)
|
||||
logger.update_dut_time("end", None)
|
||||
|
||||
sys.exit(retval)
|
||||
|
||||
|
@@ -61,6 +61,15 @@
|
||||
script:
|
||||
- .gitlab-ci/meson/build.sh
|
||||
|
||||
.meson-build_mingw:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .use-debian/x86_64_build_mingw
|
||||
- .use-wine
|
||||
stage: build-x86_64
|
||||
script:
|
||||
- .gitlab-ci/meson/build.sh
|
||||
|
||||
debian-testing:
|
||||
extends:
|
||||
- .meson-build
|
||||
@@ -75,8 +84,7 @@ debian-testing:
|
||||
GALLIUM_ST: >
|
||||
-D dri3=enabled
|
||||
-D gallium-va=enabled
|
||||
-D gallium-rusticl=true
|
||||
GALLIUM_DRIVERS: "swrast,virgl,radeonsi,zink,crocus,iris,i915,r300"
|
||||
GALLIUM_DRIVERS: "swrast,virgl,radeonsi,zink,crocus,iris,i915"
|
||||
VULKAN_DRIVERS: "swrast,amd,intel,intel_hasvk,virtio,nouveau-experimental"
|
||||
BUILDTYPE: "debugoptimized"
|
||||
EXTRA_OPTION: >
|
||||
@@ -125,6 +133,33 @@ debian-testing-msan:
|
||||
GALLIUM_DRIVERS: "freedreno,iris,nouveau,kmsro,r300,r600,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus"
|
||||
VULKAN_DRIVERS: intel,amd,broadcom,virtio
|
||||
|
||||
.debian-cl-testing:
|
||||
extends:
|
||||
- .meson-build
|
||||
- .ci-deqp-artifacts
|
||||
variables:
|
||||
LLVM_VERSION: 15
|
||||
UNWIND: "enabled"
|
||||
DRI_LOADERS: >
|
||||
-D glx=disabled
|
||||
-D egl=disabled
|
||||
-D gbm=disabled
|
||||
GALLIUM_DRIVERS: "swrast"
|
||||
BUILDTYPE: "debugoptimized"
|
||||
EXTRA_OPTION: >
|
||||
-D valgrind=disabled
|
||||
script:
|
||||
- .gitlab-ci/meson/build.sh
|
||||
- .gitlab-ci/prepare-artifacts.sh
|
||||
|
||||
debian-rusticl-testing:
|
||||
extends:
|
||||
- .debian-cl-testing
|
||||
variables:
|
||||
GALLIUM_ST: >
|
||||
-D gallium-rusticl=true
|
||||
-D opencl-spirv=true
|
||||
|
||||
debian-build-testing:
|
||||
extends: .meson-build
|
||||
variables:
|
||||
@@ -143,6 +178,7 @@ debian-build-testing:
|
||||
-D gallium-va=enabled
|
||||
-D gallium-xa=enabled
|
||||
-D gallium-nine=true
|
||||
-D gallium-opencl=disabled
|
||||
-D gallium-rusticl=false
|
||||
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,asahi,crocus"
|
||||
VULKAN_DRIVERS: swrast
|
||||
@@ -186,6 +222,7 @@ debian-release:
|
||||
-D gallium-va=enabled
|
||||
-D gallium-xa=enabled
|
||||
-D gallium-nine=false
|
||||
-D gallium-opencl=disabled
|
||||
-D gallium-rusticl=false
|
||||
-D llvm=enabled
|
||||
GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,freedreno,r300,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,crocus"
|
||||
@@ -237,6 +274,8 @@ alpine-build-testing:
|
||||
-D shared-llvm=enabled
|
||||
UNWIND: "disabled"
|
||||
VULKAN_DRIVERS: "amd,broadcom,freedreno,intel,imagination-experimental"
|
||||
script:
|
||||
- .gitlab-ci/meson/build.sh
|
||||
|
||||
fedora-release:
|
||||
extends:
|
||||
@@ -276,6 +315,7 @@ fedora-release:
|
||||
-D gallium-va=enabled
|
||||
-D gallium-xa=enabled
|
||||
-D gallium-nine=false
|
||||
-D gallium-opencl=icd
|
||||
-D gallium-rusticl=true
|
||||
-D gles1=disabled
|
||||
-D gles2=enabled
|
||||
@@ -285,6 +325,8 @@ fedora-release:
|
||||
LLVM_VERSION: ""
|
||||
UNWIND: "disabled"
|
||||
VULKAN_DRIVERS: "amd,broadcom,freedreno,imagination-experimental,intel,intel_hasvk"
|
||||
script:
|
||||
- .gitlab-ci/meson/build.sh
|
||||
|
||||
debian-android:
|
||||
extends:
|
||||
@@ -323,6 +365,7 @@ debian-android:
|
||||
-D gallium-va=disabled
|
||||
-D gallium-xa=disabled
|
||||
-D gallium-nine=false
|
||||
-D gallium-opencl=disabled
|
||||
-D gallium-rusticl=false
|
||||
LLVM_VERSION: ""
|
||||
PKG_CONFIG_LIBDIR: "/disable/non/android/system/pc/files"
|
||||
@@ -442,6 +485,8 @@ debian-arm64-build-test:
|
||||
VULKAN_DRIVERS: "amd"
|
||||
EXTRA_OPTION: >
|
||||
-Dtools=panfrost,imagination
|
||||
script:
|
||||
- .gitlab-ci/meson/build.sh
|
||||
|
||||
debian-arm64-release:
|
||||
extends:
|
||||
@@ -463,12 +508,12 @@ debian-clang:
|
||||
BUILDTYPE: debug
|
||||
LLVM_VERSION: 15
|
||||
UNWIND: "enabled"
|
||||
GALLIUM_DUMP_CPU: "true"
|
||||
C_ARGS: >
|
||||
-Wno-error=constant-conversion
|
||||
-Wno-error=enum-conversion
|
||||
-Wno-error=initializer-overrides
|
||||
-Wno-error=sometimes-uninitialized
|
||||
-Werror=misleading-indentation
|
||||
CPP_ARGS: >
|
||||
-Wno-error=c99-designator
|
||||
-Wno-error=overloaded-virtual
|
||||
@@ -488,6 +533,7 @@ debian-clang:
|
||||
-D gallium-va=enabled
|
||||
-D gallium-xa=enabled
|
||||
-D gallium-nine=true
|
||||
-D gallium-opencl=icd
|
||||
-D gles1=enabled
|
||||
-D gles2=enabled
|
||||
-D llvm=enabled
|
||||
@@ -496,7 +542,7 @@ debian-clang:
|
||||
-D opencl-spirv=true
|
||||
-D shared-glapi=enabled
|
||||
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus,i915,asahi"
|
||||
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio,swrast,panfrost,imagination-experimental,microsoft-experimental,nouveau-experimental
|
||||
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio,swrast,panfrost,imagination-experimental,microsoft-experimental
|
||||
EXTRA_OPTION:
|
||||
-D spirv-to-dxil=true
|
||||
-D osmesa=true
|
||||
@@ -524,6 +570,7 @@ debian-clang-release:
|
||||
-D gallium-va=enabled
|
||||
-D gallium-xa=enabled
|
||||
-D gallium-nine=true
|
||||
-D gallium-opencl=icd
|
||||
-D gles1=disabled
|
||||
-D gles2=disabled
|
||||
-D llvm=enabled
|
||||
@@ -532,10 +579,10 @@ debian-clang-release:
|
||||
-D opencl-spirv=true
|
||||
-D shared-glapi=disabled
|
||||
|
||||
windows-msvc:
|
||||
windows-vs2019:
|
||||
extends:
|
||||
- .build-windows
|
||||
- .use-windows_build_msvc
|
||||
- .use-windows_build_vs2019
|
||||
- .windows-build-rules
|
||||
stage: build-misc
|
||||
script:
|
||||
@@ -545,6 +592,34 @@ windows-msvc:
|
||||
- _build/meson-logs/*.txt
|
||||
- _install/
|
||||
|
||||
.debian-cl:
|
||||
extends: .meson-build
|
||||
variables:
|
||||
LLVM_VERSION: 15
|
||||
UNWIND: "enabled"
|
||||
DRI_LOADERS: >
|
||||
-D glx=disabled
|
||||
-D egl=disabled
|
||||
-D gbm=disabled
|
||||
EXTRA_OPTION: >
|
||||
-D valgrind=disabled
|
||||
|
||||
debian-rusticl:
|
||||
extends: .debian-cl
|
||||
variables:
|
||||
BUILDTYPE: debug
|
||||
GALLIUM_DRIVERS: "iris,swrast"
|
||||
GALLIUM_ST: >
|
||||
-D dri3=disabled
|
||||
-D gallium-vdpau=disabled
|
||||
-D gallium-omx=disabled
|
||||
-D gallium-va=disabled
|
||||
-D gallium-xa=disabled
|
||||
-D gallium-nine=false
|
||||
-D gallium-opencl=disabled
|
||||
-D gallium-rusticl=true
|
||||
RUSTC: clippy-driver
|
||||
|
||||
debian-vulkan:
|
||||
extends: .meson-build
|
||||
variables:
|
||||
@@ -555,9 +630,6 @@ debian-vulkan:
|
||||
-D glx=disabled
|
||||
-D gbm=disabled
|
||||
-D egl=disabled
|
||||
-D opengl=false
|
||||
-D gles1=disabled
|
||||
-D gles2=disabled
|
||||
-D platforms=x11,wayland
|
||||
-D osmesa=false
|
||||
GALLIUM_ST: >
|
||||
@@ -567,6 +639,7 @@ debian-vulkan:
|
||||
-D gallium-va=disabled
|
||||
-D gallium-xa=disabled
|
||||
-D gallium-nine=false
|
||||
-D gallium-opencl=disabled
|
||||
-D gallium-rusticl=false
|
||||
-D b_sanitize=undefined
|
||||
-D c_args=-fno-sanitize-recover=all
|
||||
@@ -587,7 +660,7 @@ debian-x86_32:
|
||||
BUILDTYPE: debug
|
||||
CROSS: i386
|
||||
VULKAN_DRIVERS: intel,amd,swrast,virtio
|
||||
GALLIUM_DRIVERS: "iris,nouveau,r300,r600,radeonsi,swrast,virgl,zink,crocus,d3d12"
|
||||
GALLIUM_DRIVERS: "iris,nouveau,r300,r600,radeonsi,swrast,virgl,zink,crocus"
|
||||
LLVM_VERSION: 15
|
||||
EXTRA_OPTION: >
|
||||
-D vulkan-layers=device-select,overlay
|
||||
@@ -615,3 +688,41 @@ debian-ppc64el:
|
||||
CROSS: ppc64el
|
||||
GALLIUM_DRIVERS: "nouveau,radeonsi,swrast,virgl,zink"
|
||||
VULKAN_DRIVERS: "amd,swrast"
|
||||
|
||||
# Disabled as it hangs with winedbg on shared runners
|
||||
.debian-mingw32-x86_64:
|
||||
extends: .meson-build_mingw
|
||||
stage: build-misc
|
||||
variables:
|
||||
UNWIND: "disabled"
|
||||
C_ARGS: >
|
||||
-Wno-error=format
|
||||
-Wno-error=unused-but-set-variable
|
||||
CPP_ARGS: >
|
||||
-Wno-error=format
|
||||
-Wno-error=unused-function
|
||||
-Wno-error=unused-variable
|
||||
-Wno-error=sign-compare
|
||||
-Wno-error=narrowing
|
||||
GALLIUM_DRIVERS: "swrast,d3d12,zink"
|
||||
VULKAN_DRIVERS: "swrast,amd,microsoft-experimental"
|
||||
GALLIUM_ST: >
|
||||
-D gallium-opencl=icd
|
||||
-D gallium-rusticl=false
|
||||
-D opencl-spirv=true
|
||||
-D microsoft-clc=enabled
|
||||
-D static-libclc=all
|
||||
-D opencl-external-clang-headers=disabled
|
||||
-D llvm=enabled
|
||||
-D gallium-va=enabled
|
||||
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec
|
||||
EXTRA_OPTION: >
|
||||
-D min-windows-version=7
|
||||
-D spirv-to-dxil=true
|
||||
-D gles1=enabled
|
||||
-D gles2=enabled
|
||||
-D osmesa=true
|
||||
-D cpp_rtti=true
|
||||
-D shared-glapi=enabled
|
||||
-D zlib=enabled
|
||||
--cross-file=.gitlab-ci/x86_64-w64-mingw32
|
||||
|
@@ -2,7 +2,6 @@
|
||||
|
||||
for var in \
|
||||
ACO_DEBUG \
|
||||
ARTIFACTS_BASE_URL \
|
||||
ASAN_OPTIONS \
|
||||
BASE_SYSTEM_FORK_HOST_PREFIX \
|
||||
BASE_SYSTEM_MAINLINE_HOST_PREFIX \
|
||||
@@ -91,13 +90,13 @@ for var in \
|
||||
NIR_DEBUG \
|
||||
PAN_I_WANT_A_BROKEN_VULKAN_DRIVER \
|
||||
PAN_MESA_DEBUG \
|
||||
PANVK_DEBUG \
|
||||
PIGLIT_FRACTION \
|
||||
PIGLIT_NO_WINDOW \
|
||||
PIGLIT_OPTIONS \
|
||||
PIGLIT_PLATFORM \
|
||||
PIGLIT_PROFILES \
|
||||
PIGLIT_REPLAY_ARTIFACTS_BASE_URL \
|
||||
PIGLIT_REPLAY_DESCRIPTION_FILE \
|
||||
PIGLIT_REPLAY_DEVICE_NAME \
|
||||
PIGLIT_REPLAY_EXTRA_ARGS \
|
||||
PIGLIT_REPLAY_LOOP_TIMES \
|
||||
@@ -105,9 +104,7 @@ for var in \
|
||||
PIGLIT_REPLAY_SUBCOMMAND \
|
||||
PIGLIT_RESULTS \
|
||||
PIGLIT_TESTS \
|
||||
PIGLIT_TRACES_FILE \
|
||||
PIPELINE_ARTIFACTS_BASE \
|
||||
RADEON_DEBUG \
|
||||
RADV_DEBUG \
|
||||
RADV_PERFTEST \
|
||||
SKQP_ASSETS_DIR \
|
||||
|
@@ -7,10 +7,10 @@ set -ex
|
||||
|
||||
cd /
|
||||
|
||||
findmnt --mountpoint /proc || mount -t proc none /proc
|
||||
findmnt --mountpoint /sys || mount -t sysfs none /sys
|
||||
mount -t proc none /proc
|
||||
mount -t sysfs none /sys
|
||||
mount -t debugfs none /sys/kernel/debug
|
||||
findmnt --mountpoint /dev || mount -t devtmpfs none /dev
|
||||
mount -t devtmpfs none /dev || echo possibly already mounted
|
||||
mkdir -p /dev/pts
|
||||
mount -t devpts devpts /dev/pts
|
||||
mkdir /dev/shm
|
||||
|
@@ -46,7 +46,7 @@ DEPS=(
|
||||
wayland-protocols
|
||||
)
|
||||
|
||||
apk --no-cache add "${DEPS[@]}" "${EPHEMERAL[@]}"
|
||||
apk add "${DEPS[@]}" "${EPHEMERAL[@]}"
|
||||
|
||||
. .gitlab-ci/container/container_pre_build.sh
|
||||
|
||||
|
@@ -18,7 +18,7 @@ DEPS=(
|
||||
)
|
||||
|
||||
|
||||
apk --no-cache add "${DEPS[@]}" "${EPHEMERAL[@]}"
|
||||
apk add "${DEPS[@]}" "${EPHEMERAL[@]}"
|
||||
|
||||
. .gitlab-ci/container/container_pre_build.sh
|
||||
|
||||
|
@@ -12,7 +12,7 @@ pushd /platform/crosvm
|
||||
git checkout "$CROSVM_VERSION"
|
||||
git submodule update --init
|
||||
|
||||
VIRGLRENDERER_VERSION=747c6ae5b194ca551a79958a9a86c42bddcc4553
|
||||
VIRGLRENDERER_VERSION=10120c0d9ebdc00eae1b5c9f7c98fc0d198ba602
|
||||
rm -rf third_party/virglrenderer
|
||||
git clone --single-branch -b main --no-checkout https://gitlab.freedesktop.org/virgl/virglrenderer.git third_party/virglrenderer
|
||||
pushd third_party/virglrenderer
|
||||
|
@@ -1,16 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2086 # we want word splitting
|
||||
|
||||
# When changing this file, you need to bump the following
|
||||
# .gitlab-ci/image-tags.yml tags:
|
||||
# DEBIAN_BASE_TAG
|
||||
# DEBIAN_X86_64_TEST_ANDROID_TAG
|
||||
# KERNEL_ROOTFS_TAG
|
||||
|
||||
set -ex
|
||||
|
||||
DEQP_RUNNER_VERSION=0.18.0
|
||||
|
||||
if [ -n "${DEQP_RUNNER_GIT_TAG}${DEQP_RUNNER_GIT_REV}" ]; then
|
||||
# Build and install from source
|
||||
DEQP_RUNNER_CARGO_ARGS="--git ${DEQP_RUNNER_GIT_URL:-https://gitlab.freedesktop.org/anholt/deqp-runner.git}"
|
||||
@@ -24,7 +16,7 @@ if [ -n "${DEQP_RUNNER_GIT_TAG}${DEQP_RUNNER_GIT_REV}" ]; then
|
||||
DEQP_RUNNER_CARGO_ARGS="${DEQP_RUNNER_CARGO_ARGS} ${EXTRA_CARGO_ARGS}"
|
||||
else
|
||||
# Install from package registry
|
||||
DEQP_RUNNER_CARGO_ARGS="--version ${DEQP_RUNNER_VERSION} ${EXTRA_CARGO_ARGS} -- deqp-runner"
|
||||
DEQP_RUNNER_CARGO_ARGS="--version 0.16.0 ${EXTRA_CARGO_ARGS} -- deqp-runner"
|
||||
fi
|
||||
|
||||
if [ -z "$ANDROID_NDK_HOME" ]; then
|
||||
@@ -35,7 +27,7 @@ if [ -z "$ANDROID_NDK_HOME" ]; then
|
||||
else
|
||||
mkdir -p /deqp-runner
|
||||
pushd /deqp-runner
|
||||
git clone --branch v${DEQP_RUNNER_VERSION} --depth 1 https://gitlab.freedesktop.org/anholt/deqp-runner.git deqp-runner-git
|
||||
git clone --branch v0.16.1 --depth 1 https://gitlab.freedesktop.org/anholt/deqp-runner.git deqp-runner-git
|
||||
pushd deqp-runner-git
|
||||
|
||||
cargo install --locked \
|
||||
|
@@ -8,23 +8,17 @@
|
||||
# DEBIAN_X86_64_TEST_VK_TAG
|
||||
# KERNEL_ROOTFS_TAG
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
DEQP_VERSION=vulkan-cts-1.3.7.0
|
||||
set -ex
|
||||
|
||||
git config --global user.email "mesa@example.com"
|
||||
git config --global user.name "Mesa CI"
|
||||
git clone \
|
||||
https://github.com/KhronosGroup/VK-GL-CTS.git \
|
||||
-b $DEQP_VERSION \
|
||||
-b vulkan-cts-1.3.7.0 \
|
||||
--depth 1 \
|
||||
/VK-GL-CTS
|
||||
pushd /VK-GL-CTS
|
||||
|
||||
mkdir -p /deqp
|
||||
|
||||
echo "dEQP base version $DEQP_VERSION" > /deqp/version-log
|
||||
|
||||
# Patches to VulkanCTS may come from commits in their repo (listed in
|
||||
# cts_commits_to_backport) or patch files stored in our repo (in the patch
|
||||
# directory `$OLDPWD/.gitlab-ci/container/patches/` listed in cts_patch_files).
|
||||
@@ -32,17 +26,6 @@ echo "dEQP base version $DEQP_VERSION" > /deqp/version-log
|
||||
# patches.
|
||||
|
||||
cts_commits_to_backport=(
|
||||
# Take multiview into account for task shader inv. stats
|
||||
22aa3f4c59f6e1d4daebd5a8c9c05bce6cd3b63b
|
||||
|
||||
# Remove illegal mesh shader query tests
|
||||
2a87f7b25dc27188be0f0a003b2d7aef69d9002e
|
||||
|
||||
# Relax fragment shader invocations result verifications
|
||||
0d8bf6a2715f95907e9cf86a86876ff1f26c66fe
|
||||
|
||||
# Fix several issues in dynamic rendering basic tests
|
||||
c5453824b498c981c6ba42017d119f5de02a3e34
|
||||
)
|
||||
|
||||
for commit in "${cts_commits_to_backport[@]}"
|
||||
@@ -65,14 +48,13 @@ do
|
||||
git am < $OLDPWD/.gitlab-ci/container/patches/$patch
|
||||
done
|
||||
|
||||
echo "The following local patches are applied on top:" >> /deqp/version-log
|
||||
git log --reverse --oneline $DEQP_VERSION.. --format=%s | sed 's/^/- /' >> /deqp/version-log
|
||||
|
||||
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
|
||||
# libpng (sigh). The archives get their checksums checked anyway, and git
|
||||
# always goes through ssh or https.
|
||||
python3 external/fetch_sources.py --insecure
|
||||
|
||||
mkdir -p /deqp
|
||||
|
||||
# Save the testlog stylesheets:
|
||||
cp doc/testlog-stylesheet/testlog.{css,xsl} /deqp
|
||||
popd
|
||||
@@ -98,23 +80,17 @@ if [ "${DEQP_TARGET}" != 'android' ]; then
|
||||
fi
|
||||
|
||||
cmake -S /VK-GL-CTS -B . -G Ninja \
|
||||
-DDEQP_TARGET=${DEQP_TARGET:-default} \
|
||||
-DDEQP_TARGET=${DEQP_TARGET:-x11_glx} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
$EXTRA_CMAKE_ARGS
|
||||
|
||||
# Make sure `default` doesn't silently stop detecting one of the platforms we care about
|
||||
if [ "${DEQP_TARGET}" = 'default' ]; then
|
||||
grep -q DEQP_SUPPORT_WAYLAND=1 build.ninja
|
||||
grep -q DEQP_SUPPORT_X11=1 build.ninja
|
||||
grep -q DEQP_SUPPORT_XCB=1 build.ninja
|
||||
fi
|
||||
|
||||
mold --run ninja
|
||||
|
||||
if [ "${DEQP_TARGET}" = 'android' ]; then
|
||||
mv /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-android
|
||||
fi
|
||||
|
||||
git -C /VK-GL-CTS describe --long > /deqp/version
|
||||
|
||||
# Copy out the mustpass lists we want.
|
||||
mkdir /deqp/mustpass
|
||||
for mustpass in $(< /VK-GL-CTS/external/vulkancts/mustpass/main/vk-default.txt) ; do
|
||||
@@ -156,7 +132,8 @@ rm -rf /deqp/external/openglcts/modules/cts-runner
|
||||
rm -rf /deqp/modules/internal
|
||||
rm -rf /deqp/execserver
|
||||
rm -rf /deqp/framework
|
||||
find . -depth \( -iname '*cmake*' -o -name '*ninja*' -o -name '*.o' -o -name '*.a' \) -exec rm -rf {} \;
|
||||
# shellcheck disable=SC2038,SC2185 # TODO: rewrite find
|
||||
find -iname '*cmake*' -o -name '*ninja*' -o -name '*.o' -o -name '*.a' | xargs rm -rf
|
||||
${STRIP_CMD:-strip} external/vulkancts/modules/vulkan/deqp-vk
|
||||
${STRIP_CMD:-strip} external/openglcts/modules/glcts
|
||||
${STRIP_CMD:-strip} modules/*/deqp-*
|
||||
|
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2086 # we want word splitting
|
||||
|
||||
# When changing this file, you need to bump the following
|
||||
# .gitlab-ci/image-tags.yml tags:
|
||||
# DEBIAN_BUILD_TAG
|
||||
|
||||
set -ex
|
||||
|
||||
git clone https://github.com/microsoft/DirectX-Headers -b v1.611.0 --depth 1
|
||||
pushd DirectX-Headers
|
||||
meson setup build --backend=ninja --buildtype=release -Dbuild-test=false $EXTRA_MESON_ARGS
|
||||
meson install -C build
|
||||
popd
|
||||
rm -rf DirectX-Headers
|
@@ -5,12 +5,12 @@ set -ex
|
||||
|
||||
KDL_REVISION="5056f71b100a68b72b285c6fc845a66a2ed25985"
|
||||
|
||||
mkdir ci-kdl.git
|
||||
git clone \
|
||||
https://gitlab.freedesktop.org/gfx-ci/ci-kdl.git \
|
||||
--depth 1 \
|
||||
ci-kdl.git
|
||||
pushd ci-kdl.git
|
||||
git init
|
||||
git remote add origin https://gitlab.freedesktop.org/gfx-ci/ci-kdl.git
|
||||
git fetch --depth 1 origin ${KDL_REVISION}
|
||||
git checkout FETCH_HEAD
|
||||
git checkout ${KDL_REVISION}
|
||||
popd
|
||||
|
||||
python3 -m venv ci-kdl.venv
|
||||
|
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# Script used for Android and Fedora builds
|
||||
# shellcheck disable=SC2086 # we want word splitting
|
||||
|
||||
set -ex
|
||||
|
||||
export LIBDRM_VERSION=libdrm-2.4.119
|
||||
export LIBDRM_VERSION=libdrm-2.4.114
|
||||
|
||||
curl -L -O --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
https://dri.freedesktop.org/libdrm/"$LIBDRM_VERSION".tar.xz
|
||||
|
@@ -16,18 +16,18 @@ git checkout "$REV"
|
||||
patch -p1 <$OLDPWD/.gitlab-ci/piglit/disable-vs_in.diff
|
||||
cmake -S . -B . -G Ninja -DCMAKE_BUILD_TYPE=Release $PIGLIT_OPTS $EXTRA_CMAKE_ARGS
|
||||
ninja $PIGLIT_BUILD_TARGETS
|
||||
find . -depth \( -name .git -o -name '*ninja*' -o -iname '*cmake*' -o -name '*.[chao]' \) -exec rm -rf {} \;
|
||||
# shellcheck disable=SC2038,SC2185 # TODO: rewrite find
|
||||
find -name .git -o -name '*ninja*' -o -iname '*cmake*' -o -name '*.[chao]' | xargs rm -rf
|
||||
rm -rf target_api
|
||||
if [ "$PIGLIT_BUILD_TARGETS" = "piglit_replayer" ]; then
|
||||
find . -depth \
|
||||
! -regex "^\.$" \
|
||||
# shellcheck disable=SC2038,SC2185 # TODO: rewrite find
|
||||
find ! -regex "^\.$" \
|
||||
! -regex "^\.\/piglit.*" \
|
||||
! -regex "^\.\/framework.*" \
|
||||
! -regex "^\.\/bin$" \
|
||||
! -regex "^\.\/bin\/replayer\.py" \
|
||||
! -regex "^\.\/templates.*" \
|
||||
! -regex "^\.\/tests$" \
|
||||
! -regex "^\.\/tests\/replay\.py" \
|
||||
-exec rm -rf {} \; 2>/dev/null
|
||||
! -regex "^\.\/tests\/replay\.py" 2>/dev/null | xargs rm -rf
|
||||
fi
|
||||
popd
|
||||
|
@@ -11,11 +11,11 @@ set -ex
|
||||
mkdir -p "$HOME"/.cargo
|
||||
ln -s /usr/local/bin "$HOME"/.cargo/bin
|
||||
|
||||
# Rusticl requires at least Rust 1.66.0 and NAK requires 1.73.0
|
||||
# Rusticl requires at least Rust 1.66.0
|
||||
#
|
||||
# Also, pick a specific snapshot from rustup so the compiler doesn't drift on
|
||||
# us.
|
||||
RUST_VERSION=1.73.0-2023-10-05
|
||||
RUST_VERSION=1.66.1-2023-01-10
|
||||
|
||||
# For rust in Mesa, we use rustup to install. This lets us pick an arbitrary
|
||||
# version of the compiler, rather than whatever the container's Debian comes
|
||||
|
@@ -6,7 +6,7 @@
|
||||
# KERNEL_ROOTFS_TAG
|
||||
set -ex
|
||||
|
||||
VKD3D_PROTON_COMMIT="a0ccc383937903f4ca0997ce53e41ccce7f2f2ec"
|
||||
VKD3D_PROTON_COMMIT="2ad6cfdeaacdf47e2689e30a8fb5ac8193725f0d"
|
||||
|
||||
VKD3D_PROTON_DST_DIR="/vkd3d-proton-tests"
|
||||
VKD3D_PROTON_SRC_DIR="/vkd3d-proton-src"
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
VALIDATION_TAG="v1.3.269"
|
||||
VALIDATION_TAG="v1.3.263"
|
||||
|
||||
git clone -b "$VALIDATION_TAG" --single-branch --depth 1 https://github.com/KhronosGroup/Vulkan-ValidationLayers.git
|
||||
pushd Vulkan-ValidationLayers
|
||||
|
@@ -1,12 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
if test -f /etc/debian_version; then
|
||||
apt-get autoremove -y --purge
|
||||
fi
|
||||
|
||||
# Clean up any build cache
|
||||
rm -rf /root/.cache
|
||||
rm -rf /root/.cargo
|
||||
# Clean up any build cache for rust.
|
||||
rm -rf /.cargo
|
||||
|
||||
if test -x /usr/bin/ccache; then
|
||||
|
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
# When not using the mold linker (e.g. unsupported architecture), force
|
||||
# linkers to gold, since it's so much faster for building. We can't use
|
||||
# lld because we're on old debian and it's buggy. mingw fails meson builds
|
||||
# lld because we're on old debian and it's buggy. ming fails meson builds
|
||||
# with it with "meson.build:21:0: ERROR: Unable to determine dynamic linker"
|
||||
find /usr/bin -name \*-ld -o -name ld | \
|
||||
grep -v mingw | \
|
||||
|
@@ -8,61 +8,56 @@ export DEBIAN_FRONTEND=noninteractive
|
||||
export LLVM_VERSION="${LLVM_VERSION:=15}"
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at the end)
|
||||
EPHEMERAL=(
|
||||
)
|
||||
|
||||
DEPS=(
|
||||
"crossbuild-essential-$arch"
|
||||
"pkgconf:$arch"
|
||||
"libasan8:$arch"
|
||||
"libdrm-dev:$arch"
|
||||
"libelf-dev:$arch"
|
||||
"libexpat1-dev:$arch"
|
||||
"libffi-dev:$arch"
|
||||
"libpciaccess-dev:$arch"
|
||||
"libstdc++6:$arch"
|
||||
"libvulkan-dev:$arch"
|
||||
"libx11-dev:$arch"
|
||||
"libx11-xcb-dev:$arch"
|
||||
"libxcb-dri2-0-dev:$arch"
|
||||
"libxcb-dri3-dev:$arch"
|
||||
"libxcb-glx0-dev:$arch"
|
||||
"libxcb-present-dev:$arch"
|
||||
"libxcb-randr0-dev:$arch"
|
||||
"libxcb-shm0-dev:$arch"
|
||||
"libxcb-xfixes0-dev:$arch"
|
||||
"libxdamage-dev:$arch"
|
||||
"libxext-dev:$arch"
|
||||
"libxrandr-dev:$arch"
|
||||
"libxshmfence-dev:$arch"
|
||||
"libxxf86vm-dev:$arch"
|
||||
"libwayland-dev:$arch"
|
||||
)
|
||||
STABLE_EPHEMERAL=" \
|
||||
"
|
||||
|
||||
dpkg --add-architecture $arch
|
||||
|
||||
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install -y --no-remove "${DEPS[@]}" "${EPHEMERAL[@]}" \
|
||||
$EXTRA_LOCAL_PACKAGES
|
||||
apt-get install -y --no-remove \
|
||||
$EXTRA_LOCAL_PACKAGES \
|
||||
$STABLE_EPHEMERAL \
|
||||
crossbuild-essential-$arch \
|
||||
pkgconf:$arch \
|
||||
libasan8:$arch \
|
||||
libdrm-dev:$arch \
|
||||
libelf-dev:$arch \
|
||||
libexpat1-dev:$arch \
|
||||
libffi-dev:$arch \
|
||||
libpciaccess-dev:$arch \
|
||||
libstdc++6:$arch \
|
||||
libvulkan-dev:$arch \
|
||||
libx11-dev:$arch \
|
||||
libx11-xcb-dev:$arch \
|
||||
libxcb-dri2-0-dev:$arch \
|
||||
libxcb-dri3-dev:$arch \
|
||||
libxcb-glx0-dev:$arch \
|
||||
libxcb-present-dev:$arch \
|
||||
libxcb-randr0-dev:$arch \
|
||||
libxcb-shm0-dev:$arch \
|
||||
libxcb-xfixes0-dev:$arch \
|
||||
libxdamage-dev:$arch \
|
||||
libxext-dev:$arch \
|
||||
libxrandr-dev:$arch \
|
||||
libxshmfence-dev:$arch \
|
||||
libxxf86vm-dev:$arch \
|
||||
libwayland-dev:$arch
|
||||
|
||||
if [[ $arch != "armhf" ]]; then
|
||||
# We don't need clang-format for the crossbuilds, but the installed amd64
|
||||
# package will conflict with libclang. Uninstall clang-format (and its
|
||||
# problematic dependency) to fix.
|
||||
apt-get remove -y "clang-format-${LLVM_VERSION}" "libclang-cpp${LLVM_VERSION}"
|
||||
apt-get remove -y clang-format-${LLVM_VERSION} libclang-cpp${LLVM_VERSION}
|
||||
|
||||
# llvm-*-tools:$arch conflicts with python3:amd64. Install dependencies only
|
||||
# with apt-get, then force-install llvm-*-{dev,tools}:$arch with dpkg to get
|
||||
# around this.
|
||||
apt-get install -y --no-remove --no-install-recommends \
|
||||
"libclang-cpp${LLVM_VERSION}:$arch" \
|
||||
"libgcc-s1:$arch" \
|
||||
"libtinfo-dev:$arch" \
|
||||
"libz3-dev:$arch" \
|
||||
"llvm-${LLVM_VERSION}:$arch" \
|
||||
libclang-cpp${LLVM_VERSION}:$arch \
|
||||
libgcc-s1:$arch \
|
||||
libtinfo-dev:$arch \
|
||||
libz3-dev:$arch \
|
||||
llvm-${LLVM_VERSION}:$arch \
|
||||
zlib1g
|
||||
fi
|
||||
|
||||
@@ -73,19 +68,19 @@ fi
|
||||
|
||||
|
||||
# dependencies where we want a specific version
|
||||
MULTIARCH_PATH=$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)
|
||||
export EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/${MULTIARCH_PATH}"
|
||||
EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)"
|
||||
. .gitlab-ci/container/build-libdrm.sh
|
||||
|
||||
. .gitlab-ci/container/build-wayland.sh
|
||||
|
||||
. .gitlab-ci/container/build-directx-headers.sh
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
apt-get purge -y \
|
||||
$STABLE_EPHEMERAL
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
|
||||
# This needs to be done after container_post_build.sh, or apt-get breaks in there
|
||||
if [[ $arch != "armhf" ]]; then
|
||||
apt-get download llvm-"${LLVM_VERSION}"-{dev,tools}:"$arch"
|
||||
dpkg -i --force-depends llvm-"${LLVM_VERSION}"-*_"${arch}".deb
|
||||
rm llvm-"${LLVM_VERSION}"-*_"${arch}".deb
|
||||
apt-get download llvm-${LLVM_VERSION}-{dev,tools}:$arch
|
||||
dpkg -i --force-depends llvm-${LLVM_VERSION}-*_${arch}.deb
|
||||
rm llvm-${LLVM_VERSION}-*_${arch}.deb
|
||||
fi
|
||||
|
@@ -1,19 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2086 # we want word splitting
|
||||
|
||||
# When changing this file, you need to bump the following
|
||||
# .gitlab-ci/image-tags.yml tags:
|
||||
# DEBIAN_BUILD_TAG
|
||||
|
||||
set -ex
|
||||
|
||||
EPHEMERAL=(
|
||||
autoconf
|
||||
rdfind
|
||||
unzip
|
||||
)
|
||||
EPHEMERAL="\
|
||||
autoconf \
|
||||
rdfind \
|
||||
unzip \
|
||||
"
|
||||
|
||||
apt-get install -y --no-remove "${EPHEMERAL[@]}"
|
||||
apt-get install -y --no-remove $EPHEMERAL
|
||||
|
||||
# Fetch the NDK and extract just the toolchain we want.
|
||||
ndk=$ANDROID_NDK
|
||||
@@ -25,7 +21,7 @@ rm $ndk.zip
|
||||
# duplicate files. Turn them into hardlinks to save on container space.
|
||||
rdfind -makehardlinks true -makeresultsfile false /${ndk}/
|
||||
# Drop some large tools we won't use in this build.
|
||||
find /${ndk}/ -type f \( -iname '*clang-check*' -o -iname '*clang-tidy*' -o -iname '*lldb*' \) -exec rm -f {} \;
|
||||
find /${ndk}/ -type f | grep -E -i "clang-check|clang-tidy|lldb" | xargs rm -f
|
||||
|
||||
sh .gitlab-ci/container/create-android-ndk-pc.sh /$ndk zlib.pc "" "-lz" "1.2.3" $ANDROID_SDK_VERSION
|
||||
|
||||
@@ -34,13 +30,33 @@ sh .gitlab-ci/container/create-android-cross-file.sh /$ndk i686-linux-android x8
|
||||
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk aarch64-linux-android aarch64 armv8 $ANDROID_SDK_VERSION
|
||||
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk arm-linux-androideabi arm armv7hl $ANDROID_SDK_VERSION armv7a-linux-androideabi
|
||||
|
||||
# Not using build-libdrm.sh because we don't want its cleanup after building
|
||||
# each arch. Fetch and extract now.
|
||||
export LIBDRM_VERSION=libdrm-2.4.114
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
-O https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
|
||||
tar -xf $LIBDRM_VERSION.tar.xz && rm $LIBDRM_VERSION.tar.xz
|
||||
|
||||
for arch in \
|
||||
x86_64-linux-android \
|
||||
i686-linux-android \
|
||||
aarch64-linux-android \
|
||||
arm-linux-androideabi ; do
|
||||
EXTRA_MESON_ARGS="--cross-file=/cross_file-$arch.txt --libdir=lib/$arch -Dnouveau=disabled -Dintel=disabled" \
|
||||
. .gitlab-ci/container/build-libdrm.sh
|
||||
|
||||
cd $LIBDRM_VERSION
|
||||
rm -rf build-$arch
|
||||
meson setup build-$arch \
|
||||
--cross-file=/cross_file-$arch.txt \
|
||||
--libdir=lib/$arch \
|
||||
-Dnouveau=disabled \
|
||||
-Dvc4=disabled \
|
||||
-Detnaviv=disabled \
|
||||
-Dfreedreno=disabled \
|
||||
-Dintel=disabled \
|
||||
-Dcairo-tests=disabled \
|
||||
-Dvalgrind=disabled
|
||||
meson install -C build-$arch
|
||||
cd ..
|
||||
done
|
||||
|
||||
rm -rf $LIBDRM_VERSION
|
||||
@@ -90,4 +106,4 @@ done
|
||||
cd ..
|
||||
rm -rf $LIBELF_VERSION
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
apt-get purge -y $EPHEMERAL
|
||||
|
@@ -8,68 +8,67 @@ export LLVM_VERSION="${LLVM_VERSION:=15}"
|
||||
|
||||
apt-get -y install ca-certificates
|
||||
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/*
|
||||
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
|
||||
apt-get update
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at the end)
|
||||
EPHEMERAL=(
|
||||
libssl-dev
|
||||
)
|
||||
# Ephemeral packages (installed for this script and removed again at
|
||||
# the end)
|
||||
STABLE_EPHEMERAL=" \
|
||||
libssl-dev \
|
||||
"
|
||||
|
||||
DEPS=(
|
||||
apt-utils
|
||||
android-libext4-utils
|
||||
autoconf
|
||||
automake
|
||||
bc
|
||||
bison
|
||||
ccache
|
||||
cmake
|
||||
curl
|
||||
fastboot
|
||||
flex
|
||||
g++
|
||||
git
|
||||
glslang-tools
|
||||
kmod
|
||||
libasan8
|
||||
libdrm-dev
|
||||
libelf-dev
|
||||
libexpat1-dev
|
||||
libvulkan-dev
|
||||
libx11-dev
|
||||
libx11-xcb-dev
|
||||
libxcb-dri2-0-dev
|
||||
libxcb-dri3-dev
|
||||
libxcb-glx0-dev
|
||||
libxcb-present-dev
|
||||
libxcb-randr0-dev
|
||||
libxcb-shm0-dev
|
||||
libxcb-xfixes0-dev
|
||||
libxdamage-dev
|
||||
libxext-dev
|
||||
libxrandr-dev
|
||||
libxshmfence-dev
|
||||
libxxf86vm-dev
|
||||
libwayland-dev
|
||||
libwayland-egl-backend-dev
|
||||
"llvm-${LLVM_VERSION}-dev"
|
||||
ninja-build
|
||||
meson
|
||||
openssh-server
|
||||
pkgconf
|
||||
python3-mako
|
||||
python3-pil
|
||||
python3-pip
|
||||
python3-requests
|
||||
python3-setuptools
|
||||
u-boot-tools
|
||||
xz-utils
|
||||
zlib1g-dev
|
||||
zstd
|
||||
)
|
||||
|
||||
apt-get -y install "${DEPS[@]}" "${EPHEMERAL[@]}"
|
||||
apt-get -y install \
|
||||
${STABLE_EPHEMERAL} \
|
||||
apt-utils \
|
||||
android-libext4-utils \
|
||||
autoconf \
|
||||
automake \
|
||||
bc \
|
||||
bison \
|
||||
ccache \
|
||||
cmake \
|
||||
curl \
|
||||
debootstrap \
|
||||
fastboot \
|
||||
flex \
|
||||
g++ \
|
||||
git \
|
||||
glslang-tools \
|
||||
kmod \
|
||||
libasan8 \
|
||||
libdrm-dev \
|
||||
libelf-dev \
|
||||
libexpat1-dev \
|
||||
libvulkan-dev \
|
||||
libx11-dev \
|
||||
libx11-xcb-dev \
|
||||
libxcb-dri2-0-dev \
|
||||
libxcb-dri3-dev \
|
||||
libxcb-glx0-dev \
|
||||
libxcb-present-dev \
|
||||
libxcb-randr0-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxdamage-dev \
|
||||
libxext-dev \
|
||||
libxrandr-dev \
|
||||
libxshmfence-dev \
|
||||
libxxf86vm-dev \
|
||||
libwayland-dev \
|
||||
libwayland-egl-backend-dev \
|
||||
llvm-${LLVM_VERSION}-dev \
|
||||
ninja-build \
|
||||
meson \
|
||||
openssh-server \
|
||||
pkgconf \
|
||||
python3-mako \
|
||||
python3-pil \
|
||||
python3-pip \
|
||||
python3-requests \
|
||||
python3-setuptools \
|
||||
u-boot-tools \
|
||||
xz-utils \
|
||||
zlib1g-dev \
|
||||
zstd
|
||||
|
||||
pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
|
||||
|
||||
@@ -82,6 +81,6 @@ arch=armhf
|
||||
|
||||
. .gitlab-ci/container/build-wayland.sh
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
apt-get purge -y $STABLE_EPHEMERAL
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
|
@@ -9,29 +9,23 @@ set -e
|
||||
set -o xtrace
|
||||
|
||||
############### Install packages for baremetal testing
|
||||
DEPS=(
|
||||
cpio
|
||||
curl
|
||||
fastboot
|
||||
netcat-openbsd
|
||||
openssh-server
|
||||
procps
|
||||
python3-distutils
|
||||
python3-filelock
|
||||
python3-fire
|
||||
python3-minimal
|
||||
python3-serial
|
||||
rsync
|
||||
snmp
|
||||
zstd
|
||||
)
|
||||
|
||||
apt-get install -y ca-certificates
|
||||
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/*
|
||||
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
|
||||
apt-get update
|
||||
|
||||
apt-get install -y --no-remove "${DEPS[@]}"
|
||||
apt-get install -y --no-remove \
|
||||
cpio \
|
||||
curl \
|
||||
fastboot \
|
||||
netcat-openbsd \
|
||||
openssh-server \
|
||||
procps \
|
||||
python3-distutils \
|
||||
python3-minimal \
|
||||
python3-serial \
|
||||
rsync \
|
||||
snmp \
|
||||
zstd
|
||||
|
||||
# setup SNMPv2 SMI MIB
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
|
||||
arch=ppc64el
|
||||
|
||||
|
@@ -1,18 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
arch=s390x
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at the end)
|
||||
EPHEMERAL=(
|
||||
libssl-dev
|
||||
)
|
||||
STABLE_EPHEMERAL="libssl-dev"
|
||||
|
||||
apt-get -y install "${EPHEMERAL[@]}"
|
||||
apt-get -y install "$STABLE_EPHEMERAL"
|
||||
|
||||
. .gitlab-ci/container/build-mold.sh
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
apt-get purge -y "$STABLE_EPHEMERAL"
|
||||
|
||||
. .gitlab-ci/container/cross_build.sh
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
|
||||
arch=i386
|
||||
|
||||
|
15
.gitlab-ci/container/debian/x86_64_build-base-wine.sh
Normal file
15
.gitlab-ci/container/debian/x86_64_build-base-wine.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
# Installing wine, need this for testing mingw or nine
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-remove \
|
||||
wine \
|
||||
wine64 \
|
||||
xvfb
|
||||
|
||||
# Used to initialize the Wine environment to reduce build time
|
||||
wine wineboot.exe --init
|
@@ -1,10 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC2086 # we want word splitting
|
||||
|
||||
# When changing this file, you need to bump the following
|
||||
# .gitlab-ci/image-tags.yml tags:
|
||||
# DEBIAN_BUILD_TAG
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
@@ -13,86 +9,85 @@ export LLVM_VERSION="${LLVM_VERSION:=15}"
|
||||
|
||||
apt-get install -y ca-certificates
|
||||
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/*
|
||||
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at
|
||||
# the end)
|
||||
EPHEMERAL=(
|
||||
)
|
||||
|
||||
DEPS=(
|
||||
apt-utils
|
||||
bison
|
||||
ccache
|
||||
curl
|
||||
"clang-format-${LLVM_VERSION}"
|
||||
dpkg-cross
|
||||
findutils
|
||||
flex
|
||||
g++
|
||||
cmake
|
||||
gcc
|
||||
git
|
||||
glslang-tools
|
||||
kmod
|
||||
"libclang-${LLVM_VERSION}-dev"
|
||||
"libclang-cpp${LLVM_VERSION}-dev"
|
||||
"libclang-common-${LLVM_VERSION}-dev"
|
||||
libelf-dev
|
||||
libepoxy-dev
|
||||
libexpat1-dev
|
||||
libgtk-3-dev
|
||||
"libllvm${LLVM_VERSION}"
|
||||
libomxil-bellagio-dev
|
||||
libpciaccess-dev
|
||||
libunwind-dev
|
||||
libva-dev
|
||||
libvdpau-dev
|
||||
libvulkan-dev
|
||||
libx11-dev
|
||||
libx11-xcb-dev
|
||||
libxext-dev
|
||||
libxml2-utils
|
||||
libxrandr-dev
|
||||
libxrender-dev
|
||||
libxshmfence-dev
|
||||
libxxf86vm-dev
|
||||
libwayland-egl-backend-dev
|
||||
make
|
||||
ninja-build
|
||||
openssh-server
|
||||
pkgconf
|
||||
python3-mako
|
||||
python3-pil
|
||||
python3-pip
|
||||
python3-ply
|
||||
python3-requests
|
||||
python3-setuptools
|
||||
qemu-user
|
||||
valgrind
|
||||
x11proto-dri2-dev
|
||||
x11proto-gl-dev
|
||||
x11proto-randr-dev
|
||||
xz-utils
|
||||
zlib1g-dev
|
||||
zstd
|
||||
)
|
||||
STABLE_EPHEMERAL=" \
|
||||
"
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install -y --no-remove "${DEPS[@]}" "${EPHEMERAL[@]}" \
|
||||
$EXTRA_LOCAL_PACKAGES
|
||||
apt-get install -y --no-remove \
|
||||
$EXTRA_LOCAL_PACKAGES \
|
||||
$STABLE_EPHEMERAL \
|
||||
apt-utils \
|
||||
bison \
|
||||
ccache \
|
||||
curl \
|
||||
clang-format-${LLVM_VERSION} \
|
||||
dpkg-cross \
|
||||
findutils \
|
||||
flex \
|
||||
g++ \
|
||||
cmake \
|
||||
gcc \
|
||||
git \
|
||||
glslang-tools \
|
||||
kmod \
|
||||
libclang-${LLVM_VERSION}-dev \
|
||||
libclang-cpp${LLVM_VERSION}-dev \
|
||||
libclang-common-${LLVM_VERSION}-dev \
|
||||
libelf-dev \
|
||||
libepoxy-dev \
|
||||
libexpat1-dev \
|
||||
libgtk-3-dev \
|
||||
libllvm${LLVM_VERSION} \
|
||||
libomxil-bellagio-dev \
|
||||
libpciaccess-dev \
|
||||
libunwind-dev \
|
||||
libva-dev \
|
||||
libvdpau-dev \
|
||||
libvulkan-dev \
|
||||
libx11-dev \
|
||||
libx11-xcb-dev \
|
||||
libxext-dev \
|
||||
libxml2-utils \
|
||||
libxrandr-dev \
|
||||
libxrender-dev \
|
||||
libxshmfence-dev \
|
||||
libxxf86vm-dev \
|
||||
libwayland-egl-backend-dev \
|
||||
make \
|
||||
ninja-build \
|
||||
openssh-server \
|
||||
pkgconf \
|
||||
python3-mako \
|
||||
python3-pil \
|
||||
python3-pip \
|
||||
python3-ply \
|
||||
python3-requests \
|
||||
python3-setuptools \
|
||||
qemu-user \
|
||||
valgrind \
|
||||
x11proto-dri2-dev \
|
||||
x11proto-gl-dev \
|
||||
x11proto-randr-dev \
|
||||
xz-utils \
|
||||
zlib1g-dev \
|
||||
zstd
|
||||
|
||||
# Needed for ci-fairy, this revision is able to upload files to S3
|
||||
pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
|
||||
|
||||
# We need at least 1.3.1 for rusticl
|
||||
pip3 install --break-system-packages 'meson==1.3.1'
|
||||
# We need at least 1.2 for Rust's `debug_assertions`
|
||||
pip3 install --break-system-packages meson==1.2.0
|
||||
|
||||
. .gitlab-ci/container/build-rust.sh
|
||||
|
||||
. .gitlab-ci/container/debian/x86_64_build-base-wine.sh
|
||||
|
||||
############### Uninstall ephemeral packages
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
apt-get purge -y $STABLE_EPHEMERAL
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
|
78
.gitlab-ci/container/debian/x86_64_build-mingw-patch.sh
Normal file
78
.gitlab-ci/container/debian/x86_64_build-mingw-patch.sh
Normal file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC2086 # we want word splitting
|
||||
|
||||
set -e
|
||||
|
||||
# Pull packages from msys2 repository that can be directly used.
|
||||
# We can use https://packages.msys2.org/ to retrieve the newest package
|
||||
mkdir ~/tmp
|
||||
pushd ~/tmp
|
||||
MINGW_PACKET_LIST="
|
||||
mingw-w64-x86_64-headers-git-10.0.0.r14.ga08c638f8-1-any.pkg.tar.zst
|
||||
mingw-w64-x86_64-vulkan-loader-1.3.211-1-any.pkg.tar.zst
|
||||
mingw-w64-x86_64-libelf-0.8.13-6-any.pkg.tar.zst
|
||||
mingw-w64-x86_64-zlib-1.2.12-1-any.pkg.tar.zst
|
||||
mingw-w64-x86_64-zstd-1.5.2-2-any.pkg.tar.zst
|
||||
"
|
||||
|
||||
for i in $MINGW_PACKET_LIST
|
||||
do
|
||||
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
-O "https://mirror.msys2.org/mingw/mingw64/$i"
|
||||
tar xf $i --strip-components=1 -C /usr/x86_64-w64-mingw32/
|
||||
done
|
||||
popd
|
||||
rm -rf ~/tmp
|
||||
|
||||
mkdir -p /usr/x86_64-w64-mingw32/bin
|
||||
|
||||
# The output of `wine64 llvm-config --system-libs --cxxflags mcdisassembler`
|
||||
# containes absolute path like '-IZ:'
|
||||
# The sed is used to replace `-IZ:/usr/x86_64-w64-mingw32/include`
|
||||
# to `-I/usr/x86_64-w64-mingw32/include`
|
||||
|
||||
# Debian's pkg-config wrapers for mingw are broken, and there's no sign that
|
||||
# they're going to be fixed, so we'll just have to fix it ourselves
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492
|
||||
cat >/usr/x86_64-w64-mingw32/bin/pkg-config <<EOF
|
||||
#!/bin/sh
|
||||
|
||||
PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig:/usr/x86_64-w64-mingw32/share/pkgconfig pkg-config \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/pkg-config
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/llvm-config <<EOF
|
||||
#!/bin/sh
|
||||
wine64 llvm-config \$@ | sed -e "s,Z:/,/,gi"
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-config
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/clang <<EOF
|
||||
#!/bin/sh
|
||||
wine64 clang \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/clang
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/llvm-as <<EOF
|
||||
#!/bin/sh
|
||||
wine64 llvm-as \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-as
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/llvm-link <<EOF
|
||||
#!/bin/sh
|
||||
wine64 llvm-link \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-link
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/opt <<EOF
|
||||
#!/bin/sh
|
||||
wine64 opt \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/opt
|
||||
|
||||
cat >/usr/x86_64-w64-mingw32/bin/llvm-spirv <<EOF
|
||||
#!/bin/sh
|
||||
wine64 llvm-spirv \$@
|
||||
EOF
|
||||
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-spirv
|
125
.gitlab-ci/container/debian/x86_64_build-mingw-source-deps.sh
Normal file
125
.gitlab-ci/container/debian/x86_64_build-mingw-source-deps.sh
Normal file
@@ -0,0 +1,125 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC2086 # we want word splitting
|
||||
|
||||
set -e
|
||||
|
||||
# Building libdrm (libva dependency)
|
||||
. .gitlab-ci/container/build-libdrm.sh
|
||||
|
||||
wd=$PWD
|
||||
CMAKE_TOOLCHAIN_MINGW_PATH=$wd/.gitlab-ci/container/debian/x86_mingw-toolchain.cmake
|
||||
mkdir -p ~/tmp
|
||||
pushd ~/tmp
|
||||
|
||||
# Building DirectX-Headers
|
||||
git clone https://github.com/microsoft/DirectX-Headers -b v1.606.4 --depth 1
|
||||
mkdir -p DirectX-Headers/build
|
||||
pushd DirectX-Headers/build
|
||||
meson .. \
|
||||
--backend=ninja \
|
||||
--buildtype=release -Dbuild-test=false \
|
||||
-Dprefix=/usr/x86_64-w64-mingw32/ \
|
||||
--cross-file=$wd/.gitlab-ci/x86_64-w64-mingw32
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
# Building libva
|
||||
git clone https://github.com/intel/libva
|
||||
pushd libva/
|
||||
# libva-win32 is released with libva version 2.17 (see https://github.com/intel/libva/releases/tag/2.17.0)
|
||||
git checkout 2.17.0
|
||||
popd
|
||||
# libva already has a build dir in their repo, use builddir instead
|
||||
mkdir -p libva/builddir
|
||||
pushd libva/builddir
|
||||
meson .. \
|
||||
--backend=ninja \
|
||||
--buildtype=release \
|
||||
-Dprefix=/usr/x86_64-w64-mingw32/ \
|
||||
--cross-file=$wd/.gitlab-ci/x86_64-w64-mingw32
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
export VULKAN_SDK_VERSION=1.3.211.0
|
||||
|
||||
# Building SPIRV Tools
|
||||
git clone -b sdk-$VULKAN_SDK_VERSION --depth=1 \
|
||||
https://github.com/KhronosGroup/SPIRV-Tools SPIRV-Tools
|
||||
|
||||
git clone -b sdk-$VULKAN_SDK_VERSION --depth=1 \
|
||||
https://github.com/KhronosGroup/SPIRV-Headers SPIRV-Tools/external/SPIRV-Headers
|
||||
|
||||
mkdir -p SPIRV-Tools/build
|
||||
pushd SPIRV-Tools/build
|
||||
cmake .. \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
|
||||
-GNinja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=1 \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
# Building LLVM
|
||||
git clone -b release/15.x --depth=1 \
|
||||
https://github.com/llvm/llvm-project llvm-project
|
||||
|
||||
git clone -b v15.0.0 --depth=1 \
|
||||
https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/SPIRV-LLVM-Translator
|
||||
|
||||
mkdir llvm-project/build
|
||||
pushd llvm-project/build
|
||||
cmake ../llvm \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
|
||||
-GNinja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=1 \
|
||||
-DLLVM_ENABLE_RTTI=ON \
|
||||
-DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$PWD/../../SPIRV-Tools/external/SPIRV-Headers \
|
||||
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$PWD/../../SPIRV-Tools/external/SPIRV-Headers \
|
||||
-DLLVM_ENABLE_PROJECTS="clang" \
|
||||
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" \
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=TRUE \
|
||||
-DLLVM_ENABLE_ASSERTIONS=TRUE \
|
||||
-DLLVM_INCLUDE_UTILS=OFF \
|
||||
-DLLVM_INCLUDE_RUNTIMES=OFF \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
||||
-DLLVM_INCLUDE_GO_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF \
|
||||
-DLLVM_BUILD_LLVM_C_DYLIB=OFF \
|
||||
-DLLVM_ENABLE_DIA_SDK=OFF \
|
||||
-DCLANG_BUILD_TOOLS=ON \
|
||||
-DLLVM_SPIRV_INCLUDE_TESTS=OFF
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
# Building libclc
|
||||
mkdir llvm-project/build-libclc
|
||||
pushd llvm-project/build-libclc
|
||||
cmake ../libclc \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
|
||||
-GNinja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=1 \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
|
||||
-DCMAKE_CXX_FLAGS="-m64" \
|
||||
-DLLVM_CONFIG="/usr/x86_64-w64-mingw32/bin/llvm-config" \
|
||||
-DLLVM_CLANG="/usr/x86_64-w64-mingw32/bin/clang" \
|
||||
-DLLVM_AS="/usr/x86_64-w64-mingw32/bin/llvm-as" \
|
||||
-DLLVM_LINK="/usr/x86_64-w64-mingw32/bin/llvm-link" \
|
||||
-DLLVM_OPT="/usr/x86_64-w64-mingw32/bin/opt" \
|
||||
-DLLVM_SPIRV="/usr/x86_64-w64-mingw32/bin/llvm-spirv" \
|
||||
-DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-"
|
||||
|
||||
ninja install
|
||||
popd
|
||||
|
||||
popd # ~/tmp
|
||||
|
||||
# Cleanup ~/tmp
|
||||
rm -rf ~/tmp
|
13
.gitlab-ci/container/debian/x86_64_build-mingw.sh
Normal file
13
.gitlab-ci/container/debian/x86_64_build-mingw.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-remove \
|
||||
zstd \
|
||||
g++-mingw-w64-i686 \
|
||||
g++-mingw-w64-x86-64
|
||||
|
||||
. .gitlab-ci/container/debian/x86_64_build-mingw-patch.sh
|
||||
. .gitlab-ci/container/debian/x86_64_build-mingw-source-deps.sh
|
@@ -12,52 +12,49 @@ export DEBIAN_FRONTEND=noninteractive
|
||||
export LLVM_VERSION="${LLVM_VERSION:=15}"
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at the end)
|
||||
EPHEMERAL=(
|
||||
autoconf
|
||||
automake
|
||||
autotools-dev
|
||||
bzip2
|
||||
libtool
|
||||
libssl-dev
|
||||
)
|
||||
|
||||
DEPS=(
|
||||
check
|
||||
"clang-${LLVM_VERSION}"
|
||||
libasan8
|
||||
libarchive-dev
|
||||
libdrm-dev
|
||||
"libclang-cpp${LLVM_VERSION}-dev"
|
||||
libgbm-dev
|
||||
libglvnd-dev
|
||||
liblua5.3-dev
|
||||
libxcb-dri2-0-dev
|
||||
libxcb-dri3-dev
|
||||
libxcb-glx0-dev
|
||||
libxcb-present-dev
|
||||
libxcb-randr0-dev
|
||||
libxcb-shm0-dev
|
||||
libxcb-sync-dev
|
||||
libxcb-xfixes0-dev
|
||||
libxcb1-dev
|
||||
libxml2-dev
|
||||
"llvm-${LLVM_VERSION}-dev"
|
||||
ocl-icd-opencl-dev
|
||||
python3-pip
|
||||
python3-venv
|
||||
procps
|
||||
spirv-tools
|
||||
shellcheck
|
||||
strace
|
||||
time
|
||||
yamllint
|
||||
zstd
|
||||
)
|
||||
STABLE_EPHEMERAL=" \
|
||||
autoconf \
|
||||
automake \
|
||||
autotools-dev \
|
||||
bzip2 \
|
||||
libtool \
|
||||
libssl-dev \
|
||||
"
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install -y --no-remove \
|
||||
"${DEPS[@]}" "${EPHEMERAL[@]}"
|
||||
$STABLE_EPHEMERAL \
|
||||
check \
|
||||
clang-${LLVM_VERSION} \
|
||||
libasan8 \
|
||||
libarchive-dev \
|
||||
libdrm-dev \
|
||||
libclang-cpp${LLVM_VERSION}-dev \
|
||||
libgbm-dev \
|
||||
libglvnd-dev \
|
||||
liblua5.3-dev \
|
||||
libxcb-dri2-0-dev \
|
||||
libxcb-dri3-dev \
|
||||
libxcb-glx0-dev \
|
||||
libxcb-present-dev \
|
||||
libxcb-randr0-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-sync-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxcb1-dev \
|
||||
libxml2-dev \
|
||||
llvm-${LLVM_VERSION}-dev \
|
||||
ocl-icd-opencl-dev \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
procps \
|
||||
spirv-tools \
|
||||
shellcheck \
|
||||
strace \
|
||||
time \
|
||||
yamllint \
|
||||
zstd
|
||||
|
||||
|
||||
. .gitlab-ci/container/container_pre_build.sh
|
||||
@@ -83,7 +80,12 @@ rm -rf $XORGMACROS_VERSION
|
||||
|
||||
. .gitlab-ci/container/build-shader-db.sh
|
||||
|
||||
. .gitlab-ci/container/build-directx-headers.sh
|
||||
git clone https://github.com/microsoft/DirectX-Headers -b v1.711.3-preview --depth 1
|
||||
pushd DirectX-Headers
|
||||
meson setup build --backend=ninja --buildtype=release -Dbuild-test=false
|
||||
meson install -C build
|
||||
popd
|
||||
rm -rf DirectX-Headers
|
||||
|
||||
python3 -m pip install --break-system-packages -r .gitlab-ci/lava/requirements.txt
|
||||
|
||||
@@ -96,6 +98,7 @@ RUSTFLAGS='-L native=/usr/local/lib' cargo install \
|
||||
|
||||
############### Uninstall the build software
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
apt-get purge -y \
|
||||
$STABLE_EPHEMERAL
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
|
8
.gitlab-ci/container/debian/x86_64_mingw-toolchain.cmake
Normal file
8
.gitlab-ci/container/debian/x86_64_mingw-toolchain.cmake
Normal file
@@ -0,0 +1,8 @@
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(CMAKE_SYSROOT /usr/x86_64-w64-mingw32/)
|
||||
set(ENV{PKG_CONFIG} /usr/x86_64-w64-mingw32/bin/pkgconf)
|
||||
|
||||
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix)
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
|
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# The relative paths in this file only become valid at runtime.
|
||||
# shellcheck disable=SC1091
|
||||
# shellcheck disable=SC2086 # we want word splitting
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
@@ -8,22 +9,20 @@ set -o xtrace
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at the end)
|
||||
EPHEMERAL=(
|
||||
build-essential:native
|
||||
ccache
|
||||
cmake
|
||||
config-package-dev
|
||||
debhelper-compat
|
||||
dpkg-dev
|
||||
ninja-build
|
||||
unzip
|
||||
)
|
||||
STABLE_EPHEMERAL=" \
|
||||
ccache \
|
||||
unzip \
|
||||
dpkg-dev \
|
||||
build-essential:native \
|
||||
config-package-dev \
|
||||
debhelper-compat \
|
||||
cmake \
|
||||
ninja-build \
|
||||
"
|
||||
|
||||
DEPS=(
|
||||
iproute2
|
||||
)
|
||||
apt-get install -y --no-remove --no-install-recommends \
|
||||
"${DEPS[@]}" "${EPHEMERAL[@]}"
|
||||
$STABLE_EPHEMERAL \
|
||||
iproute2
|
||||
|
||||
############### Building ...
|
||||
|
||||
@@ -34,9 +33,9 @@ apt-get install -y --no-remove --no-install-recommends \
|
||||
# Fetch the NDK and extract just the toolchain we want.
|
||||
ndk=$ANDROID_NDK
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
|
||||
-o "$ndk.zip" "https://dl.google.com/android/repository/$ndk-linux.zip"
|
||||
unzip -d / "$ndk.zip"
|
||||
rm "$ndk.zip"
|
||||
-o $ndk.zip https://dl.google.com/android/repository/$ndk-linux.zip
|
||||
unzip -d / $ndk.zip
|
||||
rm $ndk.zip
|
||||
|
||||
############### Build dEQP runner
|
||||
|
||||
@@ -92,6 +91,9 @@ usermod -a -G kvm,cvdnetwork root
|
||||
|
||||
rm -rf "/${ndk:?}"
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
ccache --show-stats
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
apt-get purge -y \
|
||||
$STABLE_EPHEMERAL
|
||||
|
||||
apt-get autoremove -y --purge
|
@@ -14,92 +14,51 @@ apt-get install -y ca-certificates gnupg2 software-properties-common
|
||||
|
||||
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/*
|
||||
|
||||
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
|
||||
|
||||
export LLVM_VERSION="${LLVM_VERSION:=15}"
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at the end)
|
||||
EPHEMERAL=(
|
||||
autoconf
|
||||
automake
|
||||
bc
|
||||
bison
|
||||
bzip2
|
||||
ccache
|
||||
cmake
|
||||
"clang-${LLVM_VERSION}"
|
||||
flex
|
||||
glslang-tools
|
||||
g++
|
||||
libasound2-dev
|
||||
libcap-dev
|
||||
"libclang-cpp${LLVM_VERSION}-dev"
|
||||
libdrm-dev
|
||||
libegl-dev
|
||||
libelf-dev
|
||||
libepoxy-dev
|
||||
libgbm-dev
|
||||
libpciaccess-dev
|
||||
libssl-dev
|
||||
libvulkan-dev
|
||||
libwayland-dev
|
||||
libx11-xcb-dev
|
||||
libxext-dev
|
||||
"llvm-${LLVM_VERSION}-dev"
|
||||
make
|
||||
meson
|
||||
openssh-server
|
||||
patch
|
||||
pkgconf
|
||||
protobuf-compiler
|
||||
python3-dev
|
||||
python3-pip
|
||||
python3-setuptools
|
||||
python3-wheel
|
||||
spirv-tools
|
||||
wayland-protocols
|
||||
xz-utils
|
||||
)
|
||||
|
||||
DEPS=(
|
||||
apt-utils
|
||||
curl
|
||||
git
|
||||
git-lfs
|
||||
inetutils-syslogd
|
||||
iptables
|
||||
jq
|
||||
libasan8
|
||||
libdrm2
|
||||
libexpat1
|
||||
"libllvm${LLVM_VERSION}"
|
||||
liblz4-1
|
||||
libpng16-16
|
||||
libpython3.11
|
||||
libvulkan1
|
||||
libwayland-client0
|
||||
libwayland-server0
|
||||
libxcb-ewmh2
|
||||
libxcb-randr0
|
||||
libxcb-xfixes0
|
||||
libxkbcommon0
|
||||
libxrandr2
|
||||
libxrender1
|
||||
python3-mako
|
||||
python3-numpy
|
||||
python3-packaging
|
||||
python3-pil
|
||||
python3-requests
|
||||
python3-six
|
||||
python3-yaml
|
||||
socat
|
||||
vulkan-tools
|
||||
waffle-utils
|
||||
xauth
|
||||
xvfb
|
||||
zlib1g
|
||||
zstd
|
||||
)
|
||||
# Ephemeral packages (installed for this script and removed again at
|
||||
# the end)
|
||||
STABLE_EPHEMERAL=" \
|
||||
autoconf \
|
||||
automake \
|
||||
bc \
|
||||
bison \
|
||||
bzip2 \
|
||||
ccache \
|
||||
cmake \
|
||||
clang-${LLVM_VERSION} \
|
||||
flex \
|
||||
glslang-tools \
|
||||
g++ \
|
||||
libasound2-dev \
|
||||
libcap-dev \
|
||||
libclang-cpp${LLVM_VERSION}-dev \
|
||||
libdrm-dev \
|
||||
libegl-dev \
|
||||
libelf-dev \
|
||||
libepoxy-dev \
|
||||
libgbm-dev \
|
||||
libpciaccess-dev \
|
||||
libssl-dev
|
||||
libvulkan-dev \
|
||||
libwayland-dev \
|
||||
libx11-xcb-dev \
|
||||
libxext-dev \
|
||||
llvm-${LLVM_VERSION}-dev \
|
||||
make \
|
||||
meson \
|
||||
openssh-server \
|
||||
patch \
|
||||
pkgconf \
|
||||
protobuf-compiler \
|
||||
python3-dev \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
spirv-tools \
|
||||
wayland-protocols \
|
||||
xz-utils \
|
||||
"
|
||||
|
||||
apt-get update
|
||||
apt-get dist-upgrade -y
|
||||
@@ -107,9 +66,48 @@ apt-get dist-upgrade -y
|
||||
apt-get install --purge -y \
|
||||
sysvinit-core libelogind0
|
||||
|
||||
apt-get install -y --no-remove "${DEPS[@]}"
|
||||
apt-get install -y --no-remove \
|
||||
apt-utils \
|
||||
curl \
|
||||
git \
|
||||
git-lfs \
|
||||
inetutils-syslogd \
|
||||
iptables \
|
||||
jq \
|
||||
libasan8 \
|
||||
libdrm2 \
|
||||
libexpat1 \
|
||||
libllvm${LLVM_VERSION} \
|
||||
liblz4-1 \
|
||||
libpng16-16 \
|
||||
libpython3.11 \
|
||||
libvulkan1 \
|
||||
libwayland-client0 \
|
||||
libwayland-server0 \
|
||||
libxcb-ewmh2 \
|
||||
libxcb-randr0 \
|
||||
libxcb-xfixes0 \
|
||||
libxkbcommon0 \
|
||||
libxrandr2 \
|
||||
libxrender1 \
|
||||
python3-mako \
|
||||
python3-numpy \
|
||||
python3-packaging \
|
||||
python3-pil \
|
||||
python3-requests \
|
||||
python3-six \
|
||||
python3-yaml \
|
||||
socat \
|
||||
vulkan-tools \
|
||||
waffle-utils \
|
||||
xauth \
|
||||
xvfb \
|
||||
zlib1g \
|
||||
zstd
|
||||
|
||||
apt-get install -y --no-install-recommends \
|
||||
$STABLE_EPHEMERAL
|
||||
|
||||
apt-get install -y --no-install-recommends "${EPHEMERAL[@]}"
|
||||
|
||||
. .gitlab-ci/container/container_pre_build.sh
|
||||
|
||||
@@ -152,9 +150,11 @@ pip3 install --break-system-packages yq
|
||||
############### Build dEQP runner
|
||||
. .gitlab-ci/container/build-deqp-runner.sh
|
||||
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
|
||||
rm -rf /root/.cargo
|
||||
rm -rf /root/.rustup
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
ccache --show-stats
|
||||
|
||||
apt-get purge -y $STABLE_EPHEMERAL
|
||||
|
||||
apt-get autoremove -y --purge
|
||||
|
@@ -10,62 +10,60 @@ export LLVM_VERSION="${LLVM_VERSION:=15}"
|
||||
apt-get install -y libelogind0 # this interfere with systemd deps, install separately
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at the end)
|
||||
EPHEMERAL=(
|
||||
bzip2
|
||||
ccache
|
||||
"clang-${LLVM_VERSION}"
|
||||
cmake
|
||||
g++
|
||||
glslang-tools
|
||||
libasound2-dev
|
||||
libcap-dev
|
||||
"libclang-cpp${LLVM_VERSION}-dev"
|
||||
libdrm-dev
|
||||
libgles2-mesa-dev
|
||||
libpciaccess-dev
|
||||
libpng-dev
|
||||
libudev-dev
|
||||
libvulkan-dev
|
||||
libwaffle-dev
|
||||
libwayland-dev
|
||||
libx11-xcb-dev
|
||||
libxcb-dri2-0-dev
|
||||
libxkbcommon-dev
|
||||
libxrandr-dev
|
||||
libxrender-dev
|
||||
"llvm-${LLVM_VERSION}-dev"
|
||||
make
|
||||
meson
|
||||
ocl-icd-opencl-dev
|
||||
patch
|
||||
pkgconf
|
||||
python3-distutils
|
||||
xz-utils
|
||||
)
|
||||
|
||||
DEPS=(
|
||||
clinfo
|
||||
iptables
|
||||
"libclang-common-${LLVM_VERSION}-dev"
|
||||
"libclang-cpp${LLVM_VERSION}"
|
||||
libcap2
|
||||
libegl1
|
||||
libepoxy0
|
||||
libfdt1
|
||||
libxcb-shm0
|
||||
ocl-icd-libopencl1
|
||||
python3-lxml
|
||||
python3-renderdoc
|
||||
python3-simplejson
|
||||
spirv-tools
|
||||
sysvinit-core
|
||||
weston
|
||||
)
|
||||
STABLE_EPHEMERAL=" \
|
||||
bzip2 \
|
||||
ccache \
|
||||
clang-${LLVM_VERSION} \
|
||||
cmake \
|
||||
g++ \
|
||||
glslang-tools \
|
||||
libasound2-dev \
|
||||
libcap-dev \
|
||||
libclang-cpp${LLVM_VERSION}-dev \
|
||||
libdrm-dev \
|
||||
libgles2-mesa-dev \
|
||||
libpciaccess-dev \
|
||||
libpng-dev \
|
||||
libudev-dev \
|
||||
libvulkan-dev \
|
||||
libwaffle-dev \
|
||||
libwayland-dev \
|
||||
libx11-xcb-dev \
|
||||
libxcb-dri2-0-dev \
|
||||
libxkbcommon-dev \
|
||||
libxrandr-dev \
|
||||
libxrender-dev \
|
||||
llvm-${LLVM_VERSION}-dev \
|
||||
make \
|
||||
meson \
|
||||
ocl-icd-opencl-dev \
|
||||
patch \
|
||||
pkgconf \
|
||||
python3-distutils \
|
||||
xz-utils \
|
||||
"
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install -y --no-remove "${DEPS[@]}" "${EPHEMERAL[@]}" \
|
||||
$EXTRA_LOCAL_PACKAGES
|
||||
apt-get install -y --no-remove \
|
||||
$EXTRA_LOCAL_PACKAGES \
|
||||
$STABLE_EPHEMERAL \
|
||||
clinfo \
|
||||
iptables \
|
||||
libclang-common-${LLVM_VERSION}-dev \
|
||||
libclang-cpp${LLVM_VERSION} \
|
||||
libcap2 \
|
||||
libegl1 \
|
||||
libepoxy0 \
|
||||
libfdt1 \
|
||||
libxcb-shm0 \
|
||||
ocl-icd-libopencl1 \
|
||||
python3-lxml \
|
||||
python3-renderdoc \
|
||||
python3-simplejson \
|
||||
spirv-tools \
|
||||
sysvinit-core \
|
||||
weston
|
||||
|
||||
|
||||
. .gitlab-ci/container/container_pre_build.sh
|
||||
@@ -88,6 +86,9 @@ DEQP_TARGET=surfaceless . .gitlab-ci/container/build-deqp.sh
|
||||
|
||||
############### Uninstall the build software
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
ccache --show-stats
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
apt-get purge -y \
|
||||
$STABLE_EPHEMERAL
|
||||
|
||||
apt-get autoremove -y --purge
|
||||
|
@@ -11,63 +11,65 @@ export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get install -y libelogind0 # this interfere with systemd deps, install separately
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at the end)
|
||||
EPHEMERAL=(
|
||||
ccache
|
||||
cmake
|
||||
g++
|
||||
glslang-tools
|
||||
libexpat1-dev
|
||||
gnupg2
|
||||
libdrm-dev
|
||||
libgbm-dev
|
||||
libgles2-mesa-dev
|
||||
liblz4-dev
|
||||
libpciaccess-dev
|
||||
libudev-dev
|
||||
libvulkan-dev
|
||||
libwaffle-dev
|
||||
libx11-xcb-dev
|
||||
libxcb-ewmh-dev
|
||||
libxcb-keysyms1-dev
|
||||
libxkbcommon-dev
|
||||
libxrandr-dev
|
||||
libxrender-dev
|
||||
libzstd-dev
|
||||
meson
|
||||
p7zip
|
||||
patch
|
||||
pkgconf
|
||||
python3-dev
|
||||
python3-distutils
|
||||
python3-pip
|
||||
python3-setuptools
|
||||
python3-wheel
|
||||
software-properties-common
|
||||
wine64-tools
|
||||
xz-utils
|
||||
)
|
||||
|
||||
DEPS=(
|
||||
curl
|
||||
libepoxy0
|
||||
libxcb-shm0
|
||||
pciutils
|
||||
python3-lxml
|
||||
python3-simplejson
|
||||
sysvinit-core
|
||||
weston
|
||||
xwayland
|
||||
wine
|
||||
wine64
|
||||
xinit
|
||||
xserver-xorg-video-amdgpu
|
||||
xserver-xorg-video-ati
|
||||
)
|
||||
|
||||
apt-get update
|
||||
STABLE_EPHEMERAL=" \
|
||||
ccache \
|
||||
cmake \
|
||||
g++ \
|
||||
g++-mingw-w64-i686-posix \
|
||||
g++-mingw-w64-x86-64-posix \
|
||||
glslang-tools \
|
||||
libexpat1-dev \
|
||||
gnupg2 \
|
||||
libdrm-dev \
|
||||
libgbm-dev \
|
||||
libgles2-mesa-dev \
|
||||
liblz4-dev \
|
||||
libpciaccess-dev \
|
||||
libudev-dev \
|
||||
libvulkan-dev \
|
||||
libwaffle-dev \
|
||||
libx11-xcb-dev \
|
||||
libxcb-ewmh-dev \
|
||||
libxcb-keysyms1-dev \
|
||||
libxkbcommon-dev \
|
||||
libxrandr-dev \
|
||||
libxrender-dev \
|
||||
libzstd-dev \
|
||||
meson \
|
||||
mingw-w64-i686-dev \
|
||||
mingw-w64-tools \
|
||||
mingw-w64-x86-64-dev \
|
||||
p7zip \
|
||||
patch \
|
||||
pkgconf \
|
||||
python3-dev \
|
||||
python3-distutils \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
software-properties-common \
|
||||
wine64-tools \
|
||||
xz-utils \
|
||||
"
|
||||
|
||||
apt-get install -y --no-remove --no-install-recommends \
|
||||
"${DEPS[@]}" "${EPHEMERAL[@]}"
|
||||
$STABLE_EPHEMERAL \
|
||||
curl \
|
||||
libepoxy0 \
|
||||
libxcb-shm0 \
|
||||
pciutils \
|
||||
python3-lxml \
|
||||
python3-simplejson \
|
||||
sysvinit-core \
|
||||
weston \
|
||||
xwayland \
|
||||
wine \
|
||||
wine64 \
|
||||
xinit \
|
||||
xserver-xorg-video-amdgpu \
|
||||
xserver-xorg-video-ati
|
||||
|
||||
apt-get update -q
|
||||
|
||||
############### Install DXVK
|
||||
|
||||
@@ -121,6 +123,11 @@ PIGLIT_BUILD_TARGETS="piglit_replayer" . .gitlab-ci/container/build-piglit.sh
|
||||
|
||||
############### Uninstall the build software
|
||||
|
||||
apt-get purge -y "${EPHEMERAL[@]}"
|
||||
ccache --show-stats
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
apt-get purge -y \
|
||||
$STABLE_EPHEMERAL
|
||||
|
||||
apt-get autoremove -y --purge
|
||||
|
||||
#dpkg -r --force-depends "mesa-vulkan-drivers" "mesa-vdpau-drivers" "mesa-va-drivers" "libgl1-mesa-dri" "libglx-mesa0" "vdpau-driver-all" "va-driver-all" "libglx0" "libgl1" "libvdpau-va-gl1" "libglu1-mesa" "libegl-mesa0" "libgl1-mesa-dri" "libglapi-mesa" "libosmesa6"
|
||||
|
@@ -96,8 +96,8 @@ tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
|
||||
cd $XORGMACROS_VERSION; ./configure; make install; cd ..
|
||||
rm -rf $XORGMACROS_VERSION
|
||||
|
||||
# We need at least 1.3.1 for rusticl
|
||||
pip install meson==1.3.1
|
||||
# We need at least 1.2 for Rust's `debug_assertions`
|
||||
pip install meson==1.2.0
|
||||
|
||||
. .gitlab-ci/container/build-mold.sh
|
||||
|
||||
|
@@ -23,6 +23,10 @@
|
||||
variables:
|
||||
MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${FDO_DISTRIBUTION_TAG}"
|
||||
|
||||
.use-wine:
|
||||
variables:
|
||||
WINEPATH: "/usr/x86_64-w64-mingw32/bin;/usr/x86_64-w64-mingw32/lib;/usr/lib/gcc/x86_64-w64-mingw32/10-posix;c:/windows;c:/windows/system32"
|
||||
|
||||
# Build the CI docker images.
|
||||
#
|
||||
# MESA_IMAGE_TAG is the tag of the docker image used by later stage jobs. If the
|
||||
@@ -40,16 +44,14 @@
|
||||
# repository's container registry, so that the image from the main
|
||||
# repository's registry will be used there as well.
|
||||
|
||||
.debian-container:
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: bookworm-slim
|
||||
|
||||
.container:
|
||||
stage: container
|
||||
extends:
|
||||
- .container+build-rules
|
||||
- .incorporate-templates-commit
|
||||
- .use-wine
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: bookworm-slim
|
||||
FDO_REPO_SUFFIX: $CI_JOB_NAME
|
||||
FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
|
||||
# no need to pull the whole repo to build the container image
|
||||
@@ -65,18 +67,12 @@ debian/x86_64_build-base:
|
||||
extends:
|
||||
- .fdo.container-build@debian
|
||||
- .container
|
||||
- .debian-container
|
||||
variables:
|
||||
MESA_IMAGE_TAG: &debian-x86_64_build-base "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}"
|
||||
rules:
|
||||
# python-test requires debian/x86_64_build, which requires this job
|
||||
- !reference [python-test, rules]
|
||||
- !reference [.container, rules]
|
||||
MESA_IMAGE_TAG: &debian-x86_64_build-base ${DEBIAN_BASE_TAG}
|
||||
|
||||
.use-debian/x86_64_build-base:
|
||||
extends:
|
||||
- .fdo.container-build@debian
|
||||
- .debian-container
|
||||
- .use-base-image
|
||||
variables:
|
||||
MESA_BASE_IMAGE: ${DEBIAN_X86_64_BUILD_BASE_IMAGE}
|
||||
@@ -91,10 +87,6 @@ debian/x86_64_build:
|
||||
- .use-debian/x86_64_build-base
|
||||
variables:
|
||||
MESA_IMAGE_TAG: &debian-x86_64_build ${DEBIAN_BUILD_TAG}
|
||||
rules:
|
||||
# python-test requires this job
|
||||
- !reference [python-test, rules]
|
||||
- !reference [.use-debian/x86_64_build-base, rules]
|
||||
|
||||
.use-debian/x86_64_build:
|
||||
extends:
|
||||
@@ -123,6 +115,24 @@ debian/x86_32_build:
|
||||
needs:
|
||||
- debian/x86_32_build
|
||||
|
||||
# Debian based x86_64-mingw cross main build image
|
||||
# FIXME: Until gets fixed on Debian 12, disabled.
|
||||
.debian/x86_64_build-mingw:
|
||||
extends:
|
||||
- .use-debian/x86_64_build-base
|
||||
variables:
|
||||
MESA_IMAGE_TAG: &debian-x86_64_build_mingw ${DEBIAN_BUILD_MINGW_TAG}
|
||||
|
||||
.use-debian/x86_64_build_mingw:
|
||||
extends:
|
||||
- .set-image-base-tag
|
||||
variables:
|
||||
MESA_BASE_TAG: *debian-x86_64_build-base
|
||||
MESA_IMAGE_PATH: ${DEBIAN_X86_64_BUILD_MINGW_IMAGE_PATH}
|
||||
MESA_IMAGE_TAG: *debian-x86_64_build_mingw
|
||||
needs:
|
||||
- .debian/x86_64_build-mingw
|
||||
|
||||
# Debian based ppc64el cross-build image
|
||||
debian/ppc64el_build:
|
||||
extends:
|
||||
@@ -180,12 +190,11 @@ debian/android_build:
|
||||
debian/x86_64_test-base:
|
||||
extends: debian/x86_64_build-base
|
||||
variables:
|
||||
MESA_IMAGE_TAG: &debian-x86_64_test-base "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${KERNEL_TAG}"
|
||||
MESA_IMAGE_TAG: &debian-x86_64_test-base "${DEBIAN_BASE_TAG}--${KERNEL_TAG}"
|
||||
|
||||
.use-debian/x86_64_test-base:
|
||||
extends:
|
||||
- .fdo.container-build@debian
|
||||
- .debian-container
|
||||
- .use-base-image
|
||||
variables:
|
||||
MESA_BASE_IMAGE: ${DEBIAN_X86_64_TEST_BASE_IMAGE}
|
||||
@@ -247,11 +256,10 @@ debian/arm64_build:
|
||||
extends:
|
||||
- .fdo.container-build@debian
|
||||
- .container
|
||||
- .debian-container
|
||||
tags:
|
||||
- aarch64
|
||||
variables:
|
||||
MESA_IMAGE_TAG: &debian-arm64_build "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}"
|
||||
MESA_IMAGE_TAG: &debian-arm64_build ${DEBIAN_BASE_TAG}
|
||||
|
||||
.use-debian/arm64_build:
|
||||
extends:
|
||||
@@ -270,8 +278,7 @@ debian/arm64_build:
|
||||
- .fdo.container-build@alpine
|
||||
- .container
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: "edge" # switch to 3.20 when gets released
|
||||
FDO_BASE_IMAGE: alpine:$FDO_DISTRIBUTION_VERSION # since cbuild ignores it
|
||||
FDO_DISTRIBUTION_VERSION: "3.18"
|
||||
|
||||
# Alpine based x86_64 build image
|
||||
alpine/x86_64_build:
|
||||
@@ -318,7 +325,6 @@ fedora/x86_64_build:
|
||||
.kernel+rootfs:
|
||||
extends:
|
||||
- .container+build-rules
|
||||
- .debian-container
|
||||
stage: container
|
||||
variables:
|
||||
GIT_STRATEGY: fetch
|
||||
@@ -367,7 +373,6 @@ kernel+rootfs_arm32:
|
||||
extends:
|
||||
- .fdo.container-build@debian
|
||||
- .container
|
||||
- .debian-container
|
||||
# Don't want the .container rules
|
||||
- .container+build-rules
|
||||
variables:
|
||||
@@ -383,7 +388,7 @@ debian/arm32_test:
|
||||
needs:
|
||||
- kernel+rootfs_arm32
|
||||
variables:
|
||||
MESA_IMAGE_TAG: &debian-arm32_test "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}"
|
||||
MESA_IMAGE_TAG: &debian-arm32_test ${DEBIAN_BASE_TAG}
|
||||
|
||||
debian/arm64_test:
|
||||
extends:
|
||||
@@ -391,7 +396,7 @@ debian/arm64_test:
|
||||
needs:
|
||||
- kernel+rootfs_arm64
|
||||
variables:
|
||||
MESA_IMAGE_TAG: &debian-arm64_test "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}"
|
||||
MESA_IMAGE_TAG: &debian-arm64_test ${DEBIAN_BASE_TAG}
|
||||
|
||||
.use-debian/arm_test:
|
||||
variables:
|
||||
@@ -429,7 +434,7 @@ debian/arm64_test:
|
||||
# (host PowerShell) in the container stage to build and push the image,
|
||||
# then in the build stage by executing inside Docker.
|
||||
|
||||
.windows-docker-msvc:
|
||||
.windows-docker-vs2019:
|
||||
variables:
|
||||
MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}"
|
||||
MESA_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MESA_IMAGE_PATH:${MESA_IMAGE_TAG}"
|
||||
@@ -441,7 +446,7 @@ debian/arm64_test:
|
||||
default: [retry]
|
||||
extends:
|
||||
- .container
|
||||
- .windows-docker-msvc
|
||||
- .windows-docker-vs2019
|
||||
- .windows-shell-tags
|
||||
rules:
|
||||
- !reference [.microsoft-farm-container-rules, rules]
|
||||
@@ -452,18 +457,18 @@ debian/arm64_test:
|
||||
script:
|
||||
- .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE ${DOCKERFILE} ${MESA_BASE_IMAGE}
|
||||
|
||||
windows_msvc:
|
||||
windows_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
extends:
|
||||
- .windows_container_build
|
||||
variables:
|
||||
MESA_IMAGE_PATH: &windows_msvc_image_path ${WINDOWS_X64_MSVC_PATH}
|
||||
MESA_IMAGE_TAG: ${WINDOWS_X64_MSVC_TAG}
|
||||
DOCKERFILE: Dockerfile_msvc
|
||||
MESA_IMAGE_PATH: &windows_vs_image_path ${WINDOWS_X64_VS_PATH}
|
||||
MESA_IMAGE_TAG: &windows_vs_image_tag ${WINDOWS_X64_VS_TAG}
|
||||
DOCKERFILE: Dockerfile_vs
|
||||
MESA_BASE_IMAGE: "mcr.microsoft.com/windows/server:ltsc2022"
|
||||
|
||||
windows_build_msvc:
|
||||
windows_build_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
extends:
|
||||
@@ -473,15 +478,16 @@ windows_build_msvc:
|
||||
- !reference [.container+build-rules, rules]
|
||||
variables:
|
||||
MESA_IMAGE_PATH: &windows_build_image_path ${WINDOWS_X64_BUILD_PATH}
|
||||
MESA_IMAGE_TAG: &windows_build_image_tag ${WINDOWS_X64_MSVC_TAG}--${WINDOWS_X64_BUILD_TAG}
|
||||
MESA_IMAGE_TAG: &windows_build_image_tag ${MESA_BASE_IMAGE_TAG}--${WINDOWS_X64_BUILD_TAG}
|
||||
DOCKERFILE: Dockerfile_build
|
||||
MESA_BASE_IMAGE_PATH: *windows_msvc_image_path
|
||||
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${WINDOWS_X64_MSVC_TAG}"
|
||||
MESA_BASE_IMAGE_PATH: *windows_vs_image_path
|
||||
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
|
||||
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
|
||||
timeout: 2h 30m # LLVM takes ages
|
||||
needs:
|
||||
- windows_msvc
|
||||
- windows_vs2019
|
||||
|
||||
windows_test_msvc:
|
||||
windows_test_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
extends:
|
||||
@@ -491,30 +497,33 @@ windows_test_msvc:
|
||||
- !reference [.container+build-rules, rules]
|
||||
variables:
|
||||
MESA_IMAGE_PATH: &windows_test_image_path ${WINDOWS_X64_TEST_PATH}
|
||||
MESA_IMAGE_TAG: &windows_test_image_tag ${WINDOWS_X64_MSVC_TAG}--${WINDOWS_X64_TEST_TAG}
|
||||
MESA_IMAGE_TAG: &windows_test_image_tag ${MESA_BASE_IMAGE_TAG}--${WINDOWS_X64_TEST_TAG}
|
||||
DOCKERFILE: Dockerfile_test
|
||||
MESA_BASE_IMAGE_PATH: *windows_msvc_image_path
|
||||
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${WINDOWS_X64_MSVC_TAG}"
|
||||
MESA_BASE_IMAGE_PATH: *windows_vs_image_path
|
||||
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
|
||||
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
|
||||
timeout: 2h 30m
|
||||
needs:
|
||||
- windows_msvc
|
||||
- windows_vs2019
|
||||
|
||||
.use-windows_build_msvc:
|
||||
.use-windows_build_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
extends: .windows-docker-msvc
|
||||
extends: .windows-docker-vs2019
|
||||
image: "$MESA_IMAGE"
|
||||
variables:
|
||||
MESA_IMAGE_PATH: *windows_build_image_path
|
||||
MESA_IMAGE_TAG: *windows_build_image_tag
|
||||
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
|
||||
needs:
|
||||
- windows_build_msvc
|
||||
- windows_build_vs2019
|
||||
|
||||
.use-windows_test_msvc:
|
||||
.use-windows_test_vs2019:
|
||||
inherit:
|
||||
default: [retry]
|
||||
extends: .windows-docker-msvc
|
||||
extends: .windows-docker-vs2019
|
||||
image: "$MESA_IMAGE"
|
||||
variables:
|
||||
MESA_IMAGE_PATH: *windows_test_image_path
|
||||
MESA_IMAGE_TAG: *windows_test_image_tag
|
||||
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
|
||||
|
@@ -62,19 +62,6 @@ elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
|
||||
DEVICE_TREES+=" tegra124-jetson-tk1.dtb"
|
||||
KERNEL_IMAGE_NAME="zImage"
|
||||
. .gitlab-ci/container/create-cross-file.sh armhf
|
||||
CONTAINER_ARCH_PACKAGES=(
|
||||
libegl1-mesa-dev:armhf
|
||||
libelf-dev:armhf
|
||||
libgbm-dev:armhf
|
||||
libgles2-mesa-dev:armhf
|
||||
libpng-dev:armhf
|
||||
libudev-dev:armhf
|
||||
libvulkan-dev:armhf
|
||||
libwaffle-dev:armhf
|
||||
libwayland-dev:armhf
|
||||
libx11-xcb-dev:armhf
|
||||
libxkbcommon-dev:armhf
|
||||
)
|
||||
else
|
||||
GCC_ARCH="x86_64-linux-gnu"
|
||||
KERNEL_ARCH="x86_64"
|
||||
@@ -82,9 +69,7 @@ else
|
||||
DEFCONFIG="arch/x86/configs/x86_64_defconfig"
|
||||
DEVICE_TREES=""
|
||||
KERNEL_IMAGE_NAME="bzImage"
|
||||
CONTAINER_ARCH_PACKAGES=(
|
||||
libasound2-dev libcap-dev libfdt-dev libva-dev wayland-protocols p7zip wine
|
||||
)
|
||||
ARCH_PACKAGES="libasound2-dev libcap-dev libfdt-dev libva-dev wayland-protocols p7zip"
|
||||
fi
|
||||
|
||||
# Determine if we're in a cross build.
|
||||
@@ -104,57 +89,66 @@ if [[ -e /cross_file-$DEBIAN_ARCH.txt ]]; then
|
||||
export CROSS_COMPILE="${GCC_ARCH}-"
|
||||
fi
|
||||
|
||||
# no need to remove these at end, image isn't saved at the end
|
||||
CONTAINER_EPHEMERAL=(
|
||||
automake
|
||||
bc
|
||||
"clang-${LLVM_VERSION}"
|
||||
cmake
|
||||
curl
|
||||
mmdebstrap
|
||||
git
|
||||
glslang-tools
|
||||
libdrm-dev
|
||||
libegl1-mesa-dev
|
||||
libxext-dev
|
||||
libfontconfig-dev
|
||||
libgbm-dev
|
||||
libgl-dev
|
||||
libgles2-mesa-dev
|
||||
libglu1-mesa-dev
|
||||
libglx-dev
|
||||
libpng-dev
|
||||
libssl-dev
|
||||
libudev-dev
|
||||
libvulkan-dev
|
||||
libwaffle-dev
|
||||
libwayland-dev
|
||||
libx11-xcb-dev
|
||||
libxcb-dri2-0-dev
|
||||
libxkbcommon-dev
|
||||
libwayland-dev
|
||||
ninja-build
|
||||
openssh-server
|
||||
patch
|
||||
protobuf-compiler
|
||||
python-is-python3
|
||||
python3-distutils
|
||||
python3-mako
|
||||
python3-numpy
|
||||
python3-serial
|
||||
python3-venv
|
||||
unzip
|
||||
zstd
|
||||
)
|
||||
|
||||
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-remove \
|
||||
-o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' \
|
||||
"${CONTAINER_EPHEMERAL[@]}" \
|
||||
"${CONTAINER_ARCH_PACKAGES[@]}" \
|
||||
${EXTRA_LOCAL_PACKAGES}
|
||||
${EXTRA_LOCAL_PACKAGES} \
|
||||
${ARCH_PACKAGES} \
|
||||
automake \
|
||||
bc \
|
||||
clang-${LLVM_VERSION} \
|
||||
cmake \
|
||||
curl \
|
||||
mmdebstrap \
|
||||
git \
|
||||
glslang-tools \
|
||||
libdrm-dev \
|
||||
libegl1-mesa-dev \
|
||||
libxext-dev \
|
||||
libfontconfig-dev \
|
||||
libgbm-dev \
|
||||
libgl-dev \
|
||||
libgles2-mesa-dev \
|
||||
libglu1-mesa-dev \
|
||||
libglx-dev \
|
||||
libpng-dev \
|
||||
libssl-dev \
|
||||
libudev-dev \
|
||||
libvulkan-dev \
|
||||
libwaffle-dev \
|
||||
libwayland-dev \
|
||||
libx11-xcb-dev \
|
||||
libxcb-dri2-0-dev \
|
||||
libxkbcommon-dev \
|
||||
libwayland-dev \
|
||||
ninja-build \
|
||||
openssh-server \
|
||||
patch \
|
||||
protobuf-compiler \
|
||||
python-is-python3 \
|
||||
python3-distutils \
|
||||
python3-mako \
|
||||
python3-numpy \
|
||||
python3-serial \
|
||||
python3-venv \
|
||||
unzip \
|
||||
zstd
|
||||
|
||||
|
||||
if [[ "$DEBIAN_ARCH" = "armhf" ]]; then
|
||||
apt-get install -y --no-remove \
|
||||
libegl1-mesa-dev:armhf \
|
||||
libelf-dev:armhf \
|
||||
libgbm-dev:armhf \
|
||||
libgles2-mesa-dev:armhf \
|
||||
libpng-dev:armhf \
|
||||
libudev-dev:armhf \
|
||||
libvulkan-dev:armhf \
|
||||
libwaffle-dev:armhf \
|
||||
libwayland-dev:armhf \
|
||||
libx11-xcb-dev:armhf \
|
||||
libxkbcommon-dev:armhf
|
||||
fi
|
||||
|
||||
ROOTFS=/lava-files/rootfs-${DEBIAN_ARCH}
|
||||
mkdir -p "$ROOTFS"
|
||||
@@ -196,7 +190,6 @@ PKG_DEP=(
|
||||
)
|
||||
[ "$DEBIAN_ARCH" = "amd64" ] && PKG_ARCH=(
|
||||
firmware-amd-graphics
|
||||
firmware-misc-nonfree
|
||||
libgl1 libglu1-mesa
|
||||
inetutils-syslogd iptables libcap2
|
||||
libfontconfig1
|
||||
@@ -219,8 +212,7 @@ mmdebstrap \
|
||||
--include "${PKG_BASE[*]} ${PKG_CI[*]} ${PKG_DEP[*]} ${PKG_MESA_DEP[*]} ${PKG_ARCH[*]}" \
|
||||
bookworm \
|
||||
"$ROOTFS/" \
|
||||
"http://deb.debian.org/debian" \
|
||||
"deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main"
|
||||
"http://deb.debian.org/debian"
|
||||
|
||||
############### Install mold
|
||||
. .gitlab-ci/container/build-mold.sh
|
||||
@@ -324,11 +316,6 @@ fi
|
||||
rm -rf /root/.cargo
|
||||
rm -rf /root/.rustup
|
||||
|
||||
############### Delete firmware files we don't need
|
||||
if [ "$DEBIAN_ARCH" = "amd64" ]; then
|
||||
dpkg -L firmware-misc-nonfree | grep -v "i915" | xargs rm || true
|
||||
fi
|
||||
|
||||
############### Fill rootfs
|
||||
cp .gitlab-ci/container/setup-rootfs.sh $ROOTFS/.
|
||||
cp .gitlab-ci/container/strip-rootfs.sh $ROOTFS/.
|
||||
|
@@ -132,9 +132,6 @@ if [ -n "$VK_DRIVER" ] && [ -z "$DEQP_SUITE" ]; then
|
||||
fi
|
||||
|
||||
# Set the path to VK validation layer settings (in case it ends up getting loaded)
|
||||
# Note: If you change the format of this filename, look through the rest of the
|
||||
# tree for other places that need to be kept in sync (e.g.
|
||||
# src/gallium/drivers/zink/ci/gitlab-ci-inc.yml)
|
||||
export VK_LAYER_SETTINGS_PATH=$INSTALL/$GPU_VERSION-validation-settings.txt
|
||||
|
||||
report_load() {
|
||||
@@ -169,7 +166,7 @@ fi
|
||||
|
||||
uncollapsed_section_switch deqp "deqp: deqp-runner"
|
||||
|
||||
cat /deqp/version-log
|
||||
echo "deqp $(cat /deqp/version)"
|
||||
|
||||
set +e
|
||||
if [ -z "$DEQP_SUITE" ]; then
|
||||
@@ -186,10 +183,6 @@ if [ -z "$DEQP_SUITE" ]; then
|
||||
-- \
|
||||
$DEQP_OPTIONS
|
||||
else
|
||||
# If you change the format of the suite toml filenames or the
|
||||
# $GPU_VERSION-{fails,flakes,skips}.txt filenames, look through the rest
|
||||
# of the tree for other places that need to be kept in sync (e.g.
|
||||
# src/**/ci/gitlab-ci*.yml)
|
||||
deqp-runner \
|
||||
suite \
|
||||
--suite $INSTALL/deqp-$DEQP_SUITE.toml \
|
||||
@@ -230,7 +223,7 @@ deqp-runner junit \
|
||||
--results $RESULTS/failures.csv \
|
||||
--output $RESULTS/junit.xml \
|
||||
--limit 50 \
|
||||
--template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
|
||||
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
|
||||
|
||||
# Report the flakes to the IRC channel for monitoring (if configured):
|
||||
if [ -n "$FLAKES_CHANNEL" ]; then
|
||||
|
@@ -238,27 +238,6 @@
|
||||
- !reference [.freedreno-farm-rules, rules]
|
||||
|
||||
|
||||
.ondracka-farm-rules:
|
||||
rules:
|
||||
- exists: [ .ci-farms-disabled/ondracka ]
|
||||
when: never
|
||||
- changes: [ .ci-farms-disabled/ondracka ]
|
||||
if: '$CI_PIPELINE_SOURCE != "schedule"'
|
||||
when: on_success
|
||||
- changes: [ .ci-farms-disabled/* ]
|
||||
if: '$CI_PIPELINE_SOURCE != "schedule"'
|
||||
when: never
|
||||
|
||||
.ondracka-farm-manual-rules:
|
||||
rules:
|
||||
- exists: [ .ci-farms-disabled/ondracka ]
|
||||
when: never
|
||||
- changes: [ .ci-farms-disabled/ondracka ]
|
||||
if: '$CI_PIPELINE_SOURCE != "schedule"'
|
||||
when: never
|
||||
- !reference [.ondracka-farm-rules, rules]
|
||||
|
||||
|
||||
# Skip container & build jobs when disabling any farm, and run them if any
|
||||
# farm gets re-enabled.
|
||||
# Only apply these rules in MR context, because otherwise we get a false
|
||||
@@ -307,10 +286,6 @@
|
||||
changes: [ .ci-farms-disabled/freedreno ]
|
||||
exists: [ .ci-farms-disabled/freedreno ]
|
||||
when: never
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
changes: [ .ci-farms-disabled/ondracka ]
|
||||
exists: [ .ci-farms-disabled/ondracka ]
|
||||
when: never
|
||||
# Any other change to ci-farms/* means some farm is getting re-enabled.
|
||||
# Run jobs in Marge pipelines (and let it fallback to manual otherwise)
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $GITLAB_USER_LOGIN == "marge-bot"'
|
||||
|
@@ -55,7 +55,7 @@ deqp-runner junit \
|
||||
--results $RESULTS/failures.csv \
|
||||
--output $RESULTS/junit.xml \
|
||||
--limit 50 \
|
||||
--template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
|
||||
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
|
||||
|
||||
# Report the flakes to the IRC channel for monitoring (if configured):
|
||||
if [ -n "$FLAKES_CHANNEL" ]; then
|
||||
|
@@ -7,10 +7,13 @@
|
||||
|
||||
variables:
|
||||
DEBIAN_X86_64_BUILD_BASE_IMAGE: "debian/x86_64_build-base"
|
||||
DEBIAN_BASE_TAG: "2024-01-14-runner24"
|
||||
DEBIAN_BASE_TAG: "2023-10-13-rust-1.66"
|
||||
|
||||
DEBIAN_X86_64_BUILD_IMAGE_PATH: "debian/x86_64_build"
|
||||
DEBIAN_BUILD_TAG: "2024-01-04-find"
|
||||
DEBIAN_BUILD_TAG: "2023-09-30-shader-db"
|
||||
|
||||
DEBIAN_X86_64_BUILD_MINGW_IMAGE_PATH: "debian/x86_64_build-mingw"
|
||||
DEBIAN_BUILD_MINGW_TAG: "2023-05-25-bookworm"
|
||||
|
||||
DEBIAN_X86_64_TEST_BASE_IMAGE: "debian/x86_64_test-base"
|
||||
|
||||
@@ -18,23 +21,21 @@ variables:
|
||||
DEBIAN_X86_64_TEST_IMAGE_VK_PATH: "debian/x86_64_test-vk"
|
||||
DEBIAN_X86_64_TEST_ANDROID_IMAGE_PATH: "debian/x86_64_test-android"
|
||||
|
||||
DEBIAN_X86_64_TEST_ANDROID_TAG: "2024-01-14-runner24"
|
||||
DEBIAN_X86_64_TEST_GL_TAG: "2024-01-14-check24"
|
||||
DEBIAN_X86_64_TEST_VK_TAG: "2024-01-14-check24"
|
||||
DEBIAN_X86_64_TEST_ANDROID_TAG: "2023-10-15-deqp"
|
||||
DEBIAN_X86_64_TEST_GL_TAG: "2023-10-15-deqp"
|
||||
DEBIAN_X86_64_TEST_VK_TAG: "2023-10-15-deqp"
|
||||
|
||||
ALPINE_X86_64_BUILD_TAG: "2023-01-07-libdrm2_4_119"
|
||||
ALPINE_X86_64_BUILD_TAG: "2023-10-04-ephemeral"
|
||||
ALPINE_X86_64_LAVA_SSH_TAG: "2023-06-26-first-version"
|
||||
FEDORA_X86_64_BUILD_TAG: "2024-01-06-libdrm"
|
||||
KERNEL_ROOTFS_TAG: "2024-01-14-runner24"
|
||||
KERNEL_TAG: "v6.6.4-for-mesa-ci-e4f4c500f7fb"
|
||||
KERNEL_REPO: "gfx-ci/linux"
|
||||
PKG_REPO_REV: "67f2c46b"
|
||||
FEDORA_X86_64_BUILD_TAG: "2023-08-04-shader-db"
|
||||
KERNEL_ROOTFS_TAG: "2023-10-13-deqp"
|
||||
KERNEL_TAG: "v6.4.12-for-mesa-ci-f6b4ad45f48d"
|
||||
|
||||
WINDOWS_X64_MSVC_PATH: "windows/x86_64_msvc"
|
||||
WINDOWS_X64_MSVC_TAG: "2023-12-22-msvc"
|
||||
WINDOWS_X64_VS_PATH: "windows/x64_vs"
|
||||
WINDOWS_X64_VS_TAG: "2022-10-20-upgrade-zlib"
|
||||
|
||||
WINDOWS_X64_BUILD_PATH: "windows/x86_64_build"
|
||||
WINDOWS_X64_BUILD_TAG: "2023-12-22-msvc"
|
||||
WINDOWS_X64_BUILD_PATH: "windows/x64_build"
|
||||
WINDOWS_X64_BUILD_TAG: "2023-06-24-agility-711"
|
||||
|
||||
WINDOWS_X64_TEST_PATH: "windows/x86_64_test"
|
||||
WINDOWS_X64_TEST_TAG: "2023-12-22-msvc"
|
||||
WINDOWS_X64_TEST_PATH: "windows/x64_test"
|
||||
WINDOWS_X64_TEST_TAG: "2023-05-30-warp-1.0.7.1"
|
||||
|
@@ -42,7 +42,6 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
|
||||
--pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \
|
||||
--rootfs-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
|
||||
--kernel-url-prefix "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}" \
|
||||
--kernel-external "${FORCE_KERNEL_TAG}" \
|
||||
--build-url "${ARTIFACT_URL}" \
|
||||
--job-rootfs-overlay-url "${FDO_HTTP_CACHE_URI:-}https://${JOB_ROOTFS_OVERLAY_PATH}" \
|
||||
--job-timeout-min ${JOB_TIMEOUT:-30} \
|
||||
@@ -59,5 +58,4 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
|
||||
--mesa-job-name "$CI_JOB_NAME" \
|
||||
--structured-log-file "results/lava_job_detail.json" \
|
||||
--ssh-client-image "${LAVA_SSH_CLIENT_IMAGE}" \
|
||||
--project-name "${CI_PROJECT_NAME}" \
|
||||
>> results/lava.log
|
||||
|
@@ -17,32 +17,32 @@ import time
|
||||
from collections import defaultdict
|
||||
from dataclasses import dataclass, fields
|
||||
from datetime import datetime, timedelta
|
||||
from io import StringIO
|
||||
from os import environ, getenv, path
|
||||
from typing import Any, Optional
|
||||
|
||||
import fire
|
||||
from lavacli.utils import flow_yaml as lava_yaml
|
||||
|
||||
from lava.exceptions import (
|
||||
MesaCIException,
|
||||
MesaCIParseException,
|
||||
MesaCIRetryError,
|
||||
MesaCITimeoutError,
|
||||
)
|
||||
from lava.utils import CONSOLE_LOG
|
||||
from lava.utils import DEFAULT_GITLAB_SECTION_TIMEOUTS as GL_SECTION_TIMEOUTS
|
||||
from lava.utils import (
|
||||
CONSOLE_LOG,
|
||||
GitlabSection,
|
||||
LAVAJob,
|
||||
LAVAJobDefinition,
|
||||
LogFollower,
|
||||
LogSectionType,
|
||||
call_proxy,
|
||||
fatal_err,
|
||||
generate_lava_job_definition,
|
||||
hide_sensitive_data,
|
||||
print_log,
|
||||
setup_lava_proxy,
|
||||
)
|
||||
from lava.utils import DEFAULT_GITLAB_SECTION_TIMEOUTS as GL_SECTION_TIMEOUTS
|
||||
from lavacli.utils import flow_yaml as lava_yaml
|
||||
|
||||
# Initialize structural logging with a defaultdict, it can be changed for more
|
||||
# sophisticated dict-like data abstractions.
|
||||
@@ -370,7 +370,6 @@ class LAVAJobSubmitter(PathResolver):
|
||||
kernel_image_name: str = None
|
||||
kernel_image_type: str = ""
|
||||
kernel_url_prefix: str = None
|
||||
kernel_external: str = None
|
||||
lava_tags: str = "" # Comma-separated LAVA tags for the job
|
||||
mesa_job_name: str = "mesa_ci_job"
|
||||
pipeline_info: str = ""
|
||||
@@ -380,7 +379,6 @@ class LAVAJobSubmitter(PathResolver):
|
||||
job_rootfs_overlay_url: str = None
|
||||
structured_log_file: pathlib.Path = None # Log file path with structured LAVA log
|
||||
ssh_client_image: str = None # x86_64 SSH client image to follow the job's output
|
||||
project_name: str = None # Project name to be used in the job name
|
||||
__structured_log_context = contextlib.nullcontext() # Structured Logger context
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
@@ -404,7 +402,7 @@ class LAVAJobSubmitter(PathResolver):
|
||||
minutes=self.job_timeout_min
|
||||
)
|
||||
|
||||
job_definition = LAVAJobDefinition(self).generate_lava_job_definition()
|
||||
job_definition = generate_lava_job_definition(self)
|
||||
|
||||
if self.dump_yaml:
|
||||
self.dump_job_definition(job_definition)
|
||||
@@ -458,8 +456,10 @@ class LAVAJobSubmitter(PathResolver):
|
||||
self.finish_script(last_attempt_job)
|
||||
|
||||
def print_log_artifact_url(self):
|
||||
base_url = "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/"
|
||||
artifacts_path = "-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/"
|
||||
relative_log_path = self.structured_log_file.relative_to(pathlib.Path.cwd())
|
||||
full_path = f"$ARTIFACTS_BASE_URL/{relative_log_path}"
|
||||
full_path = f"{base_url}{artifacts_path}{relative_log_path}"
|
||||
artifact_url = path.expandvars(full_path)
|
||||
|
||||
print_log(f"Structural Logging data available at: {artifact_url}")
|
||||
|
@@ -1,7 +1,7 @@
|
||||
from .console_format import CONSOLE_LOG
|
||||
from .gitlab_section import GitlabSection
|
||||
from .lava_job import LAVAJob
|
||||
from .lava_job_definition import LAVAJobDefinition
|
||||
from .lava_job_definition import generate_lava_job_definition
|
||||
from .lava_proxy import call_proxy, setup_lava_proxy
|
||||
from .log_follower import (
|
||||
LogFollower,
|
||||
|
@@ -1,14 +0,0 @@
|
||||
from os import getenv
|
||||
|
||||
# How many attempts should be made when a timeout happen during LAVA device boot.
|
||||
NUMBER_OF_ATTEMPTS_LAVA_BOOT = int(getenv("LAVA_NUMBER_OF_ATTEMPTS_LAVA_BOOT", 3))
|
||||
|
||||
|
||||
# Supports any integers in [0, 100].
|
||||
# The scheduler considers the job priority when ordering the queue
|
||||
# to consider which job should run next.
|
||||
JOB_PRIORITY = int(getenv("JOB_PRIORITY", 75))
|
||||
|
||||
# Use UART over the default SSH mechanism to follow logs.
|
||||
# Caution: this can lead to device silence in some devices in Mesa CI.
|
||||
FORCE_UART = bool(getenv("LAVA_FORCE_UART", False))
|
@@ -1,216 +1,150 @@
|
||||
from io import StringIO
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from ruamel.yaml import YAML
|
||||
|
||||
import re
|
||||
from lava.utils.lava_farm import LavaFarm, get_lava_farm
|
||||
from lava.utils.ssh_job_definition import (
|
||||
generate_docker_test,
|
||||
generate_dut_test,
|
||||
wrap_boot_action,
|
||||
wrap_final_deploy_action,
|
||||
)
|
||||
from lava.utils.uart_job_definition import (
|
||||
fastboot_boot_action,
|
||||
fastboot_deploy_actions,
|
||||
tftp_boot_action,
|
||||
tftp_deploy_actions,
|
||||
uart_test_actions,
|
||||
)
|
||||
from ruamel.yaml.scalarstring import LiteralScalarString
|
||||
from ruamel.yaml import YAML
|
||||
from os import getenv
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from lava.lava_job_submitter import LAVAJobSubmitter
|
||||
|
||||
from .constants import FORCE_UART, JOB_PRIORITY, NUMBER_OF_ATTEMPTS_LAVA_BOOT
|
||||
# How many attempts should be made when a timeout happen during LAVA device boot.
|
||||
NUMBER_OF_ATTEMPTS_LAVA_BOOT = int(getenv("LAVA_NUMBER_OF_ATTEMPTS_LAVA_BOOT", 3))
|
||||
|
||||
# Supports any integers in [0, 100].
|
||||
# The scheduler considers the job priority when ordering the queue
|
||||
# to consider which job should run next.
|
||||
JOB_PRIORITY = int(getenv("JOB_PRIORITY", 75))
|
||||
|
||||
|
||||
class LAVAJobDefinition:
|
||||
def has_ssh_support(job_submitter: "LAVAJobSubmitter") -> bool:
|
||||
force_uart = bool(getenv("LAVA_FORCE_UART", False))
|
||||
|
||||
if force_uart:
|
||||
return False
|
||||
|
||||
# Only Collabora's farm supports to run docker container as a LAVA actions,
|
||||
# which is required to follow the job in a SSH section
|
||||
current_farm = get_lava_farm()
|
||||
|
||||
# SSH job definition still needs to add support for fastboot.
|
||||
job_uses_fastboot: bool = job_submitter.boot_method == "fastboot"
|
||||
|
||||
return current_farm == LavaFarm.COLLABORA and not job_uses_fastboot
|
||||
|
||||
|
||||
def generate_lava_yaml_payload(job_submitter: "LAVAJobSubmitter") -> dict[str, Any]:
|
||||
"""
|
||||
This class is responsible for generating the YAML payload to submit a LAVA
|
||||
job.
|
||||
Bridge function to use the supported job definition depending on some Mesa
|
||||
CI job characteristics.
|
||||
|
||||
The strategy here, is to use LAVA with a containerized SSH session to follow
|
||||
the job output, escaping from dumping data to the UART, which proves to be
|
||||
error prone in some devices.
|
||||
"""
|
||||
from lava.utils.ssh_job_definition import (
|
||||
generate_lava_yaml_payload as ssh_lava_yaml,
|
||||
)
|
||||
from lava.utils.uart_job_definition import (
|
||||
generate_lava_yaml_payload as uart_lava_yaml,
|
||||
)
|
||||
|
||||
def __init__(self, job_submitter: "LAVAJobSubmitter") -> None:
|
||||
self.job_submitter: "LAVAJobSubmitter" = job_submitter
|
||||
if has_ssh_support(job_submitter):
|
||||
return ssh_lava_yaml(job_submitter)
|
||||
|
||||
def has_ssh_support(self) -> bool:
|
||||
if FORCE_UART:
|
||||
return False
|
||||
return uart_lava_yaml(job_submitter)
|
||||
|
||||
# Only Collabora's farm supports to run docker container as a LAVA actions,
|
||||
# which is required to follow the job in a SSH section
|
||||
current_farm = get_lava_farm()
|
||||
|
||||
return current_farm == LavaFarm.COLLABORA
|
||||
def generate_lava_job_definition(job_submitter: "LAVAJobSubmitter") -> str:
|
||||
job_stream = StringIO()
|
||||
yaml = YAML()
|
||||
yaml.width = 4096
|
||||
yaml.dump(generate_lava_yaml_payload(job_submitter), job_stream)
|
||||
return job_stream.getvalue()
|
||||
|
||||
def generate_lava_yaml_payload(self) -> dict[str, Any]:
|
||||
"""
|
||||
Generates a YAML payload for submitting a LAVA job, based on the provided arguments.
|
||||
|
||||
Args:
|
||||
None
|
||||
def to_yaml_block(steps_array: list[str], escape_vars=[]) -> LiteralScalarString:
|
||||
def escape_envvar(match):
|
||||
return "\\" + match.group(0)
|
||||
|
||||
Returns:
|
||||
a dictionary containing the values generated by the `generate_metadata` function and the
|
||||
actions for the LAVA job submission.
|
||||
"""
|
||||
args = self.job_submitter
|
||||
values = self.generate_metadata()
|
||||
nfsrootfs = {
|
||||
"url": f"{args.rootfs_url_prefix}/lava-rootfs.tar.zst",
|
||||
"compression": "zstd",
|
||||
}
|
||||
filtered_array = [s for s in steps_array if s.strip() and not s.startswith("#")]
|
||||
final_str = "\n".join(filtered_array)
|
||||
|
||||
init_stage1_steps = self.init_stage1_steps()
|
||||
artifact_download_steps = self.artifact_download_steps()
|
||||
for escape_var in escape_vars:
|
||||
# Find env vars and add '\\' before them
|
||||
final_str = re.sub(rf"\${escape_var}*", escape_envvar, final_str)
|
||||
return LiteralScalarString(final_str)
|
||||
|
||||
deploy_actions = []
|
||||
boot_action = []
|
||||
test_actions = uart_test_actions(args, init_stage1_steps, artifact_download_steps)
|
||||
|
||||
if args.boot_method == "fastboot":
|
||||
deploy_actions = fastboot_deploy_actions(self, nfsrootfs)
|
||||
boot_action = fastboot_boot_action(args)
|
||||
else: # tftp
|
||||
deploy_actions = tftp_deploy_actions(self, nfsrootfs)
|
||||
boot_action = tftp_boot_action(args)
|
||||
|
||||
if self.has_ssh_support():
|
||||
wrap_final_deploy_action(deploy_actions[-1])
|
||||
# SSH jobs use namespaces to differentiate between the DUT and the
|
||||
# docker container. Every LAVA action needs an explicit namespace, when we are not using
|
||||
# the default one.
|
||||
for deploy_action in deploy_actions:
|
||||
deploy_action["namespace"] = "dut"
|
||||
wrap_boot_action(boot_action)
|
||||
test_actions = (
|
||||
generate_dut_test(args, init_stage1_steps),
|
||||
generate_docker_test(args, artifact_download_steps),
|
||||
)
|
||||
|
||||
values["actions"] = [
|
||||
*[{"deploy": d} for d in deploy_actions],
|
||||
{"boot": boot_action},
|
||||
*[{"test": t} for t in test_actions],
|
||||
]
|
||||
|
||||
return values
|
||||
|
||||
def generate_lava_job_definition(self) -> str:
|
||||
"""
|
||||
Generates a LAVA job definition in YAML format and returns it as a string.
|
||||
|
||||
Returns:
|
||||
a string representation of the job definition generated by analysing job submitter
|
||||
arguments and environment variables
|
||||
"""
|
||||
job_stream = StringIO()
|
||||
yaml = YAML()
|
||||
yaml.width = 4096
|
||||
yaml.dump(self.generate_lava_yaml_payload(), job_stream)
|
||||
return job_stream.getvalue()
|
||||
|
||||
def generate_metadata(self) -> dict[str, Any]:
|
||||
# General metadata and permissions
|
||||
values = {
|
||||
"job_name": f"{self.job_submitter.project_name}: {self.job_submitter.pipeline_info}",
|
||||
"device_type": self.job_submitter.device_type,
|
||||
"visibility": {"group": [self.job_submitter.visibility_group]},
|
||||
"priority": JOB_PRIORITY,
|
||||
"context": {"extra_nfsroot_args": " init=/init rootwait usbcore.quirks=0bda:8153:k"},
|
||||
"timeouts": {
|
||||
"job": {"minutes": self.job_submitter.job_timeout_min},
|
||||
"actions": {
|
||||
"depthcharge-retry": {
|
||||
# Could take between 1 and 1.5 min in slower boots
|
||||
"minutes": 4
|
||||
},
|
||||
"depthcharge-start": {
|
||||
# Should take less than 1 min.
|
||||
"minutes": 1,
|
||||
},
|
||||
"depthcharge-action": {
|
||||
# This timeout englobes the entire depthcharge timing,
|
||||
# including retries
|
||||
"minutes": 5
|
||||
* NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
},
|
||||
def generate_metadata(args) -> dict[str, Any]:
|
||||
# General metadata and permissions
|
||||
values = {
|
||||
"job_name": f"mesa: {args.pipeline_info}",
|
||||
"device_type": args.device_type,
|
||||
"visibility": {"group": [args.visibility_group]},
|
||||
"priority": JOB_PRIORITY,
|
||||
"context": {
|
||||
"extra_nfsroot_args": " init=/init rootwait usbcore.quirks=0bda:8153:k"
|
||||
},
|
||||
"timeouts": {
|
||||
"job": {"minutes": args.job_timeout_min},
|
||||
"actions": {
|
||||
"depthcharge-retry": {
|
||||
# Could take between 1 and 1.5 min in slower boots
|
||||
"minutes": 4
|
||||
},
|
||||
"depthcharge-start": {
|
||||
# Should take less than 1 min.
|
||||
"minutes": 1,
|
||||
},
|
||||
"depthcharge-action": {
|
||||
# This timeout englobes the entire depthcharge timing,
|
||||
# including retries
|
||||
"minutes": 5
|
||||
* NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
if self.job_submitter.lava_tags:
|
||||
values["tags"] = self.job_submitter.lava_tags.split(",")
|
||||
if args.lava_tags:
|
||||
values["tags"] = args.lava_tags.split(",")
|
||||
|
||||
return values
|
||||
return values
|
||||
|
||||
def attach_kernel_and_dtb(self, deploy_field):
|
||||
if self.job_submitter.kernel_image_type:
|
||||
deploy_field["kernel"]["type"] = self.job_submitter.kernel_image_type
|
||||
if self.job_submitter.dtb_filename:
|
||||
deploy_field["dtb"] = {
|
||||
"url": f"{self.job_submitter.kernel_url_prefix}/"
|
||||
f"{self.job_submitter.dtb_filename}.dtb"
|
||||
}
|
||||
|
||||
def attach_external_modules(self, deploy_field):
|
||||
if self.job_submitter.kernel_external:
|
||||
deploy_field["modules"] = {
|
||||
"url": f"{self.job_submitter.kernel_url_prefix}/modules.tar.zst",
|
||||
"compression": "zstd"
|
||||
}
|
||||
def artifact_download_steps(args):
|
||||
"""
|
||||
This function is responsible for setting up the SSH server in the DUT and to
|
||||
export the first boot environment to a file.
|
||||
"""
|
||||
# Putting JWT pre-processing and mesa download, within init-stage1.sh file,
|
||||
# as we do with non-SSH version.
|
||||
download_steps = [
|
||||
"set -ex",
|
||||
"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 "
|
||||
f"{args.job_rootfs_overlay_url} | tar -xz -C /",
|
||||
f"mkdir -p {args.ci_project_dir}",
|
||||
f"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 {args.build_url} | "
|
||||
f"tar --zstd -x -C {args.ci_project_dir}",
|
||||
]
|
||||
|
||||
def artifact_download_steps(self):
|
||||
"""
|
||||
This function is responsible for setting up the SSH server in the DUT and to
|
||||
export the first boot environment to a file.
|
||||
"""
|
||||
# Putting JWT pre-processing and mesa download, within init-stage1.sh file,
|
||||
# as we do with non-SSH version.
|
||||
download_steps = [
|
||||
"set -ex",
|
||||
"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 "
|
||||
f"{self.job_submitter.job_rootfs_overlay_url} | tar -xz -C /",
|
||||
f"mkdir -p {self.job_submitter.ci_project_dir}",
|
||||
f"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 {self.job_submitter.build_url} | "
|
||||
f"tar --zstd -x -C {self.job_submitter.ci_project_dir}",
|
||||
# If the JWT file is provided, we will use it to authenticate with the cloud
|
||||
# storage provider and will hide it from the job output in Gitlab.
|
||||
if args.jwt_file:
|
||||
with open(args.jwt_file) as jwt_file:
|
||||
download_steps += [
|
||||
"set +x # HIDE_START",
|
||||
f'echo -n "{jwt_file.read()}" > "{args.jwt_file}"',
|
||||
"set -x # HIDE_END",
|
||||
f'echo "export CI_JOB_JWT_FILE={args.jwt_file}" >> /set-job-env-vars.sh',
|
||||
]
|
||||
else:
|
||||
download_steps += [
|
||||
"echo Could not find jwt file, disabling S3 requests...",
|
||||
"sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh",
|
||||
]
|
||||
|
||||
# If the JWT file is provided, we will use it to authenticate with the cloud
|
||||
# storage provider and will hide it from the job output in Gitlab.
|
||||
if self.job_submitter.jwt_file:
|
||||
with open(self.job_submitter.jwt_file) as jwt_file:
|
||||
download_steps += [
|
||||
"set +x # HIDE_START",
|
||||
f'echo -n "{jwt_file.read()}" > "{self.job_submitter.jwt_file}"',
|
||||
"set -x # HIDE_END",
|
||||
f'echo "export CI_JOB_JWT_FILE={self.job_submitter.jwt_file}" >> /set-job-env-vars.sh',
|
||||
]
|
||||
else:
|
||||
download_steps += [
|
||||
"echo Could not find jwt file, disabling S3 requests...",
|
||||
"sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh",
|
||||
]
|
||||
|
||||
return download_steps
|
||||
|
||||
def init_stage1_steps(self) -> list[str]:
|
||||
run_steps = []
|
||||
# job execution script:
|
||||
# - inline .gitlab-ci/common/init-stage1.sh
|
||||
# - fetch and unpack per-pipeline build artifacts from build job
|
||||
# - fetch and unpack per-job environment from lava-submit.sh
|
||||
# - exec .gitlab-ci/common/init-stage2.sh
|
||||
|
||||
with open(self.job_submitter.first_stage_init, "r") as init_sh:
|
||||
run_steps += [x.rstrip() for x in init_sh if not x.startswith("#") and x.rstrip()]
|
||||
# We cannot distribute the Adreno 660 shader firmware inside rootfs,
|
||||
# since the license isn't bundled inside the repository
|
||||
if self.job_submitter.device_type == "sm8350-hdk":
|
||||
run_steps.append(
|
||||
"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 "
|
||||
+ "https://github.com/allahjasif1990/hdk888-firmware/raw/main/a660_zap.mbn "
|
||||
+ '-o "/lib/firmware/qcom/sm8350/a660_zap.mbn"'
|
||||
)
|
||||
|
||||
return run_steps
|
||||
return download_steps
|
||||
|
@@ -28,15 +28,15 @@ script after sourcing "dut-env-vars.sh" again for the second SSH test case.
|
||||
"""
|
||||
|
||||
|
||||
import re
|
||||
from typing import TYPE_CHECKING, Any, Iterable
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from ruamel.yaml.scalarstring import LiteralScalarString
|
||||
|
||||
from .constants import NUMBER_OF_ATTEMPTS_LAVA_BOOT
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..lava_job_submitter import LAVAJobSubmitter
|
||||
from .lava_job_definition import (
|
||||
NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
artifact_download_steps,
|
||||
generate_metadata,
|
||||
to_yaml_block,
|
||||
)
|
||||
|
||||
# Very early SSH server setup. Uses /dut_ready file to flag it is done.
|
||||
SSH_SERVER_COMMANDS = {
|
||||
@@ -79,23 +79,12 @@ lava_ssh_test_case() {
|
||||
]
|
||||
|
||||
|
||||
def to_yaml_block(steps_array: Iterable[str], escape_vars=[]) -> LiteralScalarString:
|
||||
def escape_envvar(match):
|
||||
return "\\" + match.group(0)
|
||||
|
||||
filtered_array = [s for s in steps_array if s.strip() and not s.startswith("#")]
|
||||
final_str = "\n".join(filtered_array)
|
||||
|
||||
for escape_var in escape_vars:
|
||||
# Find env vars and add '\\' before them
|
||||
final_str = re.sub(rf"\${escape_var}*", escape_envvar, final_str)
|
||||
return LiteralScalarString(final_str)
|
||||
|
||||
|
||||
def generate_dut_test(args: "LAVAJobSubmitter", first_stage_steps: list[str]) -> dict[str, Any]:
|
||||
def generate_dut_test(args):
|
||||
# Commands executed on DUT.
|
||||
# Trying to execute the minimal number of commands, because the console data is
|
||||
# retrieved via UART, which is hang-prone in some devices.
|
||||
|
||||
first_stage_steps: list[str] = Path(args.first_stage_init).read_text().splitlines()
|
||||
return {
|
||||
"namespace": "dut",
|
||||
"definitions": [
|
||||
@@ -120,9 +109,7 @@ def generate_dut_test(args: "LAVAJobSubmitter", first_stage_steps: list[str]) ->
|
||||
}
|
||||
|
||||
|
||||
def generate_docker_test(
|
||||
args: "LAVAJobSubmitter", artifact_download_steps: list[str]
|
||||
) -> dict[str, Any]:
|
||||
def generate_docker_test(args):
|
||||
# This is a growing list of commands that will be executed by the docker
|
||||
# guest, which will be the SSH client.
|
||||
docker_commands = []
|
||||
@@ -161,14 +148,14 @@ def generate_docker_test(
|
||||
(
|
||||
"lava_ssh_test_case 'artifact_download' 'bash --' << EOF",
|
||||
"source /dut-env-vars.sh",
|
||||
*artifact_download_steps,
|
||||
*artifact_download_steps(args),
|
||||
"EOF",
|
||||
)
|
||||
),
|
||||
"export SSH_PTY_ARGS=-tt",
|
||||
# Putting CI_JOB name as the testcase name, it may help LAVA farm
|
||||
# maintainers with monitoring
|
||||
f"lava_ssh_test_case '{args.project_name}_{args.mesa_job_name}' "
|
||||
f"lava_ssh_test_case 'mesa-ci_{args.mesa_job_name}' "
|
||||
# Changing directory to /, as the HWCI_SCRIPT expects that
|
||||
"'\"cd / && /init-stage2.sh\"'",
|
||||
]
|
||||
@@ -176,21 +163,46 @@ def generate_docker_test(
|
||||
return init_stages_test
|
||||
|
||||
|
||||
def wrap_final_deploy_action(final_deploy_action: dict):
|
||||
wrap = {
|
||||
def generate_lava_yaml_payload(args) -> dict[str, Any]:
|
||||
values = generate_metadata(args)
|
||||
|
||||
# URLs to our kernel rootfs to boot from, both generated by the base
|
||||
# container build
|
||||
deploy = {
|
||||
"namespace": "dut",
|
||||
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
"timeout": {"minutes": 10},
|
||||
"timeouts": {"http-download": {"minutes": 2}},
|
||||
"to": "tftp",
|
||||
"os": "oe",
|
||||
"kernel": {"url": f"{args.kernel_url_prefix}/{args.kernel_image_name}"},
|
||||
"nfsrootfs": {
|
||||
"url": f"{args.rootfs_url_prefix}/lava-rootfs.tar.zst",
|
||||
"compression": "zstd",
|
||||
},
|
||||
}
|
||||
if args.kernel_image_type:
|
||||
deploy["kernel"]["type"] = args.kernel_image_type
|
||||
if args.dtb_filename:
|
||||
deploy["dtb"] = {"url": f"{args.kernel_url_prefix}/{args.dtb_filename}.dtb"}
|
||||
|
||||
final_deploy_action.update(wrap)
|
||||
|
||||
|
||||
def wrap_boot_action(boot_action: dict):
|
||||
wrap = {
|
||||
# always boot over NFS
|
||||
boot = {
|
||||
"namespace": "dut",
|
||||
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
"method": args.boot_method,
|
||||
"commands": "nfs",
|
||||
"prompts": ["lava-shell:"],
|
||||
**SSH_SERVER_COMMANDS,
|
||||
}
|
||||
|
||||
boot_action.update(wrap)
|
||||
# only declaring each job as a single 'test' since LAVA's test parsing is
|
||||
# not useful to us
|
||||
values["actions"] = [
|
||||
{"deploy": deploy},
|
||||
{"boot": boot},
|
||||
{"test": generate_dut_test(args)},
|
||||
{"test": generate_docker_test(args)},
|
||||
]
|
||||
|
||||
return values
|
||||
|
@@ -1,23 +1,22 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..lava_job_submitter import LAVAJobSubmitter
|
||||
from .lava_job_definition import LAVAJobDefinition
|
||||
|
||||
from .constants import NUMBER_OF_ATTEMPTS_LAVA_BOOT
|
||||
|
||||
# Use the same image that is being used for the hardware enablement and health-checks.
|
||||
# They are pretty small (<100MB) and have all the tools we need to run LAVA, so it is a safe choice.
|
||||
# You can find the Dockerfile here:
|
||||
# https://gitlab.collabora.com/lava/health-check-docker/-/blob/main/Dockerfile
|
||||
# And the registry here: https://gitlab.collabora.com/lava/health-check-docker/container_registry/
|
||||
DOCKER_IMAGE = "registry.gitlab.collabora.com/lava/health-check-docker"
|
||||
from typing import Any
|
||||
from .lava_job_definition import (
|
||||
generate_metadata,
|
||||
NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
artifact_download_steps,
|
||||
)
|
||||
|
||||
|
||||
def fastboot_deploy_actions(
|
||||
job_definition: "LAVAJobDefinition", nfsrootfs
|
||||
) -> tuple[dict[str, Any], ...]:
|
||||
args = job_definition.job_submitter
|
||||
def generate_lava_yaml_payload(args) -> dict[str, Any]:
|
||||
values = generate_metadata(args)
|
||||
|
||||
# URLs to our kernel rootfs to boot from, both generated by the base
|
||||
# container build
|
||||
|
||||
nfsrootfs = {
|
||||
"url": f"{args.rootfs_url_prefix}/lava-rootfs.tar.zst",
|
||||
"compression": "zstd",
|
||||
}
|
||||
|
||||
fastboot_deploy_nfs = {
|
||||
"timeout": {"minutes": 10},
|
||||
"to": "nfs",
|
||||
@@ -35,7 +34,7 @@ def fastboot_deploy_actions(
|
||||
},
|
||||
"postprocess": {
|
||||
"docker": {
|
||||
"image": DOCKER_IMAGE,
|
||||
"image": "registry.gitlab.collabora.com/lava/health-check-docker",
|
||||
"steps": [
|
||||
f"cat Image.gz {args.dtb_filename}.dtb > Image.gz+dtb",
|
||||
"mkbootimg --kernel Image.gz+dtb"
|
||||
@@ -45,28 +44,13 @@ def fastboot_deploy_actions(
|
||||
}
|
||||
},
|
||||
}
|
||||
if args.kernel_image_type:
|
||||
fastboot_deploy_prepare["images"]["kernel"]["type"] = args.kernel_image_type
|
||||
if args.dtb_filename:
|
||||
fastboot_deploy_prepare["images"]["dtb"] = {
|
||||
"url": f"{args.kernel_url_prefix}/{args.dtb_filename}.dtb"
|
||||
}
|
||||
|
||||
fastboot_deploy = {
|
||||
"timeout": {"minutes": 2},
|
||||
"to": "fastboot",
|
||||
"docker": {
|
||||
"image": DOCKER_IMAGE,
|
||||
},
|
||||
"images": {
|
||||
"boot": {"url": "downloads://boot.img"},
|
||||
},
|
||||
}
|
||||
|
||||
# URLs to our kernel rootfs to boot from, both generated by the base
|
||||
# container build
|
||||
job_definition.attach_kernel_and_dtb(fastboot_deploy_prepare["images"])
|
||||
job_definition.attach_external_modules(fastboot_deploy_nfs)
|
||||
|
||||
return (fastboot_deploy_nfs, fastboot_deploy_prepare, fastboot_deploy)
|
||||
|
||||
|
||||
def tftp_deploy_actions(job_definition: "LAVAJobDefinition", nfsrootfs) -> tuple[dict[str, Any]]:
|
||||
args = job_definition.job_submitter
|
||||
tftp_deploy = {
|
||||
"timeout": {"minutes": 5},
|
||||
"to": "tftp",
|
||||
@@ -76,15 +60,40 @@ def tftp_deploy_actions(job_definition: "LAVAJobDefinition", nfsrootfs) -> tuple
|
||||
},
|
||||
"nfsrootfs": nfsrootfs,
|
||||
}
|
||||
job_definition.attach_kernel_and_dtb(tftp_deploy)
|
||||
job_definition.attach_external_modules(tftp_deploy)
|
||||
if args.kernel_image_type:
|
||||
tftp_deploy["kernel"]["type"] = args.kernel_image_type
|
||||
if args.dtb_filename:
|
||||
tftp_deploy["dtb"] = {
|
||||
"url": f"{args.kernel_url_prefix}/{args.dtb_filename}.dtb"
|
||||
}
|
||||
|
||||
return (tftp_deploy,)
|
||||
fastboot_deploy = {
|
||||
"timeout": {"minutes": 2},
|
||||
"to": "fastboot",
|
||||
"docker": {
|
||||
"image": "registry.gitlab.collabora.com/lava/health-check-docker",
|
||||
},
|
||||
"images": {
|
||||
"boot": {"url": "downloads://boot.img"},
|
||||
},
|
||||
}
|
||||
|
||||
fastboot_boot = {
|
||||
"timeout": {"minutes": 2},
|
||||
"docker": {"image": "registry.gitlab.collabora.com/lava/health-check-docker"},
|
||||
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
"method": args.boot_method,
|
||||
"prompts": ["lava-shell:"],
|
||||
"commands": ["set_active a"],
|
||||
}
|
||||
|
||||
tftp_boot = {
|
||||
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
"method": args.boot_method,
|
||||
"prompts": ["lava-shell:"],
|
||||
"commands": "nfs",
|
||||
}
|
||||
|
||||
def uart_test_actions(
|
||||
args: "LAVAJobSubmitter", init_stage1_steps: list[str], artifact_download_steps: list[str]
|
||||
) -> tuple[dict[str, Any]]:
|
||||
# skeleton test definition: only declaring each job as a single 'test'
|
||||
# since LAVA's test parsing is not useful to us
|
||||
run_steps = []
|
||||
@@ -111,8 +120,26 @@ def uart_test_actions(
|
||||
],
|
||||
}
|
||||
|
||||
run_steps += init_stage1_steps
|
||||
run_steps += artifact_download_steps
|
||||
# job execution script:
|
||||
# - inline .gitlab-ci/common/init-stage1.sh
|
||||
# - fetch and unpack per-pipeline build artifacts from build job
|
||||
# - fetch and unpack per-job environment from lava-submit.sh
|
||||
# - exec .gitlab-ci/common/init-stage2.sh
|
||||
|
||||
with open(args.first_stage_init, "r") as init_sh:
|
||||
run_steps += [
|
||||
x.rstrip() for x in init_sh if not x.startswith("#") and x.rstrip()
|
||||
]
|
||||
# We cannot distribute the Adreno 660 shader firmware inside rootfs,
|
||||
# since the license isn't bundled inside the repository
|
||||
if args.device_type == "sm8350-hdk":
|
||||
run_steps.append(
|
||||
"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 "
|
||||
+ "https://github.com/allahjasif1990/hdk888-firmware/raw/main/a660_zap.mbn "
|
||||
+ '-o "/lib/firmware/qcom/sm8350/a660_zap.mbn"'
|
||||
)
|
||||
|
||||
run_steps += artifact_download_steps(args)
|
||||
|
||||
run_steps += [
|
||||
f"mkdir -p {args.ci_project_dir}",
|
||||
@@ -123,31 +150,22 @@ def uart_test_actions(
|
||||
"sleep 1",
|
||||
# Putting CI_JOB name as the testcase name, it may help LAVA farm
|
||||
# maintainers with monitoring
|
||||
f"lava-test-case '{args.project_name}_{args.mesa_job_name}' --shell /init-stage2.sh",
|
||||
f"lava-test-case 'mesa-ci_{args.mesa_job_name}' --shell /init-stage2.sh",
|
||||
]
|
||||
|
||||
return (test,)
|
||||
if args.boot_method == "fastboot":
|
||||
values["actions"] = [
|
||||
{"deploy": fastboot_deploy_nfs},
|
||||
{"deploy": fastboot_deploy_prepare},
|
||||
{"deploy": fastboot_deploy},
|
||||
{"boot": fastboot_boot},
|
||||
{"test": test},
|
||||
]
|
||||
else: # tftp
|
||||
values["actions"] = [
|
||||
{"deploy": tftp_deploy},
|
||||
{"boot": tftp_boot},
|
||||
{"test": test},
|
||||
]
|
||||
|
||||
|
||||
def tftp_boot_action(args: "LAVAJobSubmitter") -> dict[str, Any]:
|
||||
tftp_boot = {
|
||||
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
"method": args.boot_method,
|
||||
"prompts": ["lava-shell:"],
|
||||
"commands": "nfs",
|
||||
}
|
||||
|
||||
return tftp_boot
|
||||
|
||||
|
||||
def fastboot_boot_action(args: "LAVAJobSubmitter") -> dict[str, Any]:
|
||||
fastboot_boot = {
|
||||
"timeout": {"minutes": 2},
|
||||
"docker": {"image": DOCKER_IMAGE},
|
||||
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
|
||||
"method": args.boot_method,
|
||||
"prompts": ["lava-shell:"],
|
||||
"commands": ["set_active a"],
|
||||
}
|
||||
|
||||
return fastboot_boot
|
||||
return values
|
||||
|
@@ -51,8 +51,9 @@ fi
|
||||
|
||||
# Only use GNU time if available, not any shell built-in command
|
||||
case $CI_JOB_NAME in
|
||||
# strace and wine don't seem to mix well
|
||||
# ASAN leak detection is incompatible with strace
|
||||
*-asan*)
|
||||
debian-mingw32-x86_64|*-asan*)
|
||||
if test -f /usr/bin/time; then
|
||||
MESON_TEST_ARGS+=--wrapper=$PWD/.gitlab-ci/meson/time.sh
|
||||
fi
|
||||
@@ -70,7 +71,7 @@ rm -rf _build
|
||||
meson setup _build \
|
||||
--native-file=native.file \
|
||||
--wrap-mode=nofallback \
|
||||
--force-fallback-for perfetto,syn \
|
||||
--force-fallback-for perfetto \
|
||||
${CROSS+--cross "$CROSS_FILE"} \
|
||||
-D prefix=$PWD/install \
|
||||
-D libdir=lib \
|
||||
@@ -84,10 +85,9 @@ meson setup _build \
|
||||
-D libunwind=${UNWIND} \
|
||||
${DRI_LOADERS} \
|
||||
${GALLIUM_ST} \
|
||||
-D gallium-opencl=disabled \
|
||||
-D gallium-drivers=${GALLIUM_DRIVERS:-[]} \
|
||||
-D vulkan-drivers=${VULKAN_DRIVERS:-[]} \
|
||||
-D video-codecs=all \
|
||||
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec \
|
||||
-D werror=true \
|
||||
${EXTRA_OPTION}
|
||||
cd _build
|
||||
@@ -104,11 +104,10 @@ fi
|
||||
|
||||
uncollapsed_section_switch meson-test "meson: test"
|
||||
LC_ALL=C.UTF-8 meson test --num-processes "${FDO_CI_CONCURRENT:-4}" --print-errorlogs ${MESON_TEST_ARGS}
|
||||
section_switch meson-install "meson: install"
|
||||
if command -V mold &> /dev/null ; then
|
||||
mold --run ninja install
|
||||
else
|
||||
ninja install
|
||||
fi
|
||||
cd ..
|
||||
section_end meson-install
|
||||
section_end meson-test
|
||||
|
@@ -106,7 +106,7 @@ deqp-runner junit \
|
||||
--results $RESULTS/failures.csv \
|
||||
--output $RESULTS/junit.xml \
|
||||
--limit 50 \
|
||||
--template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
|
||||
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
|
||||
|
||||
# Report the flakes to the IRC channel for monitoring (if configured):
|
||||
if [ -n "$FLAKES_CHANNEL" ]; then
|
||||
|
@@ -13,8 +13,6 @@ S3_ARGS="--token-file ${CI_JOB_JWT_FILE}"
|
||||
RESULTS=$(realpath -s "$PWD"/results)
|
||||
mkdir -p "$RESULTS"
|
||||
|
||||
export PIGLIT_REPLAY_DESCRIPTION_FILE="$INSTALL/$PIGLIT_TRACES_FILE"
|
||||
|
||||
if [ "$PIGLIT_REPLAY_SUBCOMMAND" = "profile" ]; then
|
||||
yq -iY 'del(.traces[][] | select(.label[]? == "no-perf"))' \
|
||||
"$PIGLIT_REPLAY_DESCRIPTION_FILE"
|
||||
@@ -190,6 +188,8 @@ then
|
||||
printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION"
|
||||
fi
|
||||
|
||||
ARTIFACTS_BASE_URL="https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts"
|
||||
|
||||
./piglit summary aggregate "$RESULTS" -o junit.xml
|
||||
|
||||
PIGLIT_RESULTS="${PIGLIT_RESULTS:-replay}"
|
||||
|
@@ -23,7 +23,7 @@ else
|
||||
STRIP="strip"
|
||||
fi
|
||||
if [ -z "$ARTIFACTS_DEBUG_SYMBOLS" ]; then
|
||||
find install -name \*.so -exec $STRIP --strip-debug {} \;
|
||||
find install -name \*.so -exec $STRIP {} \;
|
||||
fi
|
||||
|
||||
# Test runs don't pull down the git tree, so put the dEQP helper
|
||||
@@ -42,8 +42,6 @@ cp -Rp .gitlab-ci/valve install/
|
||||
cp -Rp .gitlab-ci/vkd3d-proton install/
|
||||
cp -Rp .gitlab-ci/setup-test-env.sh install/
|
||||
cp -Rp .gitlab-ci/*-runner.sh install/
|
||||
cp -Rp .gitlab-ci/bin/structured_logger.py install/
|
||||
cp -Rp .gitlab-ci/bin/custom_logger.py install/
|
||||
find . -path \*/ci/\*.txt \
|
||||
-o -path \*/ci/\*.toml \
|
||||
-o -path \*/ci/\*traces\*.yml \
|
||||
|
@@ -45,24 +45,21 @@
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- changes: &core_file_list
|
||||
- .gitlab-ci.yml
|
||||
- .gitlab-ci/**/*
|
||||
- include/**/*
|
||||
- meson.build
|
||||
- meson_options.txt
|
||||
- build-support/**/*
|
||||
- subprojects/**/*
|
||||
- .gitattributes
|
||||
- src/*
|
||||
- src/compiler/**/*
|
||||
- src/drm-shim/**/*
|
||||
- src/gbm/**/*
|
||||
- src/gtest/**/*
|
||||
# Some src/util and src/compiler files use headers from mesa/ (e.g.
|
||||
# mtypes.h). We should clean that up.
|
||||
- src/mesa/**/*.h
|
||||
- src/tool/**/*
|
||||
- src/util/**/*
|
||||
- .gitlab-ci.yml
|
||||
- .gitlab-ci/**/*
|
||||
- include/**/*
|
||||
- meson.build
|
||||
- .gitattributes
|
||||
- src/*
|
||||
- src/compiler/**/*
|
||||
- src/drm-shim/**/*
|
||||
- src/gbm/**/*
|
||||
- src/gtest/**/*
|
||||
# Some src/util and src/compiler files use headers from mesa/ (e.g.
|
||||
# mtypes.h). We should clean that up.
|
||||
- src/mesa/**/*.h
|
||||
- src/tool/**/*
|
||||
- src/util/**/*
|
||||
when: on_success
|
||||
|
||||
# Same core dependencies for doing manual runs.
|
||||
@@ -140,36 +137,36 @@
|
||||
rules:
|
||||
- !reference [.core-rules, rules]
|
||||
- changes: &gallium_core_file_list
|
||||
- src/gallium/*
|
||||
- src/gallium/auxiliary/**/*
|
||||
- src/gallium/drivers/*
|
||||
- src/gallium/include/**/*
|
||||
- src/gallium/frontends/dri/*
|
||||
- src/gallium/frontends/glx/**/*
|
||||
- src/gallium/targets/**/*
|
||||
- src/gallium/tests/**/*
|
||||
- src/gallium/winsys/*
|
||||
- src/gallium/*
|
||||
- src/gallium/auxiliary/**/*
|
||||
- src/gallium/drivers/*
|
||||
- src/gallium/include/**/*
|
||||
- src/gallium/frontends/dri/*
|
||||
- src/gallium/frontends/glx/**/*
|
||||
- src/gallium/targets/**/*
|
||||
- src/gallium/tests/**/*
|
||||
- src/gallium/winsys/*
|
||||
when: on_success
|
||||
|
||||
.gl-rules:
|
||||
rules:
|
||||
- !reference [.core-rules, rules]
|
||||
- changes: &mesa_core_file_list
|
||||
- src/egl/**/*
|
||||
- src/glx/**/*
|
||||
- src/loader/**/*
|
||||
- src/mapi/**/*
|
||||
- src/mesa/*
|
||||
- src/mesa/main/**/*
|
||||
- src/mesa/math/**/*
|
||||
- src/mesa/program/**/*
|
||||
- src/mesa/sparc/**/*
|
||||
- src/mesa/state_tracker/**/*
|
||||
- src/mesa/swrast/**/*
|
||||
- src/mesa/swrast_setup/**/*
|
||||
- src/mesa/vbo/**/*
|
||||
- src/mesa/x86/**/*
|
||||
- src/mesa/x86-64/**/*
|
||||
- src/egl/**/*
|
||||
- src/glx/**/*
|
||||
- src/loader/**/*
|
||||
- src/mapi/**/*
|
||||
- src/mesa/*
|
||||
- src/mesa/main/**/*
|
||||
- src/mesa/math/**/*
|
||||
- src/mesa/program/**/*
|
||||
- src/mesa/sparc/**/*
|
||||
- src/mesa/state_tracker/**/*
|
||||
- src/mesa/swrast/**/*
|
||||
- src/mesa/swrast_setup/**/*
|
||||
- src/mesa/vbo/**/*
|
||||
- src/mesa/x86/**/*
|
||||
- src/mesa/x86-64/**/*
|
||||
when: on_success
|
||||
- !reference [.gallium-core-rules, rules]
|
||||
|
||||
@@ -189,7 +186,7 @@
|
||||
rules:
|
||||
- !reference [.core-rules, rules]
|
||||
- changes: &vulkan_file_list
|
||||
- src/vulkan/**/*
|
||||
- src/vulkan/**/*
|
||||
when: on_success
|
||||
|
||||
.vulkan-manual-rules:
|
||||
@@ -202,8 +199,7 @@
|
||||
|
||||
# Rules for unusual architectures that only build a subset of drivers
|
||||
.ppc64el-rules:
|
||||
rules:
|
||||
- !reference [.never-post-merge-rules, rules]
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- !reference [.zink-common-rules, rules]
|
||||
- !reference [.softpipe-rules, rules]
|
||||
@@ -215,8 +211,7 @@
|
||||
- !reference [.nouveau-rules, rules]
|
||||
|
||||
.s390x-rules:
|
||||
rules:
|
||||
- !reference [.never-post-merge-rules, rules]
|
||||
rules:
|
||||
- !reference [.no_scheduled_pipelines-rules, rules]
|
||||
- !reference [.zink-common-rules, rules]
|
||||
- !reference [.softpipe-rules, rules]
|
||||
@@ -225,38 +220,23 @@
|
||||
|
||||
# Rules for linters
|
||||
.lint-rustfmt-rules:
|
||||
rules:
|
||||
- !reference [.never-post-merge-rules, rules]
|
||||
rules:
|
||||
- !reference [.core-rules, rules]
|
||||
# in merge pipeline, formatting checks are not allowed to fail
|
||||
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
changes: &rust_file_list
|
||||
- src/**/*.rs
|
||||
- changes:
|
||||
- src/**/*.rs
|
||||
when: on_success
|
||||
allow_failure: false
|
||||
# in other pipelines, formatting checks are allowed to fail
|
||||
- changes: *rust_file_list
|
||||
when: on_success
|
||||
allow_failure: true
|
||||
|
||||
.lint-clang-format-rules:
|
||||
rules:
|
||||
- !reference [.never-post-merge-rules, rules]
|
||||
rules:
|
||||
- !reference [.core-rules, rules]
|
||||
# in merge pipeline, formatting checks are not allowed to fail
|
||||
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
changes: &clang_format_file_list
|
||||
- .clang-format
|
||||
- .clang-format-include
|
||||
- .clang-format-ignore
|
||||
- src/**/.clang-format
|
||||
- src/egl/**/*
|
||||
- src/amd/vulkan/**/*
|
||||
- src/amd/compiler/**/*
|
||||
- src/etnaviv/isa/**/*
|
||||
- changes:
|
||||
- .clang-format
|
||||
- .clang-format-include
|
||||
- .clang-format-ignore
|
||||
- src/**/.clang-format
|
||||
- src/egl/**/*
|
||||
- src/**/asahi/**/*
|
||||
- src/**/panfrost/**/*
|
||||
- src/amd/vulkan/**/*
|
||||
- src/amd/compiler/**/*
|
||||
when: on_success
|
||||
allow_failure: false
|
||||
# in other pipelines, formatting checks are allowed to fail
|
||||
- changes: *clang_format_file_list
|
||||
when: on_success
|
||||
allow_failure: true
|
||||
|
@@ -16,22 +16,23 @@
|
||||
name: "mesa_${CI_JOB_NAME}"
|
||||
paths:
|
||||
- results/
|
||||
rules:
|
||||
- !reference [.never-post-merge-rules, rules]
|
||||
|
||||
.formatting-check:
|
||||
# Cancel job if a newer commit is pushed to the same branch
|
||||
interruptible: true
|
||||
stage: code-validation
|
||||
stage: lint
|
||||
extends:
|
||||
- .use-debian/x86_64_build
|
||||
rules:
|
||||
# in merge pipeline, don't touch the default settings
|
||||
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
|
||||
# in other pipelines, formatting checks are allowed to fail
|
||||
- allow_failure: true
|
||||
variables:
|
||||
GIT_STRATEGY: fetch
|
||||
timeout: 10m
|
||||
script:
|
||||
- git diff --color=always --exit-code # Fails if there are diffs
|
||||
tags:
|
||||
- placeholder-job
|
||||
|
||||
rustfmt:
|
||||
extends:
|
||||
@@ -41,7 +42,6 @@ rustfmt:
|
||||
- shopt -s globstar
|
||||
- rustfmt --version
|
||||
- rustfmt --verbose src/**/lib.rs
|
||||
- rustfmt --verbose src/**/main.rs
|
||||
|
||||
clang-format:
|
||||
extends:
|
||||
@@ -57,29 +57,6 @@ clang-format:
|
||||
- clang-format-${LLVM_VERSION} --version
|
||||
- ninja -C build clang-format
|
||||
|
||||
.test-check:
|
||||
# Cancel job if a newer commit is pushed to the same branch
|
||||
interruptible: true
|
||||
stage: code-validation
|
||||
extends:
|
||||
- .use-debian/x86_64_build
|
||||
variables:
|
||||
GIT_STRATEGY: fetch
|
||||
timeout: 10m
|
||||
|
||||
python-test:
|
||||
extends:
|
||||
- .test-check
|
||||
script:
|
||||
- cd bin/ci
|
||||
- pip install --break-system-packages -r test/requirements.txt
|
||||
- PYTHONPATH=. pytest -v
|
||||
rules:
|
||||
- !reference [.disable-farm-mr-rules, rules]
|
||||
- !reference [.never-post-merge-rules, rules]
|
||||
- changes:
|
||||
- bin/ci/**/*
|
||||
|
||||
.test-gl:
|
||||
extends:
|
||||
- .test
|
||||
@@ -301,11 +278,8 @@ python-test:
|
||||
# like FDO_DISTRIBUTION_TAG for *the* image, there is no way to
|
||||
# depend on more than one image per job. So, the job container is
|
||||
# built as part of the CI in the boot2container project.
|
||||
image: registry.freedesktop.org/gfx-ci/ci-tron/mesa-trigger:2024-01-05.1
|
||||
image: registry.freedesktop.org/gfx-ci/ci-tron/mesa-trigger:2023-06-02.1
|
||||
timeout: 1h 40m
|
||||
rules:
|
||||
- if: $FORCE_KERNEL_TAG != null
|
||||
when: never
|
||||
variables:
|
||||
# No need by default to pull the whole repo
|
||||
GIT_STRATEGY: none
|
||||
@@ -345,7 +319,7 @@ python-test:
|
||||
- !reference [default, before_script]
|
||||
|
||||
- |
|
||||
set -eux
|
||||
set -x
|
||||
|
||||
# Useful as a hook point for runner admins. You may edit the
|
||||
# config.toml for the Gitlab runner and use a bind-mount to
|
||||
@@ -366,17 +340,44 @@ python-test:
|
||||
[ -d "$CI_B2C_ARTIFACTS" ] || exit 1
|
||||
[ -d "$CI_COMMON_SCRIPTS" ] || exit 1
|
||||
|
||||
export B2C_CONTAINER_CMD="bash -euc 'tar xf ${INSTALL_TARBALL_NAME}; ./install/common/init-stage2.sh'"
|
||||
|
||||
B2C_TEST_SCRIPT="bash -euc 'tar xf ${INSTALL_TARBALL_NAME}; ./install/common/init-stage2.sh'"
|
||||
|
||||
# The Valve CI gateway receives jobs in a YAML format. Create a
|
||||
# job description from the CI environment.
|
||||
python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py
|
||||
python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py \
|
||||
--ci-job-id "${CI_JOB_ID}" \
|
||||
--container-cmd "${B2C_TEST_SCRIPT}" \
|
||||
--initramfs-url "${B2C_INITRAMFS_URL}" \
|
||||
--job-success-regex "${B2C_JOB_SUCCESS_REGEX}" \
|
||||
--job-warn-regex "${B2C_JOB_WARN_REGEX}" \
|
||||
--kernel-url "${B2C_KERNEL_URL}" \
|
||||
--log-level "${B2C_LOG_LEVEL}" \
|
||||
--poweroff-delay "${B2C_POWEROFF_DELAY}" \
|
||||
--session-end-regex "${B2C_SESSION_END_REGEX}" \
|
||||
--session-reboot-regex "${B2C_SESSION_REBOOT_REGEX}" \
|
||||
--tags "${CI_RUNNER_TAGS}" \
|
||||
--template "${B2C_JOB_TEMPLATE}" \
|
||||
--timeout-boot-minutes "${B2C_TIMEOUT_BOOT_MINUTES}" \
|
||||
--timeout-boot-retries "${B2C_TIMEOUT_BOOT_RETRIES}" \
|
||||
--timeout-first-minutes "${B2C_TIMEOUT_FIRST_MINUTES}" \
|
||||
--timeout-first-retries "${B2C_TIMEOUT_FIRST_RETRIES}" \
|
||||
--timeout-minutes "${B2C_TIMEOUT_MINUTES}" \
|
||||
--timeout-overall-minutes "${B2C_TIMEOUT_OVERALL_MINUTES}" \
|
||||
--timeout-retries "${B2C_TIMEOUT_RETRIES}" \
|
||||
--job-volume-exclusions "${B2C_JOB_VOLUME_EXCLUSIONS}" \
|
||||
--local-container "${IMAGE_UNDER_TEST}" \
|
||||
${B2C_EXTRA_VOLUME_ARGS} \
|
||||
--working-dir "$CI_PROJECT_DIR"
|
||||
|
||||
cat b2c.yml.jinja2
|
||||
|
||||
rm -rf ${JOB_FOLDER} || true
|
||||
mkdir -v ${JOB_FOLDER}
|
||||
|
||||
# Keep the results path the same as baremetal and LAVA
|
||||
ln -s "$JOB_FOLDER"/results/ .
|
||||
|
||||
# Create a script to regenerate the CI environment when this job
|
||||
# begins running on the remote DUT.
|
||||
set +x
|
||||
@@ -384,6 +385,7 @@ python-test:
|
||||
echo "export SCRIPTS_DIR=./install" >> ${JOB_FOLDER}/set-job-env-vars.sh
|
||||
echo "Variables passed through:"
|
||||
cat ${JOB_FOLDER}/set-job-env-vars.sh
|
||||
echo "export CI_JOB_JWT=${CI_JOB_JWT}" >> ${JOB_FOLDER}/set-job-env-vars.sh
|
||||
set -x
|
||||
|
||||
# Copy the mesa install tarball to the job folder, for later extraction
|
||||
@@ -399,16 +401,10 @@ python-test:
|
||||
env PYTHONUNBUFFERED=1 executorctl \
|
||||
run -w b2c.yml.jinja2 -j $(slugify "$CI_JOB_NAME") -s ${JOB_FOLDER} -i "$CI_RUNNER_DESCRIPTION"
|
||||
|
||||
# Anything our job places in results/ will be collected by the
|
||||
# Gitlab coordinator for status presentation. results/junit.xml
|
||||
# will be parsed by the UI for more detailed explanations of
|
||||
# test execution.
|
||||
after_script:
|
||||
# Keep the results path the same as baremetal and LAVA
|
||||
- mkdir -p "${JOB_FOLDER}"/results
|
||||
- mv "${JOB_FOLDER}"/results results/
|
||||
- !reference [default, after_script]
|
||||
|
||||
# Anything our job places in results/ will be collected by the
|
||||
# Gitlab coordinator for status presentation. results/junit.xml
|
||||
# will be parsed by the UI for more detailed explanations of
|
||||
# test execution.
|
||||
artifacts:
|
||||
when: always
|
||||
name: "mesa_${CI_JOB_NAME}"
|
||||
|
@@ -1,142 +0,0 @@
|
||||
job_name: 'test-project: my_pipeline_info'
|
||||
device_type: my_fastboot_device_type
|
||||
visibility:
|
||||
group:
|
||||
- my_visibility_group
|
||||
priority: 75
|
||||
context:
|
||||
extra_nfsroot_args: ' init=/init rootwait usbcore.quirks=0bda:8153:k'
|
||||
timeouts:
|
||||
job:
|
||||
minutes: 10
|
||||
actions:
|
||||
depthcharge-retry:
|
||||
minutes: 4
|
||||
depthcharge-start:
|
||||
minutes: 1
|
||||
depthcharge-action:
|
||||
minutes: 15
|
||||
actions:
|
||||
- deploy:
|
||||
timeout:
|
||||
minutes: 10
|
||||
to: nfs
|
||||
nfsrootfs:
|
||||
url: None/lava-rootfs.tar.zst
|
||||
compression: zstd
|
||||
namespace: dut
|
||||
- deploy:
|
||||
timeout:
|
||||
minutes: 5
|
||||
to: downloads
|
||||
os: oe
|
||||
images:
|
||||
kernel:
|
||||
url: None/None
|
||||
dtb:
|
||||
url: None/my_dtb_filename.dtb
|
||||
postprocess:
|
||||
docker:
|
||||
image: registry.gitlab.collabora.com/lava/health-check-docker
|
||||
steps:
|
||||
- cat Image.gz my_dtb_filename.dtb > Image.gz+dtb
|
||||
- mkbootimg --kernel Image.gz+dtb --cmdline "root=/dev/nfs rw nfsroot=$NFS_SERVER_IP:$NFS_ROOTFS,tcp,hard
|
||||
rootwait ip=dhcp init=/init" --pagesize 4096 --base 0x80000000 -o boot.img
|
||||
namespace: dut
|
||||
- deploy:
|
||||
timeout:
|
||||
minutes: 10
|
||||
to: fastboot
|
||||
docker:
|
||||
image: registry.gitlab.collabora.com/lava/health-check-docker
|
||||
images:
|
||||
boot:
|
||||
url: downloads://boot.img
|
||||
namespace: dut
|
||||
failure_retry: 3
|
||||
- boot:
|
||||
timeout:
|
||||
minutes: 2
|
||||
docker:
|
||||
image: registry.gitlab.collabora.com/lava/health-check-docker
|
||||
failure_retry: 3
|
||||
method: fastboot
|
||||
prompts:
|
||||
- 'lava-shell:'
|
||||
commands:
|
||||
- set_active a
|
||||
namespace: dut
|
||||
auto_login:
|
||||
login_commands:
|
||||
- dropbear -R -B
|
||||
- touch /dut_ready
|
||||
login_prompt: 'ogin:'
|
||||
username: ''
|
||||
- test:
|
||||
namespace: dut
|
||||
definitions:
|
||||
- from: inline
|
||||
name: setup-ssh-server
|
||||
path: inline-setup-ssh-server
|
||||
repository:
|
||||
metadata:
|
||||
format: Lava-Test Test Definition 1.0
|
||||
name: dut-env-export
|
||||
run:
|
||||
steps:
|
||||
- |-
|
||||
echo test FASTBOOT
|
||||
- export -p > /dut-env-vars.sh
|
||||
- test:
|
||||
namespace: container
|
||||
timeout:
|
||||
minutes: 10
|
||||
failure_retry: 3
|
||||
definitions:
|
||||
- name: docker_ssh_client
|
||||
from: inline
|
||||
path: inline/docker_ssh_client.yaml
|
||||
repository:
|
||||
metadata:
|
||||
name: mesa
|
||||
description: Mesa test plan
|
||||
format: Lava-Test Test Definition 1.0
|
||||
run:
|
||||
steps:
|
||||
- |-
|
||||
set -ex
|
||||
timeout 1m bash << EOF
|
||||
while [ -z "$(lava-target-ip)" ]; do
|
||||
echo Waiting for DUT to join LAN;
|
||||
sleep 1;
|
||||
done
|
||||
EOF
|
||||
|
||||
ping -c 5 -w 60 $(lava-target-ip)
|
||||
|
||||
lava_ssh_test_case() {
|
||||
set -x
|
||||
local test_case="${1}"
|
||||
shift
|
||||
lava-test-case "${test_case}" --shell \
|
||||
ssh ${SSH_PTY_ARGS:--T} \
|
||||
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
root@$(lava-target-ip) "${@}"
|
||||
}
|
||||
- lava_ssh_test_case 'wait_for_dut_login' << EOF
|
||||
- while [ ! -e /dut_ready ]; do sleep 1; done;
|
||||
- EOF
|
||||
- |-
|
||||
lava_ssh_test_case 'artifact_download' 'bash --' << EOF
|
||||
source /dut-env-vars.sh
|
||||
set -ex
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar -xz -C /
|
||||
mkdir -p /ci/project/dir
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar --zstd -x -C /ci/project/dir
|
||||
echo Could not find jwt file, disabling S3 requests...
|
||||
sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
|
||||
EOF
|
||||
- export SSH_PTY_ARGS=-tt
|
||||
- lava_ssh_test_case 'test-project_dut' '"cd / && /init-stage2.sh"'
|
||||
docker:
|
||||
image:
|
@@ -1,96 +0,0 @@
|
||||
job_name: 'test-project: my_pipeline_info'
|
||||
device_type: my_fastboot_device_type
|
||||
visibility:
|
||||
group:
|
||||
- my_visibility_group
|
||||
priority: 75
|
||||
context:
|
||||
extra_nfsroot_args: ' init=/init rootwait usbcore.quirks=0bda:8153:k'
|
||||
timeouts:
|
||||
job:
|
||||
minutes: 10
|
||||
actions:
|
||||
depthcharge-retry:
|
||||
minutes: 4
|
||||
depthcharge-start:
|
||||
minutes: 1
|
||||
depthcharge-action:
|
||||
minutes: 15
|
||||
actions:
|
||||
- deploy:
|
||||
timeout:
|
||||
minutes: 10
|
||||
to: nfs
|
||||
nfsrootfs:
|
||||
url: None/lava-rootfs.tar.zst
|
||||
compression: zstd
|
||||
- deploy:
|
||||
timeout:
|
||||
minutes: 5
|
||||
to: downloads
|
||||
os: oe
|
||||
images:
|
||||
kernel:
|
||||
url: None/None
|
||||
dtb:
|
||||
url: None/my_dtb_filename.dtb
|
||||
postprocess:
|
||||
docker:
|
||||
image: registry.gitlab.collabora.com/lava/health-check-docker
|
||||
steps:
|
||||
- cat Image.gz my_dtb_filename.dtb > Image.gz+dtb
|
||||
- mkbootimg --kernel Image.gz+dtb --cmdline "root=/dev/nfs rw nfsroot=$NFS_SERVER_IP:$NFS_ROOTFS,tcp,hard
|
||||
rootwait ip=dhcp init=/init" --pagesize 4096 --base 0x80000000 -o boot.img
|
||||
- deploy:
|
||||
timeout:
|
||||
minutes: 2
|
||||
to: fastboot
|
||||
docker:
|
||||
image: registry.gitlab.collabora.com/lava/health-check-docker
|
||||
images:
|
||||
boot:
|
||||
url: downloads://boot.img
|
||||
- boot:
|
||||
timeout:
|
||||
minutes: 2
|
||||
docker:
|
||||
image: registry.gitlab.collabora.com/lava/health-check-docker
|
||||
failure_retry: 3
|
||||
method: fastboot
|
||||
prompts:
|
||||
- 'lava-shell:'
|
||||
commands:
|
||||
- set_active a
|
||||
- test:
|
||||
timeout:
|
||||
minutes: 10
|
||||
failure_retry: 1
|
||||
definitions:
|
||||
- name: mesa
|
||||
from: inline
|
||||
lava-signal: kmsg
|
||||
path: inline/mesa.yaml
|
||||
repository:
|
||||
metadata:
|
||||
name: mesa
|
||||
description: Mesa test plan
|
||||
os:
|
||||
- oe
|
||||
scope:
|
||||
- functional
|
||||
format: Lava-Test Test Definition 1.0
|
||||
run:
|
||||
steps:
|
||||
- echo test FASTBOOT
|
||||
- set -ex
|
||||
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar -xz
|
||||
-C /
|
||||
- mkdir -p /ci/project/dir
|
||||
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar --zstd
|
||||
-x -C /ci/project/dir
|
||||
- echo Could not find jwt file, disabling S3 requests...
|
||||
- sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
|
||||
- mkdir -p /ci/project/dir
|
||||
- curl None | tar --zstd -x -C /ci/project/dir
|
||||
- sleep 1
|
||||
- lava-test-case 'test-project_dut' --shell /init-stage2.sh
|
@@ -1,114 +0,0 @@
|
||||
job_name: 'test-project: my_pipeline_info'
|
||||
device_type: my_uboot_device_type
|
||||
visibility:
|
||||
group:
|
||||
- my_visibility_group
|
||||
priority: 75
|
||||
context:
|
||||
extra_nfsroot_args: ' init=/init rootwait usbcore.quirks=0bda:8153:k'
|
||||
timeouts:
|
||||
job:
|
||||
minutes: 10
|
||||
actions:
|
||||
depthcharge-retry:
|
||||
minutes: 4
|
||||
depthcharge-start:
|
||||
minutes: 1
|
||||
depthcharge-action:
|
||||
minutes: 15
|
||||
actions:
|
||||
- deploy:
|
||||
timeout:
|
||||
minutes: 10
|
||||
to: tftp
|
||||
os: oe
|
||||
kernel:
|
||||
url: None/None
|
||||
nfsrootfs:
|
||||
url: None/lava-rootfs.tar.zst
|
||||
compression: zstd
|
||||
dtb:
|
||||
url: None/my_dtb_filename.dtb
|
||||
namespace: dut
|
||||
failure_retry: 3
|
||||
- boot:
|
||||
failure_retry: 3
|
||||
method: u-boot
|
||||
prompts:
|
||||
- 'lava-shell:'
|
||||
commands: nfs
|
||||
namespace: dut
|
||||
auto_login:
|
||||
login_commands:
|
||||
- dropbear -R -B
|
||||
- touch /dut_ready
|
||||
login_prompt: 'ogin:'
|
||||
username: ''
|
||||
- test:
|
||||
namespace: dut
|
||||
definitions:
|
||||
- from: inline
|
||||
name: setup-ssh-server
|
||||
path: inline-setup-ssh-server
|
||||
repository:
|
||||
metadata:
|
||||
format: Lava-Test Test Definition 1.0
|
||||
name: dut-env-export
|
||||
run:
|
||||
steps:
|
||||
- |-
|
||||
echo test UBOOT
|
||||
- export -p > /dut-env-vars.sh
|
||||
- test:
|
||||
namespace: container
|
||||
timeout:
|
||||
minutes: 10
|
||||
failure_retry: 3
|
||||
definitions:
|
||||
- name: docker_ssh_client
|
||||
from: inline
|
||||
path: inline/docker_ssh_client.yaml
|
||||
repository:
|
||||
metadata:
|
||||
name: mesa
|
||||
description: Mesa test plan
|
||||
format: Lava-Test Test Definition 1.0
|
||||
run:
|
||||
steps:
|
||||
- |-
|
||||
set -ex
|
||||
timeout 1m bash << EOF
|
||||
while [ -z "$(lava-target-ip)" ]; do
|
||||
echo Waiting for DUT to join LAN;
|
||||
sleep 1;
|
||||
done
|
||||
EOF
|
||||
|
||||
ping -c 5 -w 60 $(lava-target-ip)
|
||||
|
||||
lava_ssh_test_case() {
|
||||
set -x
|
||||
local test_case="${1}"
|
||||
shift
|
||||
lava-test-case "${test_case}" --shell \
|
||||
ssh ${SSH_PTY_ARGS:--T} \
|
||||
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
root@$(lava-target-ip) "${@}"
|
||||
}
|
||||
- lava_ssh_test_case 'wait_for_dut_login' << EOF
|
||||
- while [ ! -e /dut_ready ]; do sleep 1; done;
|
||||
- EOF
|
||||
- |-
|
||||
lava_ssh_test_case 'artifact_download' 'bash --' << EOF
|
||||
source /dut-env-vars.sh
|
||||
set -ex
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar -xz -C /
|
||||
mkdir -p /ci/project/dir
|
||||
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar --zstd -x -C /ci/project/dir
|
||||
echo Could not find jwt file, disabling S3 requests...
|
||||
sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
|
||||
EOF
|
||||
- export SSH_PTY_ARGS=-tt
|
||||
- lava_ssh_test_case 'test-project_dut' '"cd / && /init-stage2.sh"'
|
||||
docker:
|
||||
image:
|
@@ -1,70 +0,0 @@
|
||||
job_name: 'test-project: my_pipeline_info'
|
||||
device_type: my_uboot_device_type
|
||||
visibility:
|
||||
group:
|
||||
- my_visibility_group
|
||||
priority: 75
|
||||
context:
|
||||
extra_nfsroot_args: ' init=/init rootwait usbcore.quirks=0bda:8153:k'
|
||||
timeouts:
|
||||
job:
|
||||
minutes: 10
|
||||
actions:
|
||||
depthcharge-retry:
|
||||
minutes: 4
|
||||
depthcharge-start:
|
||||
minutes: 1
|
||||
depthcharge-action:
|
||||
minutes: 15
|
||||
actions:
|
||||
- deploy:
|
||||
timeout:
|
||||
minutes: 5
|
||||
to: tftp
|
||||
os: oe
|
||||
kernel:
|
||||
url: None/None
|
||||
nfsrootfs:
|
||||
url: None/lava-rootfs.tar.zst
|
||||
compression: zstd
|
||||
dtb:
|
||||
url: None/my_dtb_filename.dtb
|
||||
- boot:
|
||||
failure_retry: 3
|
||||
method: u-boot
|
||||
prompts:
|
||||
- 'lava-shell:'
|
||||
commands: nfs
|
||||
- test:
|
||||
timeout:
|
||||
minutes: 10
|
||||
failure_retry: 1
|
||||
definitions:
|
||||
- name: mesa
|
||||
from: inline
|
||||
lava-signal: kmsg
|
||||
path: inline/mesa.yaml
|
||||
repository:
|
||||
metadata:
|
||||
name: mesa
|
||||
description: Mesa test plan
|
||||
os:
|
||||
- oe
|
||||
scope:
|
||||
- functional
|
||||
format: Lava-Test Test Definition 1.0
|
||||
run:
|
||||
steps:
|
||||
- echo test UBOOT
|
||||
- set -ex
|
||||
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar -xz
|
||||
-C /
|
||||
- mkdir -p /ci/project/dir
|
||||
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar --zstd
|
||||
-x -C /ci/project/dir
|
||||
- echo Could not find jwt file, disabling S3 requests...
|
||||
- sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
|
||||
- mkdir -p /ci/project/dir
|
||||
- curl None | tar --zstd -x -C /ci/project/dir
|
||||
- sleep 1
|
||||
- lava-test-case 'test-project_dut' --shell /init-stage2.sh
|
@@ -1,197 +0,0 @@
|
||||
import importlib
|
||||
import os
|
||||
import re
|
||||
from itertools import chain
|
||||
from pathlib import Path
|
||||
from typing import Any, Iterable, Literal
|
||||
from unittest import mock
|
||||
|
||||
import lava.utils.constants
|
||||
import pytest
|
||||
from lava.lava_job_submitter import LAVAJobSubmitter
|
||||
from lava.utils.lava_job_definition import LAVAJobDefinition
|
||||
from ruamel.yaml import YAML
|
||||
|
||||
|
||||
def flatten(iterable: Iterable[Iterable[Any]]) -> list[Any]:
|
||||
return list(chain.from_iterable(iterable))
|
||||
|
||||
|
||||
# mock shell file
|
||||
@pytest.fixture(scope="session")
|
||||
def shell_file(tmp_path_factory):
|
||||
def create_shell_file(content: str = "# test"):
|
||||
shell_file = tmp_path_factory.mktemp("data") / "shell_file.sh"
|
||||
shell_file.write_text(content)
|
||||
return shell_file
|
||||
|
||||
return create_shell_file
|
||||
|
||||
|
||||
# fn to load the data file from $CWD/data using pathlib
|
||||
def load_data_file(filename):
|
||||
return Path(__file__).parent.parent / "data" / filename
|
||||
|
||||
|
||||
def load_yaml_file(filename) -> dict:
|
||||
with open(load_data_file(filename)) as f:
|
||||
return YAML().load(f)
|
||||
|
||||
|
||||
def job_submitter_factory(mode: Literal["UBOOT", "FASTBOOT"], shell_file):
|
||||
if mode == "UBOOT":
|
||||
boot_method = "u-boot"
|
||||
device_type = "my_uboot_device_type"
|
||||
elif mode == "FASTBOOT":
|
||||
boot_method = "fastboot"
|
||||
device_type = "my_fastboot_device_type"
|
||||
|
||||
job_timeout_min = 10
|
||||
mesa_job_name = "dut test"
|
||||
pipeline_info = "my_pipeline_info"
|
||||
project_name = "test-project"
|
||||
visibility_group = "my_visibility_group"
|
||||
|
||||
return LAVAJobSubmitter(
|
||||
boot_method=boot_method,
|
||||
ci_project_dir="/ci/project/dir",
|
||||
device_type=device_type,
|
||||
dtb_filename="my_dtb_filename",
|
||||
first_stage_init=shell_file,
|
||||
job_timeout_min=job_timeout_min,
|
||||
mesa_job_name=mesa_job_name,
|
||||
pipeline_info=pipeline_info,
|
||||
visibility_group=visibility_group,
|
||||
project_name=project_name,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def clear_env_vars(autouse=True):
|
||||
with mock.patch.dict(os.environ) as environ:
|
||||
# Remove all LAVA-related environment variables to make the test more robust
|
||||
# and deterministic, once a envvar is capable of overriding the default value
|
||||
for key in environ:
|
||||
if any(kw in key for kw in ("LAVA_", "CI_", "JOB_", "RUNNER_", "DEVICE_")):
|
||||
del environ[key]
|
||||
# reload lava.utils.constants to update the JOB_PRIORITY value
|
||||
importlib.reload(lava.utils.constants)
|
||||
importlib.reload(lava.utils.lava_job_definition)
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_collabora_farm(clear_env_vars, monkeypatch):
|
||||
# Mock a Collabora farm-like device runner tag to enable SSH execution
|
||||
monkeypatch.setenv("RUNNER_TAG", "mesa-ci-1234-lava-collabora")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("force_uart", [True, False], ids=["SSH", "UART"])
|
||||
@pytest.mark.parametrize("mode", ["UBOOT", "FASTBOOT"])
|
||||
def test_generate_lava_job_definition_sanity(
|
||||
force_uart, mode, shell_file, mock_collabora_farm, monkeypatch
|
||||
):
|
||||
monkeypatch.setattr(lava.utils.lava_job_definition, "FORCE_UART", force_uart)
|
||||
|
||||
init_script_content = f"echo test {mode}"
|
||||
job_submitter = job_submitter_factory(mode, shell_file(init_script_content))
|
||||
job_definition = LAVAJobDefinition(job_submitter).generate_lava_job_definition()
|
||||
|
||||
# Load the YAML output and check that it contains the expected keys and values
|
||||
yaml = YAML()
|
||||
job_dict = yaml.load(job_definition)
|
||||
yaml.dump(job_dict, Path(f"/tmp/{mode}_force_uart={force_uart}_job_definition.yaml"))
|
||||
assert job_dict["device_type"] == job_submitter.device_type
|
||||
assert job_dict["visibility"]["group"] == [job_submitter.visibility_group]
|
||||
assert job_dict["timeouts"]["job"]["minutes"] == job_submitter.job_timeout_min
|
||||
assert job_dict["context"]["extra_nfsroot_args"]
|
||||
assert job_dict["timeouts"]["actions"]
|
||||
|
||||
assert len(job_dict["actions"]) == 3 if mode == "UART" else 5
|
||||
|
||||
last_test_action = job_dict["actions"][-1]["test"]
|
||||
# TODO: Remove hardcoded "mesa" test name, as this submitter is being used by other projects
|
||||
first_test_name = last_test_action["definitions"][0]["name"]
|
||||
is_running_ssh = "ssh" in first_test_name
|
||||
# if force_uart, is_ssh must be False. If is_ssh, force_uart must be False. Both can be False
|
||||
assert not (is_running_ssh and force_uart)
|
||||
assert last_test_action["failure_retry"] == 3 if is_running_ssh else 1
|
||||
|
||||
run_steps = "".join(last_test_action["definitions"][0]["repository"]["run"]["steps"])
|
||||
# Check for project name in lava-test-case
|
||||
assert re.search(rf"lava.?\S*.test.case.*{job_submitter.project_name}", run_steps)
|
||||
|
||||
action_names = flatten(j.keys() for j in job_dict["actions"])
|
||||
if is_running_ssh:
|
||||
assert action_names == (
|
||||
[
|
||||
"deploy",
|
||||
"boot",
|
||||
"test", # DUT: SSH server
|
||||
"test", # Docker: SSH client
|
||||
]
|
||||
if mode == "UBOOT"
|
||||
else [
|
||||
"deploy", # NFS
|
||||
"deploy", # Image generation
|
||||
"deploy", # Image deployment
|
||||
"boot",
|
||||
"test", # DUT: SSH server
|
||||
"test", # Docker: SSH client
|
||||
]
|
||||
)
|
||||
test_action_server = job_dict["actions"][-2]["test"]
|
||||
# SSH server in the DUT
|
||||
assert test_action_server["namespace"] == "dut"
|
||||
# SSH client via docker
|
||||
assert last_test_action["namespace"] == "container"
|
||||
|
||||
boot_action = next(a["boot"] for a in job_dict["actions"] if "boot" in a)
|
||||
assert boot_action["namespace"] == "dut"
|
||||
|
||||
# SSH server bootstrapping
|
||||
assert "dropbear" in "".join(boot_action["auto_login"]["login_commands"])
|
||||
return
|
||||
|
||||
# ---- Not SSH job
|
||||
assert action_names == (
|
||||
[
|
||||
"deploy",
|
||||
"boot",
|
||||
"test",
|
||||
]
|
||||
if mode == "UBOOT"
|
||||
else [
|
||||
"deploy", # NFS
|
||||
"deploy", # Image generation
|
||||
"deploy", # Image deployment
|
||||
"boot",
|
||||
"test",
|
||||
]
|
||||
)
|
||||
assert init_script_content in run_steps
|
||||
|
||||
|
||||
# use yaml files from tests/data/ to test the job definition generation
|
||||
@pytest.mark.parametrize("force_uart", [False, True], ids=["SSH", "UART"])
|
||||
@pytest.mark.parametrize("mode", ["UBOOT", "FASTBOOT"])
|
||||
def test_lava_job_definition(mode, force_uart, shell_file, mock_collabora_farm, monkeypatch):
|
||||
monkeypatch.setattr(lava.utils.lava_job_definition, "FORCE_UART", force_uart)
|
||||
|
||||
yaml = YAML()
|
||||
yaml.default_flow_style = False
|
||||
|
||||
# Load the YAML output and check that it contains the expected keys and values
|
||||
expected_job_dict = load_yaml_file(f"{mode}_force_uart={force_uart}_job_definition.yaml")
|
||||
|
||||
init_script_content = f"echo test {mode}"
|
||||
job_submitter = job_submitter_factory(mode, shell_file(init_script_content))
|
||||
job_definition = LAVAJobDefinition(job_submitter).generate_lava_job_definition()
|
||||
|
||||
job_dict = yaml.load(job_definition)
|
||||
|
||||
# Uncomment the following to update the expected YAML files
|
||||
# yaml.dump(job_dict, Path(f"../../data/{mode}_force_uart={force_uart}_job_definition.yaml"))
|
||||
|
||||
# Check that the generated job definition matches the expected one
|
||||
assert job_dict == expected_job_dict
|
@@ -3,10 +3,6 @@
|
||||
ARG base_image
|
||||
FROM ${base_image}
|
||||
|
||||
COPY mesa_deps_vulkan_sdk.ps1 C:\
|
||||
RUN C:\mesa_deps_vulkan_sdk.ps1
|
||||
|
||||
COPY mesa_init_msvc.ps1 C:\
|
||||
COPY mesa_deps_build.ps1 C:\
|
||||
RUN C:\mesa_deps_build.ps1
|
||||
|
||||
|
@@ -3,20 +3,5 @@
|
||||
ARG base_image
|
||||
FROM ${base_image}
|
||||
|
||||
COPY mesa_deps_vulkan_sdk.ps1 C:\
|
||||
RUN C:\mesa_deps_vulkan_sdk.ps1
|
||||
|
||||
COPY mesa_deps_d3d.ps1 C:\
|
||||
RUN C:\mesa_deps_d3d.ps1
|
||||
|
||||
COPY mesa_deps_rust.ps1 C:\
|
||||
RUN C:\mesa_deps_rust.ps1
|
||||
|
||||
COPY mesa_init_msvc.ps1 C:\
|
||||
|
||||
COPY mesa_deps_test_piglit.ps1 C:\
|
||||
RUN C:\mesa_deps_test_piglit.ps1
|
||||
COPY mesa_deps_test_deqp.ps1 c:\
|
||||
RUN C:\mesa_deps_test_deqp.ps1
|
||||
COPY mesa_deps_test.ps1 C:\
|
||||
RUN C:\mesa_deps_test.ps1
|
||||
|
@@ -12,9 +12,11 @@ RUN powershell -ExecutionPolicy RemoteSigned -Command "$ErrorActionPreference =
|
||||
SHELL ["pwsh", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"]
|
||||
RUN Write-Output $PSVersionTable $ErrorActionPreference
|
||||
|
||||
COPY mesa_deps_msvc.ps1 C:\
|
||||
RUN C:\mesa_deps_msvc.ps1
|
||||
COPY mesa_deps_vs2019.ps1 C:\
|
||||
RUN C:\mesa_deps_vs2019.ps1
|
||||
COPY mesa_vs_init.ps1 C:\
|
||||
|
||||
ENV VULKAN_SDK_VERSION='1.3.211.0'
|
||||
COPY mesa_deps_choco.ps1 C:\
|
||||
RUN C:\mesa_deps_choco.ps1
|
||||
|
||||
@@ -23,5 +25,5 @@ RUN C:\mesa_deps_choco.ps1
|
||||
# since the resulting container will want to be used that way be later containers in the build process.
|
||||
# Only --isolation=hyperv can succeed building this container locally,
|
||||
# --isolation=process have network issue when installing Visual Studio and choco will crash
|
||||
# docker build --isolation=hyperv -f .\Dockerfile_msvc -t mesa_vs --build-arg base_image="mcr.microsoft.com/windows:10.0.19041.1415" .
|
||||
# docker build --isolation=hyperv -f .\Dockerfile_vs -t mesa_vs --build-arg base_image="mcr.microsoft.com/windows:10.0.19041.1415" .
|
||||
|
@@ -27,7 +27,7 @@ deqp-runner suite --suite $($suite) `
|
||||
$jobs
|
||||
$deqpstatus = $?
|
||||
|
||||
$template = "See $($env:ARTIFACTS_BASE_URL)/results/{{testcase}}.xml"
|
||||
$template = "See https://$($env:CI_PROJECT_ROOT_NAMESPACE).pages.freedesktop.org/-/$($env:CI_PROJECT_NAME)/-/jobs/$($env:CI_JOB_ID)/artifacts/results/{{testcase}}.xml"
|
||||
deqp-runner junit --testsuite dEQP --results "$($results)/failures.csv" --output "$($results)/junit.xml" --limit 50 --template $template
|
||||
Copy-Item -Path "C:\deqp\testlog.css" -Destination $($results)
|
||||
Copy-Item -Path "C:\deqp\testlog.xsl" -Destination $($results)
|
||||
|
@@ -30,7 +30,7 @@ Write-Output installdir:$installdir
|
||||
Write-Output sourcedir:$sourcedir
|
||||
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_init_msvc.ps1"
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
$depsInstallPath="C:\mesa-deps"
|
||||
|
||||
@@ -50,7 +50,7 @@ meson setup `
|
||||
-Dvulkan-drivers="swrast,amd,microsoft-experimental" `
|
||||
-Dgallium-drivers="swrast,d3d12,zink" `
|
||||
-Dgallium-va=enabled `
|
||||
-Dvideo-codecs="all" `
|
||||
-Dvideo-codecs="h264dec,h264enc,h265dec,h265enc,vc1dec" `
|
||||
-Dshared-glapi=enabled `
|
||||
-Dgles1=enabled `
|
||||
-Dgles2=enabled `
|
||||
|
@@ -1,6 +1,6 @@
|
||||
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_init_msvc.ps1"
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
# we want more secure TLS 1.2 for most things, but it breaks SourceForge
|
||||
# downloads so must be done after Chocolatey use
|
||||
@@ -12,7 +12,7 @@ $depsInstallPath="C:\mesa-deps"
|
||||
|
||||
Get-Date
|
||||
Write-Host "Cloning DirectX-Headers"
|
||||
git clone -b v1.611.0 --depth=1 https://github.com/microsoft/DirectX-Headers deps/DirectX-Headers
|
||||
git clone -b v1.711.3-preview --depth=1 https://github.com/microsoft/DirectX-Headers deps/DirectX-Headers
|
||||
if (!$?) {
|
||||
Write-Host "Failed to clone DirectX-Headers repository"
|
||||
Exit 1
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Download new TLS certs from Windows Update
|
||||
Write-Host "Updating TLS certificate store at:"
|
||||
Get-Date
|
||||
Write-Host "Updating TLS certificate store"
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "_tlscerts" | Out-Null
|
||||
$certdir = (New-Item -ItemType Directory -Name "_tlscerts")
|
||||
certutil -syncwithWU "$certdir"
|
||||
@@ -9,8 +9,71 @@ Foreach ($file in (Get-ChildItem -Path "$certdir\*" -Include "*.crt")) {
|
||||
}
|
||||
Remove-Item -Recurse -Path $certdir
|
||||
|
||||
Write-Host "Installing graphics tools (DirectX debug layer) at:"
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing Chocolatey"
|
||||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1"
|
||||
Update-SessionEnvironment
|
||||
Write-Host "Installing Chocolatey packages"
|
||||
|
||||
# Chocolatey tries to download winflexbison from SourceForge, which is not super reliable, and has no retry
|
||||
# loop of its own - so we give it a helping hand here
|
||||
For ($i = 0; $i -lt 5; $i++) {
|
||||
choco install --no-progress -y python3 --params="/InstallDir:C:\python3"
|
||||
$python_install = $?
|
||||
choco install --allow-empty-checksums --no-progress -y cmake git git-lfs ninja pkgconfiglite winflexbison --installargs "ADD_CMAKE_TO_PATH=System"
|
||||
$other_install = $?
|
||||
$choco_installed = $other_install -and $python_install
|
||||
if ($choco_installed) {
|
||||
Break
|
||||
}
|
||||
}
|
||||
|
||||
if (!$choco_installed) {
|
||||
Write-Host "Couldn't install dependencies from Chocolatey"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
# Add Chocolatey's native install path
|
||||
Update-SessionEnvironment
|
||||
# Python and CMake add themselves to the system environment path, which doesn't get refreshed
|
||||
# until we start a new shell
|
||||
$env:PATH = "C:\python3;C:\python3\scripts;C:\Program Files\CMake\bin;$env:PATH"
|
||||
|
||||
Start-Process -NoNewWindow -Wait git -ArgumentList 'config --global core.autocrlf false'
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing Meson, Mako and numpy"
|
||||
pip3 install meson mako numpy --progress-bar off
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install dependencies from pip"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading Vulkan-SDK"
|
||||
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanSDK-$env:VULKAN_SDK_VERSION-Installer.exe" -OutFile 'C:\vulkan_sdk.exe'
|
||||
C:\vulkan_sdk.exe --am --al -c in
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install Vulkan SDK"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item C:\vulkan_sdk.exe -Force
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading Vulkan-Runtime"
|
||||
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanRT-$env:VULKAN_SDK_VERSION-Installer.exe" -OutFile 'C:\vulkan-runtime.exe' | Out-Null
|
||||
Write-Host "Installing Vulkan-Runtime"
|
||||
Start-Process -NoNewWindow -Wait C:\vulkan-runtime.exe -ArgumentList '/S'
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install Vulkan-Runtime"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item C:\vulkan-runtime.exe -Force
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing graphics tools (DirectX debug layer)"
|
||||
Set-Service -Name wuauserv -StartupType Manual
|
||||
if (!$?) {
|
||||
Write-Host "Failed to enable Windows Update"
|
||||
@@ -30,48 +93,3 @@ if (!$graphics_tools_installed) {
|
||||
Get-Content C:\Windows\Logs\DISM\dism.log
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Write-Host "Installing Chocolatey at:"
|
||||
Get-Date
|
||||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1"
|
||||
# Add Chocolatey's native install path
|
||||
Update-SessionEnvironment
|
||||
Write-Host "Installing Chocolatey packages at:"
|
||||
Get-Date
|
||||
|
||||
# Chocolatey tries to download winflexbison3 from github, which is not super reliable, and has no retry
|
||||
# loop of its own - so we give it a helping hand here
|
||||
For ($i = 0; $i -lt 5; $i++) {
|
||||
choco install --no-progress -y python3
|
||||
$python_install = $?
|
||||
choco install --allow-empty-checksums --no-progress -y cmake git git-lfs ninja pkgconfiglite winflexbison3 --installargs "ADD_CMAKE_TO_PATH=System"
|
||||
$other_install = $?
|
||||
$choco_installed = $other_install -and $python_install
|
||||
if ($choco_installed) {
|
||||
Break
|
||||
}
|
||||
}
|
||||
|
||||
if (!$choco_installed) {
|
||||
Write-Host "Couldn't install dependencies from Chocolatey"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
# Add Chocolatey's newly installed package path
|
||||
Update-SessionEnvironment
|
||||
|
||||
Start-Process -NoNewWindow -Wait git -ArgumentList 'config --global core.autocrlf false'
|
||||
|
||||
Write-Host "Upgrading pip at:"
|
||||
Get-Date
|
||||
python -m pip install --upgrade pip --progress-bar off
|
||||
Write-Host "Installing python packages at:"
|
||||
Get-Date
|
||||
pip3 install packaging meson mako numpy --progress-bar off
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install dependencies from pip"
|
||||
Exit 1
|
||||
}
|
||||
Write-Host "Installing python packages finished at:"
|
||||
Get-Date
|
||||
|
@@ -1,49 +0,0 @@
|
||||
# Downloading specified D3D runtime
|
||||
# Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG
|
||||
# This file needs run in administrator mode
|
||||
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
$depsInstallPath="C:\mesa-deps"
|
||||
|
||||
Write-Host "Downloading DirectX 12 Agility SDK at:"
|
||||
Get-Date
|
||||
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/1.610.2 -OutFile 'agility.zip'
|
||||
Expand-Archive -Path 'agility.zip' -DestinationPath 'C:\agility'
|
||||
# Copy Agility SDK into mesa-deps\bin\D3D12
|
||||
New-Item -ErrorAction SilentlyContinue -ItemType Directory -Path $depsInstallPath\bin -Name 'D3D12'
|
||||
Copy-Item 'C:\agility\build\native\bin\x64\*.dll' -Destination $depsInstallPath\bin\D3D12
|
||||
Remove-Item 'agility.zip'
|
||||
Remove-Item -Recurse 'C:\agility'
|
||||
|
||||
Write-Host "Downloading Updated WARP at:"
|
||||
Get-Date
|
||||
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.7.1 -OutFile 'warp.zip'
|
||||
Expand-Archive -Path 'warp.zip' -DestinationPath 'C:\warp'
|
||||
# Copy WARP into mesa-deps\bin
|
||||
Copy-Item 'C:\warp\build\native\amd64\d3d10warp.dll' -Destination $depsInstallPath\bin
|
||||
Remove-Item 'warp.zip'
|
||||
Remove-Item -Recurse 'C:\warp'
|
||||
|
||||
Write-Host "Downloading DirectXShaderCompiler release at:"
|
||||
Get-Date
|
||||
Invoke-WebRequest -Uri https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.7.2207/dxc_2022_07_18.zip -OutFile 'DXC.zip'
|
||||
Expand-Archive -Path 'DXC.zip' -DestinationPath 'C:\DXC'
|
||||
# No more need to get dxil.dll from the VS install
|
||||
Copy-Item 'C:\DXC\bin\x64\*.dll' -Destination 'C:\Windows\System32'
|
||||
Remove-Item -Recurse 'DXC.zip'
|
||||
Remove-Item -Recurse 'C:\DXC'
|
||||
|
||||
Write-Host "Enabling developer mode at:"
|
||||
Get-Date
|
||||
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
|
||||
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
|
||||
if (-not(Test-Path -Path $RegistryKeyPath)) {
|
||||
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
|
||||
}
|
||||
|
||||
# Add registry value to enable Developer Mode
|
||||
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1 -Force
|
||||
|
||||
Write-Host "Complete download D3D at:"
|
||||
Get-Date
|
@@ -1,17 +0,0 @@
|
||||
# Installing rust compiler
|
||||
# Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG
|
||||
# This file needs run in administrator mode
|
||||
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
Write-Host "Installing rust at:"
|
||||
Get-Date
|
||||
$url = 'https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe';
|
||||
Write-Host ('Downloading {0} ...' -f $url);
|
||||
Invoke-WebRequest -Uri $url -OutFile 'rustup-init.exe';
|
||||
Write-Host "Installing rust toolchain"
|
||||
.\rustup-init.exe -y;
|
||||
Remove-Item rustup-init.exe;
|
||||
|
||||
Write-Host "Installing rust finished at:"
|
||||
Get-Date
|
@@ -1,29 +1,179 @@
|
||||
# Compiling tests deps
|
||||
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_init_msvc.ps1"
|
||||
|
||||
$spirv_samples_source = Join-Path -Path "$PWD" -ChildPath "spirv-samples"
|
||||
|
||||
Write-Host "Cloning spirv-samples at:"
|
||||
Get-Date
|
||||
New-Item -ItemType Directory -Path "$spirv_samples_source" | Out-Null
|
||||
Push-Location -Path $spirv_samples_source
|
||||
git init
|
||||
git remote add origin https://github.com/dneto0/spirv-samples.git
|
||||
git fetch --depth 1 origin 36372636df06a24c4e2de1551beee055db01b91d # of branch main
|
||||
Write-Host "Cloning Waffle"
|
||||
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
git clone --no-progress --single-branch --no-checkout https://gitlab.freedesktop.org/mesa/waffle.git 'C:\src\waffle'
|
||||
if (!$?) {
|
||||
Write-Host "Failed to fetch spirv-samples repository"
|
||||
Pop-Location
|
||||
Write-Host "Failed to clone Waffle repository"
|
||||
Exit 1
|
||||
}
|
||||
git checkout FETCH_HEAD
|
||||
|
||||
Push-Location -Path C:\src\waffle
|
||||
git checkout 950a1f35a718bc2a8e1dda75845e52651bb331a7
|
||||
Pop-Location
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path "$spirv_samples_source\.git" | Out-Null
|
||||
|
||||
Write-Host "Cloning spirv-samples finished at:"
|
||||
Get-Date
|
||||
$waffle_build = New-Item -ItemType Directory -Path "C:\src\waffle" -Name "build"
|
||||
Push-Location -Path $waffle_build.FullName
|
||||
Write-Host "Compiling Waffle"
|
||||
meson setup `
|
||||
--buildtype=release `
|
||||
--default-library=static `
|
||||
--prefix="C:\Waffle" && `
|
||||
ninja -j32 install
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
Remove-Item -Recurse -Path $waffle_build
|
||||
if (!$buildstatus) {
|
||||
Write-Host "Failed to compile or install Waffle"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Write-Host "Complete Dockerfile_test at:"
|
||||
Get-Date
|
||||
Write-Host "Downloading glext.h"
|
||||
New-Item -ItemType Directory -Path ".\glext" -Name "GL"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
Invoke-WebRequest -Uri 'https://www.khronos.org/registry/OpenGL/api/GL/glext.h' -OutFile '.\glext\GL\glext.h' | Out-Null
|
||||
|
||||
Get-Date
|
||||
Write-Host "Cloning Piglit"
|
||||
git clone --no-progress --single-branch --no-checkout https://gitlab.freedesktop.org/mesa/piglit.git 'C:\piglit'
|
||||
if (!$?) {
|
||||
Write-Host "Failed to clone Piglit repository"
|
||||
Exit 1
|
||||
}
|
||||
Push-Location -Path C:\piglit
|
||||
git checkout b41accc83689966f91217fc5b57dbe06202b8c8c
|
||||
|
||||
Get-Date
|
||||
Write-Host "Compiling Piglit"
|
||||
cmake -S . -B . `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DPIGLIT_USE_WAFFLE=ON `
|
||||
-DWaffle_INCLUDE_DIRS=C:\Waffle\include\waffle-1 `
|
||||
-DWaffle_LDFLAGS=C:\Waffle\lib\libwaffle-1.a `
|
||||
-DGLEXT_INCLUDE_DIR=.\glext && `
|
||||
ninja -j32
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
if (!$buildstatus) {
|
||||
Write-Host "Failed to compile Piglit"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Get-Date
|
||||
Write-Host "Cloning spirv-samples"
|
||||
git clone --no-progress --single-branch --no-checkout https://github.com/dneto0/spirv-samples.git C:\spirv-samples\
|
||||
Push-Location -Path C:\spirv-samples\
|
||||
git checkout 36372636df06a24c4e2de1551beee055db01b91d
|
||||
Pop-Location
|
||||
|
||||
Get-Date
|
||||
Write-Host "Cloning Vulkan and GL Conformance Tests"
|
||||
$deqp_source = "C:\src\VK-GL-CTS\"
|
||||
git clone --no-progress --single-branch https://github.com/KhronosGroup/VK-GL-CTS.git -b vulkan-cts-1.3.4 $deqp_source
|
||||
if (!$?) {
|
||||
Write-Host "Failed to clone deqp repository"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Push-Location -Path $deqp_source
|
||||
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
|
||||
# libpng (sigh). The archives get their checksums checked anyway, and git
|
||||
# always goes through ssh or https.
|
||||
py .\external\fetch_sources.py --insecure
|
||||
Pop-Location
|
||||
|
||||
Get-Date
|
||||
$deqp_build = New-Item -ItemType Directory -Path "C:\deqp"
|
||||
Push-Location -Path $deqp_build.FullName
|
||||
Write-Host "Compiling deqp"
|
||||
cmake -S $($deqp_source) `
|
||||
-B . `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DDEQP_TARGET=default && `
|
||||
ninja -j32
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
if (!$buildstatus) {
|
||||
Write-Host "Failed to compile deqp"
|
||||
Exit 1
|
||||
}
|
||||
|
||||
# Copy test result templates
|
||||
Copy-Item -Path "$($deqp_source)\doc\testlog-stylesheet\testlog.css" -Destination $deqp_build
|
||||
Copy-Item -Path "$($deqp_source)\doc\testlog-stylesheet\testlog.xsl" -Destination $deqp_build
|
||||
|
||||
# Copy Vulkan must-pass list
|
||||
$deqp_mustpass = New-Item -ItemType Directory -Path $deqp_build -Name "mustpass"
|
||||
$root_mustpass = Join-Path -Path $deqp_source -ChildPath "external\vulkancts\mustpass\main"
|
||||
$files = Get-Content "$($root_mustpass)\vk-default.txt"
|
||||
foreach($file in $files) {
|
||||
Get-Content "$($root_mustpass)\$($file)" | Add-Content -Path "$($deqp_mustpass)\vk-main.txt"
|
||||
}
|
||||
Remove-Item -Force -Recurse $deqp_source
|
||||
|
||||
Get-Date
|
||||
$url = 'https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe';
|
||||
Write-Host ('Downloading {0} ...' -f $url);
|
||||
Invoke-WebRequest -Uri $url -OutFile 'rustup-init.exe';
|
||||
Write-Host "Installing rust toolchain"
|
||||
C:\rustup-init.exe -y;
|
||||
Remove-Item C:\rustup-init.exe;
|
||||
|
||||
Get-Date
|
||||
Write-Host "Installing deqp-runner"
|
||||
$env:Path += ";$($env:USERPROFILE)\.cargo\bin"
|
||||
cargo install --git https://gitlab.freedesktop.org/anholt/deqp-runner.git
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading DirectX 12 Agility SDK"
|
||||
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/1.610.2 -OutFile 'agility.zip'
|
||||
Expand-Archive -Path 'agility.zip' -DestinationPath 'C:\agility'
|
||||
Remove-Item 'agility.zip'
|
||||
|
||||
$piglit_bin = 'C:\Piglit\bin'
|
||||
$vk_cts_bin = "$deqp_build\external\vulkancts\modules\vulkan"
|
||||
|
||||
# Copy Agility SDK into subfolder of piglit and Vulkan CTS
|
||||
$agility_dest = New-Item -ItemType Directory -Path $piglit_bin -Name 'D3D12'
|
||||
Copy-Item 'C:\agility\build\native\bin\x64\*.dll' -Destination $agility_dest
|
||||
$agility_dest = New-Item -ItemType Directory -Path $vk_cts_bin -Name 'D3D12'
|
||||
Copy-Item 'C:\agility\build\native\bin\x64\*.dll' -Destination $agility_dest
|
||||
Remove-Item -Recurse 'C:\agility'
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading Updated WARP"
|
||||
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.7.1 -OutFile 'warp.zip'
|
||||
Expand-Archive -Path 'warp.zip' -DestinationPath 'C:\warp'
|
||||
Remove-Item 'warp.zip'
|
||||
|
||||
# Copy WARP next to piglit and Vulkan CTS
|
||||
Copy-Item 'C:\warp\build\native\amd64\d3d10warp.dll' -Destination $piglit_bin
|
||||
Copy-Item 'C:\warp\build\native\amd64\d3d10warp.dll' -Destination $vk_cts_bin
|
||||
Remove-Item -Recurse 'C:\warp'
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading DirectXShaderCompiler release"
|
||||
Invoke-WebRequest -Uri https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.7.2207/dxc_2022_07_18.zip -OutFile 'DXC.zip'
|
||||
Expand-Archive -Path 'DXC.zip' -DestinationPath 'C:\DXC'
|
||||
# No more need to get dxil.dll from the VS install
|
||||
Copy-Item 'C:\DXC\bin\x64\*.dll' -Destination 'C:\Windows\System32'
|
||||
|
||||
Get-Date
|
||||
Write-Host "Enabling developer mode"
|
||||
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
|
||||
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
|
||||
if (-not(Test-Path -Path $RegistryKeyPath)) {
|
||||
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
|
||||
}
|
||||
|
||||
# Add registry value to enable Developer Mode
|
||||
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1 -Force
|
||||
|
||||
Get-Date
|
||||
Write-Host "Complete"
|
||||
|
@@ -1,88 +0,0 @@
|
||||
# Compiling deqp
|
||||
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_init_msvc.ps1"
|
||||
|
||||
$source_dir = Join-Path -Path "$PWD" -ChildPath "src"
|
||||
$deqp_source = Join-Path -Path "$source_dir" -ChildPath "VK-GL-CTS"
|
||||
$deqp_build = Join-Path -Path "$PWD" -ChildPath "deqp"
|
||||
|
||||
Write-Host "Cloning Vulkan and GL Conformance Tests at:"
|
||||
Get-Date
|
||||
New-Item -ItemType Directory -Path "$deqp_source" | Out-Null
|
||||
Push-Location -Path $deqp_source
|
||||
git init
|
||||
git remote add origin https://github.com/KhronosGroup/VK-GL-CTS.git
|
||||
git fetch --depth 1 origin 56114106d860c121cd6ff0c3b926ddc50c4c11fd # of branch vulkan-cts-1.3.4
|
||||
if (!$?) {
|
||||
Write-Host "Failed to fetch deqp repository"
|
||||
Pop-Location
|
||||
Exit 1
|
||||
}
|
||||
git checkout FETCH_HEAD
|
||||
|
||||
Write-Host "Fetch sources inside $deqp_source at:"
|
||||
Get-Date
|
||||
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
|
||||
# libpng (sigh). The archives get their checksums checked anyway, and git
|
||||
# always goes through ssh or https.
|
||||
py .\external\fetch_sources.py --insecure
|
||||
Pop-Location
|
||||
|
||||
Write-Host "Compiling deqp at:"
|
||||
Get-Date
|
||||
New-Item -ItemType Directory -Path "$deqp_build" | Out-Null
|
||||
Push-Location -Path $deqp_build
|
||||
cmake -S $($deqp_source) `
|
||||
-B . `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DDEQP_TARGET=default && `
|
||||
ninja -j32
|
||||
if (!$?) {
|
||||
Write-Host "Failed to compile deqp"
|
||||
Pop-Location
|
||||
Exit 1
|
||||
}
|
||||
Pop-Location
|
||||
|
||||
# Copy test result templates
|
||||
Copy-Item -Path "$($deqp_source)\doc\testlog-stylesheet\testlog.css" -Destination $deqp_build
|
||||
Copy-Item -Path "$($deqp_source)\doc\testlog-stylesheet\testlog.xsl" -Destination $deqp_build
|
||||
|
||||
# Copy Vulkan must-pass list
|
||||
$deqp_mustpass = New-Item -ItemType Directory -Path $deqp_build -Name "mustpass"
|
||||
$root_mustpass = Join-Path -Path $deqp_source -ChildPath "external\vulkancts\mustpass\main"
|
||||
$files = Get-Content "$($root_mustpass)\vk-default.txt"
|
||||
foreach($file in $files) {
|
||||
Get-Content "$($root_mustpass)\$($file)" | Add-Content -Path "$($deqp_mustpass)\vk-main.txt"
|
||||
}
|
||||
|
||||
Write-Host "Installing deqp-runner at:"
|
||||
Get-Date
|
||||
$env:Path += ";$($env:USERPROFILE)\.cargo\bin"
|
||||
cargo install --git https://gitlab.freedesktop.org/anholt/deqp-runner.git --tag v0.16.1
|
||||
|
||||
$depsInstallPath="C:\mesa-deps"
|
||||
$vk_cts_bin = "$deqp_build\external\vulkancts\modules\vulkan"
|
||||
|
||||
# Hard link Agility SDK into subfolder of Vulkan CTS
|
||||
$agility_dest = New-Item -ItemType Directory -Path $vk_cts_bin -Name 'D3D12'
|
||||
New-Item -ItemType HardLink -path $agility_dest\D3D12Core.dll -Value $depsInstallPath\bin\D3D12\D3D12Core.dll
|
||||
New-Item -ItemType HardLink -path $agility_dest\d3d12SDKLayers.dll -Value $depsInstallPath\bin\D3D12\d3d12SDKLayers.dll
|
||||
|
||||
# Hard link WARP next to Vulkan CTS
|
||||
New-Item -ItemType HardLink -path $vk_cts_bin\d3d10warp.dll -Value $depsInstallPath\bin\d3d10warp.dll
|
||||
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path "$source_dir" | Out-Null
|
||||
|
||||
# Cleanup deqp intermediate files
|
||||
Get-ChildItem -Force -ErrorAction SilentlyContinue -Recurse "$deqp_build" | Where-Object {
|
||||
if($_.FullName -match "CMake|.git|.lib"){
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $_.FullName | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Compiling deqp finished at:"
|
||||
Get-Date
|
@@ -1,103 +0,0 @@
|
||||
# Compiling Piglit
|
||||
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_init_msvc.ps1"
|
||||
|
||||
$source_dir = Join-Path -Path "$PWD" -ChildPath "src"
|
||||
$waffle_source = Join-Path -Path "$source_dir" -ChildPath "waffle"
|
||||
$waffle_install = Join-Path -Path "$PWD" -ChildPath "waffle"
|
||||
$piglit_source = Join-Path -Path "$PWD" -ChildPath "Piglit"
|
||||
|
||||
Write-Host "Cloning Waffle at:"
|
||||
Get-Date
|
||||
New-Item -ItemType Directory -Path "$waffle_source" | Out-Null
|
||||
Push-Location -Path $waffle_source
|
||||
git init
|
||||
git remote add origin https://gitlab.freedesktop.org/mesa/waffle.git
|
||||
git fetch --depth 1 origin 950a1f35a718bc2a8e1dda75845e52651bb331a7 # of branch master
|
||||
if (!$?) {
|
||||
Write-Host "Failed to fetch Waffle repository"
|
||||
Pop-Location
|
||||
Exit 1
|
||||
}
|
||||
git checkout FETCH_HEAD
|
||||
Pop-Location
|
||||
|
||||
Write-Host "Compiling Waffle at:"
|
||||
Get-Date
|
||||
$waffle_build = Join-Path -Path "$source_dir" -ChildPath "waffle\build"
|
||||
New-Item -ItemType Directory -Path "$waffle_build" | Out-Null
|
||||
Push-Location -Path $waffle_build
|
||||
meson setup `
|
||||
--buildtype=release `
|
||||
--default-library=static `
|
||||
--prefix="$waffle_install" && `
|
||||
ninja -j32 install
|
||||
if (!$?) {
|
||||
Write-Host "Failed to compile or install Waffle"
|
||||
Pop-Location
|
||||
Exit 1
|
||||
}
|
||||
Pop-Location
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path "$waffle_build" | Out-Null
|
||||
|
||||
Write-Host "Downloading glext.h at:"
|
||||
Get-Date
|
||||
New-Item -ItemType Directory -Path "$source_dir\glext\GL" | Out-Null
|
||||
Invoke-WebRequest -Uri 'https://github.com/KhronosGroup/OpenGL-Registry/raw/main/api/GL/glext.h' -OutFile "$source_dir\glext\GL\glext.h" | Out-Null
|
||||
|
||||
Write-Host "Cloning Piglit at:"
|
||||
Get-Date
|
||||
New-Item -ItemType Directory -Path "$piglit_source" | Out-Null
|
||||
Push-Location -Path $piglit_source
|
||||
git init
|
||||
git remote add origin https://gitlab.freedesktop.org/mesa/piglit.git
|
||||
git fetch --depth 1 origin b41accc83689966f91217fc5b57dbe06202b8c8c # of branch main
|
||||
if (!$?) {
|
||||
Write-Host "Failed to fetch Piglit repository"
|
||||
Pop-Location
|
||||
Exit 1
|
||||
}
|
||||
git checkout FETCH_HEAD
|
||||
|
||||
Write-Host "Compiling Piglit at:"
|
||||
Get-Date
|
||||
cmake -S . -B . `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DPIGLIT_USE_WAFFLE=ON `
|
||||
-DWaffle_INCLUDE_DIRS="$waffle_install\include\waffle-1" `
|
||||
-DWaffle_LDFLAGS="$waffle_install\lib\libwaffle-1.a" `
|
||||
-DGLEXT_INCLUDE_DIR="$source_dir\glext" && `
|
||||
ninja -j32
|
||||
if (!$?) {
|
||||
Write-Host "Failed to compile Piglit"
|
||||
Pop-Location
|
||||
Exit 1
|
||||
}
|
||||
Pop-Location
|
||||
|
||||
$depsInstallPath="C:\mesa-deps"
|
||||
$piglit_bin = "$piglit_source\bin"
|
||||
|
||||
# Hard link Agility SDK into subfolder of piglit
|
||||
$agility_dest = New-Item -ItemType Directory -Path $piglit_bin -Name 'D3D12'
|
||||
New-Item -ItemType HardLink -path $agility_dest\D3D12Core.dll -Value $depsInstallPath\bin\D3D12\D3D12Core.dll
|
||||
New-Item -ItemType HardLink -path $agility_dest\d3d12SDKLayers.dll -Value $depsInstallPath\bin\D3D12\d3d12SDKLayers.dll
|
||||
|
||||
# Hard link WARP next to piglit
|
||||
New-Item -ItemType HardLink -path $piglit_bin\d3d10warp.dll -Value $depsInstallPath\bin\d3d10warp.dll
|
||||
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path "$source_dir" | Out-Null
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path "$waffle_install" | Out-Null
|
||||
|
||||
# Cleanup piglit intermediate files
|
||||
Get-ChildItem -Force -ErrorAction SilentlyContinue -Recurse "$piglit_source" | Where-Object {
|
||||
if($_.FullName -match "CMake|.git|.lib"){
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $_.FullName | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Compiling Piglit finished at:"
|
||||
Get-Date
|
@@ -1,20 +1,20 @@
|
||||
# we want more secure TLS 1.2 for most things
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
|
||||
|
||||
# VS17.x is 2022
|
||||
$msvc_url = 'https://aka.ms/vs/17/release/vs_buildtools.exe'
|
||||
# VS16.x is 2019
|
||||
$msvc_2019_url = 'https://aka.ms/vs/16/release/vs_buildtools.exe'
|
||||
|
||||
Write-Host "Downloading Visual Studio 2022 build tools at:"
|
||||
Get-Date
|
||||
Invoke-WebRequest -Uri $msvc_url -OutFile C:\vs_buildtools.exe
|
||||
Write-Host "Downloading Visual Studio 2019 build tools"
|
||||
Invoke-WebRequest -Uri $msvc_2019_url -OutFile C:\vs_buildtools.exe
|
||||
|
||||
Write-Host "Installing Visual Studio 2022 at:"
|
||||
Get-Date
|
||||
Write-Host "Installing Visual Studio 2019"
|
||||
# Command line
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/command-line-parameter-examples?view=vs-2022
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/command-line-parameter-examples?view=vs-2019
|
||||
# Component ids
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2022
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019
|
||||
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2019
|
||||
Start-Process -NoNewWindow -Wait -FilePath C:\vs_buildtools.exe `
|
||||
-ArgumentList `
|
||||
"--wait", `
|
||||
@@ -22,14 +22,11 @@ Start-Process -NoNewWindow -Wait -FilePath C:\vs_buildtools.exe `
|
||||
"--norestart", `
|
||||
"--nocache", `
|
||||
"--installPath", "C:\BuildTools", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.ASAN", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.Redist.14.Latest", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.ASAN", ` # MSVC 2022
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.ATL", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.ATLMFC", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL", ` # MSVC 2019
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.14.29.16.11.MFC", `
|
||||
"--add", "Microsoft.VisualStudio.ComponentGroup.VC.Tools.142.x86.x64", `
|
||||
"--add", "Microsoft.VisualStudio.Component.VC.Llvm.Clang", `
|
||||
"--add", "Microsoft.VisualStudio.Component.Graphics.Tools", `
|
||||
"--add", "Microsoft.VisualStudio.Component.Windows10SDK.20348"
|
||||
@@ -39,8 +36,4 @@ if (!$?) {
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item C:\vs_buildtools.exe -Force
|
||||
|
||||
Write-Host "Installing Visual Studio 2022 finished at:"
|
||||
Get-Date
|
||||
|
||||
Exit 0
|
@@ -1,39 +0,0 @@
|
||||
# Downloading specified vulkan sdk and vulkan runtime
|
||||
# Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG
|
||||
# This file needs run in administrator mode
|
||||
|
||||
$env:VULKAN_SDK_VERSION="1.3.211.0"
|
||||
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
# Save environment VULKAN_SDK_VERSION to system
|
||||
[System.Environment]::SetEnvironmentVariable('VULKAN_SDK_VERSION', "$env:VULKAN_SDK_VERSION", [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
$VULKAN_SDK_URL="https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanSDK-$env:VULKAN_SDK_VERSION-Installer.exe"
|
||||
Write-Host "Downloading Vulkan-SDK $VULKAN_SDK_URL at:"
|
||||
Get-Date
|
||||
Invoke-WebRequest -Uri "$VULKAN_SDK_URL" -OutFile "${env:TMP}\vulkan_sdk.exe" | Out-Null
|
||||
Write-Host "Installing Vulkan-SDK at:"
|
||||
Get-Date
|
||||
Start-Process -NoNewWindow -Wait "${env:TMP}\vulkan_sdk.exe" -ArgumentList "--am --al -c in"
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install Vulkan SDK"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item "${env:TMP}\vulkan_sdk.exe" -Force
|
||||
|
||||
$VULKAN_RUNTIME_URL="https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanRT-$env:VULKAN_SDK_VERSION-Installer.exe"
|
||||
Write-Host "Downloading Vulkan-Runtime $VULKAN_RUNTIME_URL at:"
|
||||
Get-Date
|
||||
Invoke-WebRequest -Uri "$VULKAN_RUNTIME_URL" -OutFile "${env:TMP}\vulkan-runtime.exe" | Out-Null
|
||||
Write-Host "Installing Vulkan-Runtime at:"
|
||||
Get-Date
|
||||
Start-Process -NoNewWindow -Wait "${env:TMP}\vulkan-runtime.exe" -ArgumentList '/S'
|
||||
if (!$?) {
|
||||
Write-Host "Failed to install Vulkan-Runtime"
|
||||
Exit 1
|
||||
}
|
||||
Remove-Item "${env:TMP}\vulkan-runtime.exe" -Force
|
||||
|
||||
Write-Host "Installing Vulkan-Runtime finished at:"
|
||||
Get-Date
|
@@ -4,14 +4,8 @@ $vsInstallPath = if ("$vsInstallPath" -eq "" ) { "C:\BuildTools" } else { "$vsI
|
||||
Write-Output "Final installPath: $vsInstallPath"
|
||||
Import-Module (Join-Path $vsInstallPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
|
||||
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
|
||||
# VS2015 14.0 use -vcvars_ver=14.0
|
||||
# VS2017 14.1 to 14.16 use -vcvars_ver=14.16
|
||||
# VS2019 14.20 to 14.29 use -vcvars_ver=14.29
|
||||
# VS2022 14.30 to 14.38 (not finished yet) use -vcvars_ver=14 to choose the newest version
|
||||
|
||||
$vcvars_ver_arg=$args
|
||||
if ($null -eq $vcvars_ver_arg[0]) {
|
||||
$vcvars_ver_arg="-vcvars_ver=14.29"
|
||||
}
|
||||
|
||||
Enter-VsDevShell -VsInstallPath $vsInstallPath -SkipAutomaticLocation -DevCmdArguments "$vcvars_ver_arg -arch=x64 -no_logo -host_arch=amd64"
|
||||
# VS2015 14.0
|
||||
# VS2017 14.16
|
||||
# VS2019 14.29
|
||||
# VS2022 14.32
|
||||
Enter-VsDevShell -VsInstallPath $vsInstallPath -SkipAutomaticLocation -DevCmdArguments '-vcvars_ver=14.29 -arch=x64 -no_logo -host_arch=amd64'
|
21
.gitlab-ci/x86_64-w64-mingw32
Normal file
21
.gitlab-ci/x86_64-w64-mingw32
Normal file
@@ -0,0 +1,21 @@
|
||||
[binaries]
|
||||
c = ['ccache', 'x86_64-w64-mingw32-gcc-posix']
|
||||
cpp = ['ccache', 'x86_64-w64-mingw32-g++-posix']
|
||||
ar = 'x86_64-w64-mingw32-ar'
|
||||
strip = 'x86_64-w64-mingw32-strip'
|
||||
pkgconfig = '/usr/x86_64-w64-mingw32/bin/pkgconf'
|
||||
llvm-config = '/usr/x86_64-w64-mingw32/bin/llvm-config'
|
||||
windres = 'x86_64-w64-mingw32-windres'
|
||||
exe_wrapper = ['wine64']
|
||||
|
||||
[properties]
|
||||
needs_exe_wrapper = True
|
||||
sys_root = '/usr/x86_64-w64-mingw32/'
|
||||
|
||||
[host_machine]
|
||||
system = 'windows'
|
||||
cpu_family = 'x86_64'
|
||||
cpu = 'x86_64'
|
||||
endian = 'little'
|
||||
|
||||
; vim: ft=dosini
|
@@ -1,6 +1,4 @@
|
||||
### What does this MR do and why?
|
||||
<!-- Describe in detail what your merge request does and why. -->
|
||||
|
||||
```
|
||||
%{first_multiline_commit}
|
||||
```
|
||||
|
26260
.pick_status.json
26260
.pick_status.json
File diff suppressed because it is too large
Load Diff
@@ -62,11 +62,8 @@ MESON_GEN_PKGCONFIGS += libdrm_intel:$(LIBDRM_VERSION)
|
||||
endif
|
||||
|
||||
ifneq ($(filter radeonsi,$(BOARD_MESA3D_GALLIUM_DRIVERS)),)
|
||||
ifneq ($(MESON_GEN_LLVM_STUB),)
|
||||
MESON_GEN_LLVM_STUB := true
|
||||
LOCAL_CFLAGS += -DFORCE_BUILD_AMDGPU # instructs LLVM to declare LLVMInitializeAMDGPU* functions
|
||||
# The flag is required for the Android-x86 LLVM port that follows the AOSP LLVM porting rules
|
||||
# https://osdn.net/projects/android-x86/scm/git/external-llvm-project
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(filter radeonsi amd,$(BOARD_MESA3D_GALLIUM_DRIVERS) $(BOARD_MESA3D_VULKAN_DRIVERS)),)
|
||||
|
@@ -93,7 +93,6 @@ MESON_GEN_NINJA := \
|
||||
-Dcpp_rtti=false \
|
||||
-Dlmsensors=disabled \
|
||||
-Dandroid-libbacktrace=disabled \
|
||||
$(BOARD_MESA3D_MESON_ARGS) \
|
||||
|
||||
MESON_BUILD := PATH=/usr/bin:/bin:/sbin:$$PATH ninja -C $(MESON_OUT_DIR)/build
|
||||
|
||||
|
@@ -14,14 +14,14 @@ and show the job(s) logs.
|
||||
|
||||
import argparse
|
||||
import re
|
||||
from subprocess import check_output
|
||||
import sys
|
||||
import time
|
||||
from collections import defaultdict
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from functools import partial
|
||||
from itertools import chain
|
||||
from subprocess import check_output
|
||||
from typing import TYPE_CHECKING, Iterable, Literal, Optional
|
||||
from typing import Literal, Optional
|
||||
|
||||
import gitlab
|
||||
from colorama import Fore, Style
|
||||
@@ -33,9 +33,6 @@ from gitlab_common import (
|
||||
)
|
||||
from gitlab_gql import GitlabGQL, create_job_needs_dag, filter_dag, print_dag
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gitlab_gql import Dag
|
||||
|
||||
GITLAB_URL = "https://gitlab.freedesktop.org"
|
||||
|
||||
REFRESH_WAIT_LOG = 10
|
||||
@@ -90,7 +87,7 @@ def pretty_wait(sec: int) -> None:
|
||||
def monitor_pipeline(
|
||||
project,
|
||||
pipeline,
|
||||
target_jobs_regex: re.Pattern,
|
||||
target_job: str,
|
||||
dependencies,
|
||||
force_manual: bool,
|
||||
stress: int,
|
||||
@@ -101,12 +98,13 @@ def monitor_pipeline(
|
||||
stress_status_counter = defaultdict(lambda: defaultdict(int))
|
||||
target_id = None
|
||||
|
||||
target_jobs_regex = re.compile(target_job.strip())
|
||||
|
||||
while True:
|
||||
deps_failed = []
|
||||
to_cancel = []
|
||||
for job in pipeline.jobs.list(all=True, sort="desc"):
|
||||
# target jobs
|
||||
if target_jobs_regex.fullmatch(job.name):
|
||||
if target_jobs_regex.match(job.name):
|
||||
target_id = job.id
|
||||
|
||||
if stress and job.status in ["success", "failed"]:
|
||||
@@ -131,8 +129,6 @@ def monitor_pipeline(
|
||||
# run dependencies and cancel the rest
|
||||
if job.name in dependencies:
|
||||
enable_job(project, job, "dep", True)
|
||||
if job.status == "failed":
|
||||
deps_failed.append(job.name)
|
||||
else:
|
||||
to_cancel.append(job)
|
||||
|
||||
@@ -167,18 +163,6 @@ def monitor_pipeline(
|
||||
):
|
||||
return None, 1
|
||||
|
||||
if (
|
||||
{"skipped"}.intersection(target_statuses.values())
|
||||
and not {"running", "pending"}.intersection(target_statuses.values())
|
||||
):
|
||||
print(
|
||||
Fore.RED,
|
||||
"Target in skipped state, aborting. Failed dependencies:",
|
||||
deps_failed,
|
||||
Fore.RESET,
|
||||
)
|
||||
return None, 1
|
||||
|
||||
if {"success", "manual"}.issuperset(target_statuses.values()):
|
||||
return None, 0
|
||||
|
||||
@@ -298,11 +282,6 @@ def parse_args() -> None:
|
||||
"--pipeline-url",
|
||||
help="URL of the pipeline to use, instead of auto-detecting it.",
|
||||
)
|
||||
mutex_group1.add_argument(
|
||||
"--mr",
|
||||
type=int,
|
||||
help="ID of a merge request; the latest pipeline in that MR will be used.",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -316,39 +295,22 @@ def parse_args() -> None:
|
||||
return args
|
||||
|
||||
|
||||
def print_detected_jobs(
|
||||
target_dep_dag: "Dag", dependency_jobs: Iterable[str], target_jobs: Iterable[str]
|
||||
) -> None:
|
||||
def print_job_set(color: str, kind: str, job_set: Iterable[str]):
|
||||
print(
|
||||
color + f"Running {len(job_set)} {kind} jobs: ",
|
||||
"\n",
|
||||
", ".join(sorted(job_set)),
|
||||
Fore.RESET,
|
||||
"\n",
|
||||
)
|
||||
|
||||
print(Fore.YELLOW + "Detected target job and its dependencies:", "\n")
|
||||
print_dag(target_dep_dag)
|
||||
print_job_set(Fore.MAGENTA, "dependency", dependency_jobs)
|
||||
print_job_set(Fore.BLUE, "target", target_jobs)
|
||||
|
||||
|
||||
def find_dependencies(target_jobs_regex: re.Pattern, project_path: str, iid: int) -> set[str]:
|
||||
def find_dependencies(target_job: str, project_path: str, sha: str) -> set[str]:
|
||||
gql_instance = GitlabGQL()
|
||||
dag = create_job_needs_dag(
|
||||
gql_instance, {"projectPath": project_path.path_with_namespace, "iid": iid}
|
||||
dag, _ = create_job_needs_dag(
|
||||
gql_instance, {"projectPath": project_path.path_with_namespace, "sha": sha}
|
||||
)
|
||||
|
||||
target_dep_dag = filter_dag(dag, target_jobs_regex)
|
||||
target_dep_dag = filter_dag(dag, target_job)
|
||||
if not target_dep_dag:
|
||||
print(Fore.RED + "The job(s) were not found in the pipeline." + Fore.RESET)
|
||||
sys.exit(1)
|
||||
|
||||
dependency_jobs = set(chain.from_iterable(d["needs"] for d in target_dep_dag.values()))
|
||||
target_jobs = set(target_dep_dag.keys())
|
||||
print_detected_jobs(target_dep_dag, dependency_jobs, target_jobs)
|
||||
return target_jobs.union(dependency_jobs)
|
||||
print(Fore.YELLOW)
|
||||
print("Detected job dependencies:")
|
||||
print()
|
||||
print_dag(target_dep_dag)
|
||||
print(Fore.RESET)
|
||||
return set(chain.from_iterable(target_dep_dag.values()))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -377,28 +339,23 @@ if __name__ == "__main__":
|
||||
pipe = cur_project.pipelines.get(pipeline_id)
|
||||
REV = pipe.sha
|
||||
else:
|
||||
REV = check_output(['git', 'rev-parse', REV]).decode('ascii').strip()
|
||||
|
||||
mesa_project = gl.projects.get("mesa/mesa")
|
||||
projects = [mesa_project]
|
||||
if args.mr:
|
||||
REV = mesa_project.mergerequests.get(args.mr).sha
|
||||
else:
|
||||
REV = check_output(['git', 'rev-parse', REV]).decode('ascii').strip()
|
||||
projects.append(get_gitlab_project(gl, args.project))
|
||||
(pipe, cur_project) = wait_for_pipeline(projects, REV)
|
||||
user_project = get_gitlab_project(gl, args.project)
|
||||
(pipe, cur_project) = wait_for_pipeline([mesa_project, user_project], REV)
|
||||
|
||||
print(f"Revision: {REV}")
|
||||
print(f"Pipeline: {pipe.web_url}")
|
||||
|
||||
target_jobs_regex = re.compile(args.target.strip())
|
||||
|
||||
deps = set()
|
||||
if args.target:
|
||||
print("🞋 job: " + Fore.BLUE + args.target + Style.RESET_ALL)
|
||||
deps = find_dependencies(
|
||||
target_jobs_regex=target_jobs_regex, iid=pipe.iid, project_path=cur_project
|
||||
target_job=args.target, sha=REV, project_path=cur_project
|
||||
)
|
||||
target_job_id, ret = monitor_pipeline(
|
||||
cur_project, pipe, target_jobs_regex, deps, args.force_manual, args.stress
|
||||
cur_project, pipe, args.target, deps, args.force_manual, args.stress
|
||||
)
|
||||
|
||||
if target_job_id:
|
||||
|
@@ -1,334 +0,0 @@
|
||||
import argparse
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from structured_logger import StructuredLogger
|
||||
|
||||
|
||||
class CustomLogger:
|
||||
def __init__(self, log_file):
|
||||
self.log_file = log_file
|
||||
self.logger = StructuredLogger(file_name=self.log_file)
|
||||
|
||||
def get_last_dut_job(self):
|
||||
"""
|
||||
Gets the details of the most recent DUT job.
|
||||
|
||||
Returns:
|
||||
dict: Details of the most recent DUT job.
|
||||
|
||||
Raises:
|
||||
ValueError: If no DUT jobs are found in the logger's data.
|
||||
"""
|
||||
try:
|
||||
job = self.logger.data["dut_jobs"][-1]
|
||||
except KeyError:
|
||||
raise ValueError(
|
||||
"No DUT jobs found. Please create a job via create_dut_job call."
|
||||
)
|
||||
|
||||
return job
|
||||
|
||||
def update(self, **kwargs):
|
||||
"""
|
||||
Updates the log file with provided key-value pairs.
|
||||
|
||||
Args:
|
||||
**kwargs: Key-value pairs to be updated.
|
||||
|
||||
"""
|
||||
with self.logger.edit_context():
|
||||
for key, value in kwargs.items():
|
||||
self.logger.data[key] = value
|
||||
|
||||
def create_dut_job(self, **kwargs):
|
||||
"""
|
||||
Creates a new DUT job with provided key-value pairs.
|
||||
|
||||
Args:
|
||||
**kwargs: Key-value pairs for the new DUT job.
|
||||
|
||||
"""
|
||||
with self.logger.edit_context():
|
||||
if "dut_jobs" not in self.logger.data:
|
||||
self.logger.data["dut_jobs"] = []
|
||||
new_job = {
|
||||
"status": "",
|
||||
"submitter_start_time": datetime.now().isoformat(),
|
||||
"dut_submit_time": "",
|
||||
"dut_start_time": "",
|
||||
"dut_end_time": "",
|
||||
"dut_name": "",
|
||||
"dut_state": "pending",
|
||||
"dut_job_phases": [],
|
||||
**kwargs,
|
||||
}
|
||||
self.logger.data["dut_jobs"].append(new_job)
|
||||
|
||||
def update_dut_job(self, key, value):
|
||||
"""
|
||||
Updates the last DUT job with a key-value pair.
|
||||
|
||||
Args:
|
||||
key : The key to be updated.
|
||||
value: The value to be assigned.
|
||||
|
||||
"""
|
||||
with self.logger.edit_context():
|
||||
job = self.get_last_dut_job()
|
||||
job[key] = value
|
||||
|
||||
def update_status_fail(self, reason=""):
|
||||
"""
|
||||
Sets the status of the last DUT job to 'fail' and logs the failure reason.
|
||||
|
||||
Args:
|
||||
reason (str, optional): The reason for the failure. Defaults to "".
|
||||
|
||||
"""
|
||||
with self.logger.edit_context():
|
||||
job = self.get_last_dut_job()
|
||||
job["status"] = "fail"
|
||||
job["dut_job_fail_reason"] = reason
|
||||
|
||||
def create_job_phase(self, phase_name):
|
||||
"""
|
||||
Creates a new job phase for the last DUT job.
|
||||
|
||||
Args:
|
||||
phase_name : The name of the new job phase.
|
||||
|
||||
"""
|
||||
with self.logger.edit_context():
|
||||
job = self.get_last_dut_job()
|
||||
if job["dut_job_phases"] and job["dut_job_phases"][-1]["end_time"] == "":
|
||||
# If the last phase exists and its end time is empty, set the end time
|
||||
job["dut_job_phases"][-1]["end_time"] = datetime.now().isoformat()
|
||||
|
||||
# Create a new phase
|
||||
phase_data = {
|
||||
"name": phase_name,
|
||||
"start_time": datetime.now().isoformat(),
|
||||
"end_time": "",
|
||||
}
|
||||
job["dut_job_phases"].append(phase_data)
|
||||
|
||||
def check_dut_timings(self, job):
|
||||
"""
|
||||
Check the timing sequence of a job to ensure logical consistency.
|
||||
|
||||
The function verifies that the job's submission time is not earlier than its start time and that
|
||||
the job's end time is not earlier than its start time. If either of these conditions is found to be true,
|
||||
an error is logged for each instance of inconsistency.
|
||||
|
||||
Args:
|
||||
job (dict): A dictionary containing timing information of a job. Expected keys are 'dut_start_time',
|
||||
'dut_submit_time', and 'dut_end_time'.
|
||||
|
||||
Returns:
|
||||
None: This function does not return a value; it logs errors if timing inconsistencies are detected.
|
||||
|
||||
The function checks the following:
|
||||
- If 'dut_start_time' and 'dut_submit_time' are both present and correctly sequenced.
|
||||
- If 'dut_start_time' and 'dut_end_time' are both present and correctly sequenced.
|
||||
"""
|
||||
|
||||
# Check if the start time and submit time exist
|
||||
if job.get("dut_start_time") and job.get("dut_submit_time"):
|
||||
# If they exist, check if the submission time is before the start time
|
||||
if job["dut_start_time"] < job["dut_submit_time"]:
|
||||
logging.error("Job submission is happening before job start.")
|
||||
|
||||
# Check if the start time and end time exist
|
||||
if job.get("dut_start_time") and job.get("dut_end_time"):
|
||||
# If they exist, check if the end time is after the start time
|
||||
if job["dut_end_time"] < job["dut_start_time"]:
|
||||
logging.error("Job ended before it started.")
|
||||
|
||||
# Method to update DUT start, submit and end time
|
||||
def update_dut_time(self, value, custom_time):
|
||||
"""
|
||||
Updates DUT start, submit, and end times.
|
||||
|
||||
Args:
|
||||
value : Specifies which DUT time to update. Options: 'start', 'submit', 'end'.
|
||||
custom_time : Custom time to set. If None, use current time.
|
||||
|
||||
Raises:
|
||||
ValueError: If an invalid argument is provided for value.
|
||||
|
||||
"""
|
||||
with self.logger.edit_context():
|
||||
job = self.get_last_dut_job()
|
||||
timestamp = custom_time if custom_time else datetime.now().isoformat()
|
||||
if value == "start":
|
||||
job["dut_start_time"] = timestamp
|
||||
job["dut_state"] = "running"
|
||||
elif value == "submit":
|
||||
job["dut_submit_time"] = timestamp
|
||||
job["dut_state"] = "submitted"
|
||||
elif value == "end":
|
||||
job["dut_end_time"] = timestamp
|
||||
job["dut_state"] = "finished"
|
||||
else:
|
||||
raise ValueError(
|
||||
"Error: Invalid argument provided for --update-dut-time. Use 'start', 'submit', 'end'."
|
||||
)
|
||||
# check the sanity of the partial structured log
|
||||
self.check_dut_timings(job)
|
||||
|
||||
def close_dut_job(self):
|
||||
"""
|
||||
Closes the most recent DUT (Device Under Test) job in the logger's data.
|
||||
|
||||
The method performs the following operations:
|
||||
1. Validates if there are any DUT jobs in the logger's data.
|
||||
2. If the last phase of the most recent DUT job has an empty end time, it sets the end time to the current time.
|
||||
|
||||
Raises:
|
||||
ValueError: If no DUT jobs are found in the logger's data.
|
||||
"""
|
||||
with self.logger.edit_context():
|
||||
job = self.get_last_dut_job()
|
||||
# Check if the last phase exists and its end time is empty, then set the end time
|
||||
if job["dut_job_phases"] and job["dut_job_phases"][-1]["end_time"] == "":
|
||||
job["dut_job_phases"][-1]["end_time"] = datetime.now().isoformat()
|
||||
|
||||
def close(self):
|
||||
"""
|
||||
Closes the most recent DUT (Device Under Test) job in the logger's data.
|
||||
|
||||
The method performs the following operations:
|
||||
1. Determines the combined status of all DUT jobs.
|
||||
2. Sets the submitter's end time to the current time.
|
||||
3. Updates the DUT attempt counter to reflect the total number of DUT jobs.
|
||||
|
||||
"""
|
||||
with self.logger.edit_context():
|
||||
job_status = []
|
||||
for job in self.logger.data["dut_jobs"]:
|
||||
if "status" in job:
|
||||
job_status.append(job["status"])
|
||||
|
||||
if not job_status:
|
||||
job_combined_status = "null"
|
||||
else:
|
||||
# Get job_combined_status
|
||||
if "pass" in job_status:
|
||||
job_combined_status = "pass"
|
||||
else:
|
||||
job_combined_status = "fail"
|
||||
|
||||
self.logger.data["job_combined_status"] = job_combined_status
|
||||
self.logger.data["dut_attempt_counter"] = len(self.logger.data["dut_jobs"])
|
||||
job["submitter_end_time"] = datetime.now().isoformat()
|
||||
|
||||
|
||||
def process_args(args):
|
||||
# Function to process key-value pairs and call corresponding logger methods
|
||||
def process_key_value_pairs(args_list, action_func):
|
||||
if not args_list:
|
||||
raise ValueError(
|
||||
f"No key-value pairs provided for {action_func.__name__.replace('_', '-')}"
|
||||
)
|
||||
if len(args_list) % 2 != 0:
|
||||
raise ValueError(
|
||||
f"Incomplete key-value pairs for {action_func.__name__.replace('_', '-')}"
|
||||
)
|
||||
kwargs = dict(zip(args_list[::2], args_list[1::2]))
|
||||
action_func(**kwargs)
|
||||
|
||||
# Create a CustomLogger object with the specified log file path
|
||||
custom_logger = CustomLogger(Path(args.log_file))
|
||||
|
||||
if args.update:
|
||||
process_key_value_pairs(args.update, custom_logger.update)
|
||||
|
||||
if args.create_dut_job:
|
||||
process_key_value_pairs(args.create_dut_job, custom_logger.create_dut_job)
|
||||
|
||||
if args.update_dut_job:
|
||||
key, value = args.update_dut_job
|
||||
custom_logger.update_dut_job(key, value)
|
||||
|
||||
if args.create_job_phase:
|
||||
custom_logger.create_job_phase(args.create_job_phase)
|
||||
|
||||
if args.update_status_fail:
|
||||
custom_logger.update_status_fail(args.update_status_fail)
|
||||
|
||||
if args.update_dut_time:
|
||||
if len(args.update_dut_time) == 2:
|
||||
action, custom_time = args.update_dut_time
|
||||
elif len(args.update_dut_time) == 1:
|
||||
action, custom_time = args.update_dut_time[0], None
|
||||
else:
|
||||
raise ValueError("Invalid number of values for --update-dut-time")
|
||||
|
||||
if action in ["start", "end", "submit"]:
|
||||
custom_logger.update_dut_time(action, custom_time)
|
||||
else:
|
||||
raise ValueError(
|
||||
"Error: Invalid argument provided for --update-dut-time. Use 'start', 'submit', 'end'."
|
||||
)
|
||||
|
||||
if args.close_dut_job:
|
||||
custom_logger.close_dut_job()
|
||||
|
||||
if args.close:
|
||||
custom_logger.close()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Custom Logger Command Line Tool")
|
||||
parser.add_argument("log_file", help="Path to the log file")
|
||||
parser.add_argument(
|
||||
"--update",
|
||||
nargs=argparse.ZERO_OR_MORE,
|
||||
metavar=("key", "value"),
|
||||
help="Update a key-value pair e.g., --update key1 value1 key2 value2)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--create-dut-job",
|
||||
nargs=argparse.ZERO_OR_MORE,
|
||||
metavar=("key", "value"),
|
||||
help="Create a new DUT job with key-value pairs (e.g., --create-dut-job key1 value1 key2 value2)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--update-dut-job",
|
||||
nargs=argparse.ZERO_OR_MORE,
|
||||
metavar=("key", "value"),
|
||||
help="Update a key-value pair in DUT job",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--create-job-phase",
|
||||
help="Create a new job phase (e.g., --create-job-phase name)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--update-status-fail",
|
||||
help="Update fail as the status and log the failure reason (e.g., --update-status-fail reason)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--update-dut-time",
|
||||
nargs=argparse.ZERO_OR_MORE,
|
||||
metavar=("action", "custom_time"),
|
||||
help="Update DUT start and end time. Provide action ('start', 'submit', 'end') and custom_time (e.g., '2023-01-01T12:00:00')",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--close-dut-job",
|
||||
action="store_true",
|
||||
help="Close the dut job by updating end time of last dut job)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--close",
|
||||
action="store_true",
|
||||
help="Updates combined status, submitter's end time and DUT attempt counter",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
process_args(args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@@ -1,46 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
# For the dependencies, see the requirements.txt
|
||||
|
||||
import logging
|
||||
import re
|
||||
import traceback
|
||||
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace
|
||||
from collections import OrderedDict
|
||||
from collections import defaultdict
|
||||
from copy import deepcopy
|
||||
from dataclasses import dataclass, field
|
||||
from itertools import accumulate
|
||||
from os import getenv
|
||||
from pathlib import Path
|
||||
from subprocess import check_output
|
||||
from textwrap import dedent
|
||||
from typing import Any, Iterable, Optional, Pattern, TypedDict, Union
|
||||
from typing import Any, Iterable, Optional, Pattern, Union
|
||||
|
||||
import yaml
|
||||
from filecache import DAY, filecache
|
||||
from gql import Client, gql
|
||||
from gql.transport.requests import RequestsHTTPTransport
|
||||
from gql.transport.aiohttp import AIOHTTPTransport
|
||||
from graphql import DocumentNode
|
||||
|
||||
|
||||
class DagNode(TypedDict):
|
||||
needs: set[str]
|
||||
stage: str
|
||||
# `name` is redundant but is here for retro-compatibility
|
||||
name: str
|
||||
|
||||
|
||||
# see create_job_needs_dag function for more details
|
||||
Dag = dict[str, DagNode]
|
||||
|
||||
|
||||
StageSeq = OrderedDict[str, set[str]]
|
||||
Dag = dict[str, set[str]]
|
||||
TOKEN_DIR = Path(getenv("XDG_CONFIG_HOME") or Path.home() / ".config")
|
||||
|
||||
|
||||
def get_token_from_default_dir() -> str:
|
||||
token_file = TOKEN_DIR / "gitlab-token"
|
||||
try:
|
||||
return str(token_file.resolve())
|
||||
token_file = TOKEN_DIR / "gitlab-token"
|
||||
return token_file.resolve()
|
||||
except FileNotFoundError as ex:
|
||||
print(
|
||||
f"Could not find {token_file}, please provide a token file as an argument"
|
||||
@@ -63,64 +46,29 @@ class GitlabGQL:
|
||||
url: str = "https://gitlab.freedesktop.org/api/graphql"
|
||||
token: Optional[str] = None
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
def __post_init__(self):
|
||||
self._setup_gitlab_gql_client()
|
||||
|
||||
def _setup_gitlab_gql_client(self) -> None:
|
||||
def _setup_gitlab_gql_client(self) -> Client:
|
||||
# Select your transport with a defined url endpoint
|
||||
headers = {}
|
||||
if self.token:
|
||||
headers["Authorization"] = f"Bearer {self.token}"
|
||||
self._transport = RequestsHTTPTransport(url=self.url, headers=headers)
|
||||
self._transport = AIOHTTPTransport(
|
||||
url=self.url, headers=headers, client_session_args = { "trust_env": True })
|
||||
|
||||
# Create a GraphQL client using the defined transport
|
||||
self.client = Client(transport=self._transport, fetch_schema_from_transport=True)
|
||||
self.client = Client(
|
||||
transport=self._transport, fetch_schema_from_transport=True
|
||||
)
|
||||
|
||||
@filecache(DAY)
|
||||
def query(
|
||||
self,
|
||||
gql_file: Union[Path, str],
|
||||
params: dict[str, Any] = {},
|
||||
operation_name: Optional[str] = None,
|
||||
paginated_key_loc: Iterable[str] = [],
|
||||
disable_cache: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
def run_uncached() -> dict[str, Any]:
|
||||
if paginated_key_loc:
|
||||
return self._sweep_pages(gql_file, params, operation_name, paginated_key_loc)
|
||||
return self._query(gql_file, params, operation_name)
|
||||
|
||||
if disable_cache:
|
||||
return run_uncached()
|
||||
|
||||
try:
|
||||
# Create an auxiliary variable to deliver a cached result and enable catching exceptions
|
||||
# Decorate the query to be cached
|
||||
if paginated_key_loc:
|
||||
result = self._sweep_pages_cached(
|
||||
gql_file, params, operation_name, paginated_key_loc
|
||||
)
|
||||
else:
|
||||
result = self._query_cached(gql_file, params, operation_name)
|
||||
return result # type: ignore
|
||||
except Exception as ex:
|
||||
logging.error(f"Cached query failed with {ex}")
|
||||
# print exception traceback
|
||||
traceback_str = "".join(traceback.format_exception(ex))
|
||||
logging.error(traceback_str)
|
||||
self.invalidate_query_cache()
|
||||
logging.error("Cache invalidated, retrying without cache")
|
||||
finally:
|
||||
return run_uncached()
|
||||
|
||||
def _query(
|
||||
self,
|
||||
gql_file: Union[Path, str],
|
||||
params: dict[str, Any] = {},
|
||||
operation_name: Optional[str] = None,
|
||||
self, gql_file: Union[Path, str], params: dict[str, Any]
|
||||
) -> dict[str, Any]:
|
||||
# Provide a GraphQL query
|
||||
source_path: Path = Path(__file__).parent
|
||||
pipeline_query_file: Path = source_path / gql_file
|
||||
source_path = Path(__file__).parent
|
||||
pipeline_query_file = source_path / gql_file
|
||||
|
||||
query: DocumentNode
|
||||
with open(pipeline_query_file, "r") as f:
|
||||
@@ -128,232 +76,62 @@ class GitlabGQL:
|
||||
query = gql(pipeline_query)
|
||||
|
||||
# Execute the query on the transport
|
||||
return self.client.execute_sync(
|
||||
query, variable_values=params, operation_name=operation_name
|
||||
)
|
||||
return self.client.execute(query, variable_values=params)
|
||||
|
||||
@filecache(DAY)
|
||||
def _sweep_pages_cached(self, *args, **kwargs):
|
||||
return self._sweep_pages(*args, **kwargs)
|
||||
|
||||
@filecache(DAY)
|
||||
def _query_cached(self, *args, **kwargs):
|
||||
return self._query(*args, **kwargs)
|
||||
|
||||
def _sweep_pages(
|
||||
self, query, params, operation_name=None, paginated_key_loc: Iterable[str] = []
|
||||
) -> dict[str, Any]:
|
||||
"""
|
||||
Retrieve paginated data from a GraphQL API and concatenate the results into a single
|
||||
response.
|
||||
|
||||
Args:
|
||||
query: represents a filepath with the GraphQL query to be executed.
|
||||
params: a dictionary that contains the parameters to be passed to the query. These
|
||||
parameters can be used to filter or modify the results of the query.
|
||||
operation_name: The `operation_name` parameter is an optional parameter that specifies
|
||||
the name of the GraphQL operation to be executed. It is used when making a GraphQL
|
||||
query to specify which operation to execute if there are multiple operations defined
|
||||
in the GraphQL schema. If not provided, the default operation will be executed.
|
||||
paginated_key_loc (Iterable[str]): The `paginated_key_loc` parameter is an iterable of
|
||||
strings that represents the location of the paginated field within the response. It
|
||||
is used to extract the paginated field from the response and append it to the final
|
||||
result. The node has to be a list of objects with a `pageInfo` field that contains
|
||||
at least the `hasNextPage` and `endCursor` fields.
|
||||
|
||||
Returns:
|
||||
a dictionary containing the response from the query with the paginated field
|
||||
concatenated.
|
||||
"""
|
||||
|
||||
def fetch_page(cursor: str | None = None) -> dict[str, Any]:
|
||||
if cursor:
|
||||
params["cursor"] = cursor
|
||||
logging.info(
|
||||
f"Found more than 100 elements, paginating. "
|
||||
f"Current cursor at {cursor}"
|
||||
)
|
||||
|
||||
return self._query(query, params, operation_name)
|
||||
|
||||
# Execute the initial query
|
||||
response: dict[str, Any] = fetch_page()
|
||||
|
||||
# Initialize an empty list to store the final result
|
||||
final_partial_field: list[dict[str, Any]] = []
|
||||
|
||||
# Loop until all pages have been retrieved
|
||||
while True:
|
||||
# Get the partial field to be appended to the final result
|
||||
partial_field = response
|
||||
for key in paginated_key_loc:
|
||||
partial_field = partial_field[key]
|
||||
|
||||
# Append the partial field to the final result
|
||||
final_partial_field += partial_field["nodes"]
|
||||
|
||||
# Check if there are more pages to retrieve
|
||||
page_info = partial_field["pageInfo"]
|
||||
if not page_info["hasNextPage"]:
|
||||
break
|
||||
|
||||
# Execute the query with the updated cursor parameter
|
||||
response = fetch_page(page_info["endCursor"])
|
||||
|
||||
# Replace the "nodes" field in the original response with the final result
|
||||
partial_field["nodes"] = final_partial_field
|
||||
return response
|
||||
|
||||
def invalidate_query_cache(self) -> None:
|
||||
logging.warning("Invalidating query cache")
|
||||
try:
|
||||
self._sweep_pages._db.clear()
|
||||
self._query._db.clear()
|
||||
except AttributeError as ex:
|
||||
logging.warning(f"Could not invalidate cache, maybe it was not used in {ex.args}?")
|
||||
def invalidate_query_cache(self):
|
||||
self.query._db.clear()
|
||||
|
||||
|
||||
def insert_early_stage_jobs(stage_sequence: StageSeq, jobs_metadata: Dag) -> Dag:
|
||||
pre_processed_dag: dict[str, set[str]] = {}
|
||||
jobs_from_early_stages = list(accumulate(stage_sequence.values(), set.union))
|
||||
for job_name, metadata in jobs_metadata.items():
|
||||
final_needs: set[str] = deepcopy(metadata["needs"])
|
||||
# Pre-process jobs that are not based on needs field
|
||||
# e.g. sanity job in mesa MR pipelines
|
||||
if not final_needs:
|
||||
job_stage: str = jobs_metadata[job_name]["stage"]
|
||||
stage_index: int = list(stage_sequence.keys()).index(job_stage)
|
||||
if stage_index > 0:
|
||||
final_needs |= jobs_from_early_stages[stage_index - 1]
|
||||
pre_processed_dag[job_name] = final_needs
|
||||
def create_job_needs_dag(
|
||||
gl_gql: GitlabGQL, params
|
||||
) -> tuple[Dag, dict[str, dict[str, Any]]]:
|
||||
|
||||
for job_name, needs in pre_processed_dag.items():
|
||||
jobs_metadata[job_name]["needs"] = needs
|
||||
result = gl_gql.query("pipeline_details.gql", params)
|
||||
incomplete_dag = defaultdict(set)
|
||||
jobs = {}
|
||||
pipeline = result["project"]["pipeline"]
|
||||
if not pipeline:
|
||||
raise RuntimeError(f"Could not find any pipelines for {params}")
|
||||
|
||||
return jobs_metadata
|
||||
for stage in pipeline["stages"]["nodes"]:
|
||||
for stage_job in stage["groups"]["nodes"]:
|
||||
for job in stage_job["jobs"]["nodes"]:
|
||||
needs = job.pop("needs")["nodes"]
|
||||
jobs[job["name"]] = job
|
||||
incomplete_dag[job["name"]] = {node["name"] for node in needs}
|
||||
# ensure that all needed nodes its in the graph
|
||||
[incomplete_dag[node["name"]] for node in needs]
|
||||
|
||||
|
||||
def traverse_dag_needs(jobs_metadata: Dag) -> None:
|
||||
created_jobs = set(jobs_metadata.keys())
|
||||
for job, metadata in jobs_metadata.items():
|
||||
final_needs: set = deepcopy(metadata["needs"]) & created_jobs
|
||||
# Post process jobs that are based on needs field
|
||||
final_dag: Dag = {}
|
||||
for job, needs in incomplete_dag.items():
|
||||
final_needs: set = deepcopy(needs)
|
||||
partial = True
|
||||
|
||||
while partial:
|
||||
next_depth: set[str] = {n for dn in final_needs for n in jobs_metadata[dn]["needs"]}
|
||||
partial: bool = not final_needs.issuperset(next_depth)
|
||||
next_depth = {n for dn in final_needs for n in incomplete_dag[dn]}
|
||||
partial = not final_needs.issuperset(next_depth)
|
||||
final_needs = final_needs.union(next_depth)
|
||||
|
||||
jobs_metadata[job]["needs"] = final_needs
|
||||
final_dag[job] = final_needs
|
||||
|
||||
|
||||
def extract_stages_and_job_needs(
|
||||
pipeline_jobs: dict[str, Any], pipeline_stages: dict[str, Any]
|
||||
) -> tuple[StageSeq, Dag]:
|
||||
jobs_metadata = Dag()
|
||||
# Record the stage sequence to post process deps that are not based on needs
|
||||
# field, for example: sanity job
|
||||
stage_sequence: OrderedDict[str, set[str]] = OrderedDict()
|
||||
for stage in pipeline_stages["nodes"]:
|
||||
stage_sequence[stage["name"]] = set()
|
||||
|
||||
for job in pipeline_jobs["nodes"]:
|
||||
stage_sequence[job["stage"]["name"]].add(job["name"])
|
||||
dag_job: DagNode = {
|
||||
"name": job["name"],
|
||||
"stage": job["stage"]["name"],
|
||||
"needs": set([j["node"]["name"] for j in job["needs"]["edges"]]),
|
||||
}
|
||||
jobs_metadata[job["name"]] = dag_job
|
||||
|
||||
return stage_sequence, jobs_metadata
|
||||
|
||||
|
||||
def create_job_needs_dag(gl_gql: GitlabGQL, params, disable_cache: bool = True) -> Dag:
|
||||
"""
|
||||
This function creates a Directed Acyclic Graph (DAG) to represent a sequence of jobs, where each
|
||||
job has a set of jobs that it depends on (its "needs") and belongs to a certain "stage".
|
||||
The "name" of the job is used as the key in the dictionary.
|
||||
|
||||
For example, consider the following DAG:
|
||||
|
||||
1. build stage: job1 -> job2 -> job3
|
||||
2. test stage: job2 -> job4
|
||||
|
||||
- The job needs for job3 are: job1, job2
|
||||
- The job needs for job4 are: job2
|
||||
- The job2 needs to wait all jobs from build stage to finish.
|
||||
|
||||
The resulting DAG would look like this:
|
||||
|
||||
dag = {
|
||||
"job1": {"needs": set(), "stage": "build", "name": "job1"},
|
||||
"job2": {"needs": {"job1", "job2", job3"}, "stage": "test", "name": "job2"},
|
||||
"job3": {"needs": {"job1", "job2"}, "stage": "build", "name": "job3"},
|
||||
"job4": {"needs": {"job2"}, "stage": "test", "name": "job4"},
|
||||
}
|
||||
|
||||
To access the job needs, one can do:
|
||||
|
||||
dag["job3"]["needs"]
|
||||
|
||||
This will return the set of jobs that job3 needs: {"job1", "job2"}
|
||||
|
||||
Args:
|
||||
gl_gql (GitlabGQL): The `gl_gql` parameter is an instance of the `GitlabGQL` class, which is
|
||||
used to make GraphQL queries to the GitLab API.
|
||||
params (dict): The `params` parameter is a dictionary that contains the necessary parameters
|
||||
for the GraphQL query. It is used to specify the details of the pipeline for which the
|
||||
job needs DAG is being created.
|
||||
The specific keys and values in the `params` dictionary will depend on
|
||||
the requirements of the GraphQL query being executed
|
||||
disable_cache (bool): The `disable_cache` parameter is a boolean that specifies whether the
|
||||
|
||||
Returns:
|
||||
The final DAG (Directed Acyclic Graph) representing the job dependencies sourced from needs
|
||||
or stages rule.
|
||||
"""
|
||||
stages_jobs_gql = gl_gql.query(
|
||||
"pipeline_details.gql",
|
||||
params=params,
|
||||
paginated_key_loc=["project", "pipeline", "jobs"],
|
||||
disable_cache=disable_cache,
|
||||
)
|
||||
pipeline_data = stages_jobs_gql["project"]["pipeline"]
|
||||
if not pipeline_data:
|
||||
raise RuntimeError(f"Could not find any pipelines for {params}")
|
||||
|
||||
stage_sequence, jobs_metadata = extract_stages_and_job_needs(
|
||||
pipeline_data["jobs"], pipeline_data["stages"]
|
||||
)
|
||||
# Fill the DAG with the job needs from stages that don't have any needs but still need to wait
|
||||
# for previous stages
|
||||
final_dag = insert_early_stage_jobs(stage_sequence, jobs_metadata)
|
||||
# Now that each job has its direct needs filled correctly, update the "needs" field for each job
|
||||
# in the DAG by performing a topological traversal
|
||||
traverse_dag_needs(final_dag)
|
||||
|
||||
return final_dag
|
||||
return final_dag, jobs
|
||||
|
||||
|
||||
def filter_dag(dag: Dag, regex: Pattern) -> Dag:
|
||||
jobs_with_regex: set[str] = {job for job in dag if regex.fullmatch(job)}
|
||||
return Dag({job: data for job, data in dag.items() if job in sorted(jobs_with_regex)})
|
||||
return {job: needs for job, needs in dag.items() if re.match(regex, job)}
|
||||
|
||||
|
||||
def print_dag(dag: Dag) -> None:
|
||||
for job, data in dag.items():
|
||||
for job, needs in dag.items():
|
||||
print(f"{job}:")
|
||||
print(f"\t{' '.join(data['needs'])}")
|
||||
print(f"\t{' '.join(needs)}")
|
||||
print()
|
||||
|
||||
|
||||
def fetch_merged_yaml(gl_gql: GitlabGQL, params) -> dict[str, Any]:
|
||||
params["content"] = dedent("""\
|
||||
include:
|
||||
- local: .gitlab-ci.yml
|
||||
""")
|
||||
def fetch_merged_yaml(gl_gql: GitlabGQL, params) -> dict[Any]:
|
||||
gitlab_yml_file = get_project_root_dir() / ".gitlab-ci.yml"
|
||||
content = Path(gitlab_yml_file).read_text().strip()
|
||||
params["content"] = content
|
||||
raw_response = gl_gql.query("job_details.gql", params)
|
||||
if merged_yaml := raw_response["ciConfig"]["mergedYaml"]:
|
||||
return yaml.safe_load(merged_yaml)
|
||||
@@ -374,7 +152,7 @@ def recursive_fill(job, relationship_field, target_data, acc_data: dict, merged_
|
||||
|
||||
for relative in relatives:
|
||||
parent_job = merged_yaml[relative]
|
||||
acc_data = recursive_fill(parent_job, acc_data, merged_yaml) # type: ignore
|
||||
acc_data = recursive_fill(parent_job, acc_data, merged_yaml)
|
||||
|
||||
acc_data |= job.get(target_data, {})
|
||||
|
||||
@@ -440,7 +218,7 @@ def recurse_among_variables_space(var_graph) -> bool:
|
||||
return updated
|
||||
|
||||
|
||||
def print_job_final_definition(job_name, merged_yaml, project_path, sha):
|
||||
def get_job_final_definition(job_name, merged_yaml, project_path, sha):
|
||||
job = merged_yaml[job_name]
|
||||
variables = get_variables(job, merged_yaml, project_path, sha)
|
||||
|
||||
@@ -463,43 +241,29 @@ def print_job_final_definition(job_name, merged_yaml, project_path, sha):
|
||||
print(image)
|
||||
|
||||
|
||||
def from_sha_to_pipeline_iid(gl_gql: GitlabGQL, params) -> str:
|
||||
result = gl_gql.query("pipeline_utils.gql", params)
|
||||
|
||||
return result["project"]["pipelines"]["nodes"][0]["iid"]
|
||||
|
||||
|
||||
def parse_args() -> Namespace:
|
||||
parser = ArgumentParser(
|
||||
formatter_class=ArgumentDefaultsHelpFormatter,
|
||||
description="CLI and library with utility functions to debug jobs via Gitlab GraphQL",
|
||||
epilog=f"""Example:
|
||||
{Path(__file__).name} --print-dag""",
|
||||
{Path(__file__).name} --rev $(git rev-parse HEAD) --print-job-dag""",
|
||||
)
|
||||
parser.add_argument("-pp", "--project-path", type=str, default="mesa/mesa")
|
||||
parser.add_argument("--sha", "--rev", type=str, default='HEAD')
|
||||
parser.add_argument("--sha", "--rev", type=str, required=True)
|
||||
parser.add_argument(
|
||||
"--regex",
|
||||
type=str,
|
||||
required=False,
|
||||
help="Regex pattern for the job name to be considered",
|
||||
)
|
||||
mutex_group_print = parser.add_mutually_exclusive_group()
|
||||
mutex_group_print.add_argument(
|
||||
"--print-dag",
|
||||
action="store_true",
|
||||
help="Print job needs DAG",
|
||||
)
|
||||
mutex_group_print.add_argument(
|
||||
parser.add_argument("--print-dag", action="store_true", help="Print job needs DAG")
|
||||
parser.add_argument(
|
||||
"--print-merged-yaml",
|
||||
action="store_true",
|
||||
help="Print the resulting YAML for the specific SHA",
|
||||
)
|
||||
mutex_group_print.add_argument(
|
||||
"--print-job-manifest",
|
||||
metavar='JOB_NAME',
|
||||
type=str,
|
||||
help="Print the resulting job data"
|
||||
parser.add_argument(
|
||||
"--print-job-manifest", type=str, help="Print the resulting job data"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--gitlab-token-file",
|
||||
@@ -509,7 +273,7 @@ def parse_args() -> Namespace:
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
args.gitlab_token = Path(args.gitlab_token_file).read_text().strip()
|
||||
args.gitlab_token = Path(args.gitlab_token_file).read_text()
|
||||
return args
|
||||
|
||||
|
||||
@@ -517,31 +281,29 @@ def main():
|
||||
args = parse_args()
|
||||
gl_gql = GitlabGQL(token=args.gitlab_token)
|
||||
|
||||
sha = check_output(['git', 'rev-parse', args.sha]).decode('ascii').strip()
|
||||
|
||||
if args.print_dag:
|
||||
iid = from_sha_to_pipeline_iid(gl_gql, {"projectPath": args.project_path, "sha": sha})
|
||||
dag = create_job_needs_dag(
|
||||
gl_gql, {"projectPath": args.project_path, "iid": iid}, disable_cache=True
|
||||
dag, jobs = create_job_needs_dag(
|
||||
gl_gql, {"projectPath": args.project_path, "sha": args.sha}
|
||||
)
|
||||
|
||||
if args.regex:
|
||||
dag = filter_dag(dag, re.compile(args.regex))
|
||||
|
||||
print_dag(dag)
|
||||
|
||||
if args.print_merged_yaml or args.print_job_manifest:
|
||||
merged_yaml = fetch_merged_yaml(
|
||||
gl_gql, {"projectPath": args.project_path, "sha": sha}
|
||||
if args.print_merged_yaml:
|
||||
print(
|
||||
fetch_merged_yaml(
|
||||
gl_gql, {"projectPath": args.project_path, "sha": args.sha}
|
||||
)
|
||||
)
|
||||
|
||||
if args.print_merged_yaml:
|
||||
print(yaml.dump(merged_yaml, indent=2))
|
||||
|
||||
if args.print_job_manifest:
|
||||
print_job_final_definition(
|
||||
args.print_job_manifest, merged_yaml, args.project_path, sha
|
||||
)
|
||||
if args.print_job_manifest:
|
||||
merged_yaml = fetch_merged_yaml(
|
||||
gl_gql, {"projectPath": args.project_path, "sha": args.sha}
|
||||
)
|
||||
get_job_final_definition(
|
||||
args.print_job_manifest, merged_yaml, args.project_path, args.sha
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@@ -1,32 +1,83 @@
|
||||
query jobs($projectPath: ID!, $iid: ID!, $cursor: String) {
|
||||
fragment LinkedPipelineData on Pipeline {
|
||||
id
|
||||
iid
|
||||
path
|
||||
cancelable
|
||||
retryable
|
||||
userPermissions {
|
||||
updatePipeline
|
||||
}
|
||||
status: detailedStatus {
|
||||
id
|
||||
group
|
||||
label
|
||||
icon
|
||||
}
|
||||
sourceJob {
|
||||
id
|
||||
name
|
||||
}
|
||||
project {
|
||||
id
|
||||
name
|
||||
fullPath
|
||||
}
|
||||
}
|
||||
|
||||
query getPipelineDetails($projectPath: ID!, $sha: String!) {
|
||||
project(fullPath: $projectPath) {
|
||||
id
|
||||
pipeline(iid: $iid) {
|
||||
pipeline(sha: $sha) {
|
||||
id
|
||||
iid
|
||||
complete
|
||||
stages {
|
||||
downstream {
|
||||
nodes {
|
||||
name
|
||||
...LinkedPipelineData
|
||||
}
|
||||
}
|
||||
jobs(after: $cursor) {
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
count
|
||||
upstream {
|
||||
...LinkedPipelineData
|
||||
}
|
||||
stages {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
needs {
|
||||
edges {
|
||||
node {
|
||||
name
|
||||
}
|
||||
status: detailedStatus {
|
||||
id
|
||||
action {
|
||||
id
|
||||
icon
|
||||
path
|
||||
title
|
||||
}
|
||||
}
|
||||
stage {
|
||||
name
|
||||
groups {
|
||||
nodes {
|
||||
id
|
||||
status: detailedStatus {
|
||||
id
|
||||
label
|
||||
group
|
||||
icon
|
||||
}
|
||||
name
|
||||
size
|
||||
jobs {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
kind
|
||||
scheduledAt
|
||||
needs {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +0,0 @@
|
||||
query sha2pipelineIID($projectPath: ID!, $sha: String!) {
|
||||
project(fullPath: $projectPath) {
|
||||
pipelines(last: 1, sha:$sha){
|
||||
nodes {
|
||||
iid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,8 +1,9 @@
|
||||
aiohttp==3.8.3
|
||||
colorama==0.4.5
|
||||
filecache==0.81
|
||||
gql==3.4.0
|
||||
python-dateutil==2.8.2
|
||||
python-gitlab==3.5.0
|
||||
PyYAML==6.0.1
|
||||
ruamel.yaml.clib==0.2.8
|
||||
ruamel.yaml.clib==0.2.7
|
||||
ruamel.yaml==0.17.21
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user