Commit 93ec399b authored by Tomeu Vizoso's avatar Tomeu Vizoso
Browse files

ci: Use a single template for LAVA jobs



It's a pain to keep both templates in sync and there aren't really that
many differences.
Signed-off-by: Tomeu Vizoso's avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <mesa/mesa!9950>
parent 8926c4a3
job_name: mesa-deqp-{{ deqp_version }}-{{ gpu_version }} {{ pipeline_info }}
device_type: {{ device_type }}
context:
extra_nfsroot_args: " init=/init rootwait"
timeouts:
job:
minutes: 40
action:
minutes: 10
actions:
power-off:
seconds: 30
priority: 75
visibility:
group:
- "Collabora+fdo"
{% if tags %}
{% set lavatags = tags.split(',') %}
tags:
{% for tag in lavatags %}
- {{ tag }}
{% endfor %}
{% endif %}
actions:
- deploy:
timeout:
minutes: 10
to: tftp
kernel:
url: {{ base_artifacts_url }}/{{ kernel_image_name }}
{% if kernel_image_type %}
{{ kernel_image_type }}
{% endif %}
nfsrootfs:
url: {{ base_artifacts_url }}/lava-rootfs.tgz
compression: gz
{% if dtb %}
dtb:
url: {{ base_artifacts_url }}/{{ dtb }}.dtb
{% endif %}
os: oe
- boot:
timeout:
minutes: 5
method: {{ boot_method }}
{% if boot_method == "fastboot" %}
{#
For fastboot, LAVA doesn't know how to unpack the rootfs/apply overlay/repack,
so we transfer the overlay over the network after boot.
#}
transfer_overlay:
download_command: wget -S --progress=dot:giga
unpack_command: tar -C / -xzf
{% else %}
commands: nfs
{% endif %}
prompts:
- 'lava-shell:'
- test:
timeout:
minutes: 60
definitions:
- repository:
metadata:
format: Lava-Test Test Definition 1.0
name: deqp
description: "Mesa dEQP test plan"
os:
- oe
scope:
- functional
run:
steps:
- mount -t proc none /proc
- mount -t sysfs none /sys
- mount -t devtmpfs none /dev || echo possibly already mounted
- mkdir -p /dev/pts
- mount -t devpts devpts /dev/pts
- echo "nameserver 8.8.8.8" > /etc/resolv.conf
- for i in 1 2 3; do sntp -sS pool.ntp.org && break || sleep 2; done
- modprobe amdgpu || true
- DEVFREQ_GOVERNOR=`find /sys/devices -name governor | grep gpu || true`
- echo performance > $DEVFREQ_GOVERNOR || true
- GPU_AUTOSUSPEND=`find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1`
- echo -1 > $GPU_AUTOSUSPEND || true
{% if env_vars %}
- export {{ env_vars }}
{% endif %}
# deqp-runner.sh assumes some stuff is in pwd
- cd /
- wget -S --progress=dot:giga -O- {{ mesa_url }} | tar -xz
- export DEQP_NO_SAVE_RESULTS=1
- export GPU_VERSION={{ gpu_version }}
- export DEQP_VER={{ deqp_version }}
- export LIBGL_DRIVERS_PATH=`pwd`/install/lib/dri
- "if sh /install/deqp-runner.sh; then
echo 'deqp: pass';
else
echo 'deqp: fail';
fi"
parse:
pattern: '(?P<test_case_id>\S*):\s+(?P<result>(pass|fail))'
from: inline
name: deqp
path: inline/mesa-deqp.yaml
......@@ -51,7 +51,7 @@ kernel+rootfs_armhf:
DISTRIBUTION_TAG: *distribution-tag-arm
GIT_STRATEGY: none # testing doesn't build anything from source
ENV_VARS: "DEQP_PARALLEL=6"
FIXED_ENV_VARS: "CI_PIPELINE_ID=${CI_PIPELINE_ID} CI_JOB_ID=${CI_JOB_ID} CI_PAGES_DOMAIN=${CI_PAGES_DOMAIN} CI_PROJECT_NAME=${CI_PROJECT_NAME} CI_PROJECT_PATH=${CI_PROJECT_PATH} CI_PROJECT_ROOT_NAMESPACE=${CI_PROJECT_ROOT_NAMESPACE} CI_JOB_JWT=${CI_JOB_JWT} CI_SERVER_URL=${CI_SERVER_URL} DRIVER_NAME=${DRIVER_NAME} FDO_UPSTREAM_REPO=${FDO_UPSTREAM_REPO} PIGLIT_NO_WINDOW=1 PIGLIT_REPLAY_UPLOAD_TO_MINIO=1 MINIO_HOST=${MINIO_HOST}"
FIXED_ENV_VARS: "CI_PIPELINE_ID=${CI_PIPELINE_ID} CI_JOB_ID=${CI_JOB_ID} CI_PAGES_DOMAIN=${CI_PAGES_DOMAIN} CI_PROJECT_NAME=${CI_PROJECT_NAME} CI_PROJECT_PATH=${CI_PROJECT_PATH} CI_PROJECT_ROOT_NAMESPACE=${CI_PROJECT_ROOT_NAMESPACE} CI_JOB_JWT=${CI_JOB_JWT} CI_SERVER_URL=${CI_SERVER_URL} DRIVER_NAME=${DRIVER_NAME} FDO_UPSTREAM_REPO=${FDO_UPSTREAM_REPO} PIGLIT_NO_WINDOW=1 PIGLIT_REPLAY_UPLOAD_TO_MINIO=1 MINIO_HOST=${MINIO_HOST} LAVA_TEST_SCRIPT=${LAVA_TEST_SCRIPT} TEST_SUITE=${TEST_SUITE}"
DEQP_VERSION: gles2
ARTIFACTS_PREFIX: "https://${MINIO_HOST}/mesa-lava/"
MESA_ROOTFS_TAG: *lava-rootfs
......@@ -66,7 +66,7 @@ kernel+rootfs_armhf:
fi
- >
artifacts/generate_lava.py \
--template artifacts/lava-${TEST_SUITE}.yml.jinja2 \
--template artifacts/lava.yml.jinja2 \
--pipeline-info "$CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \
--base-artifacts-url ${ARTIFACTS_URL} \
--mesa-url ${MESA_URL} \
......@@ -81,13 +81,13 @@ kernel+rootfs_armhf:
--lava-tags "${LAVA_TAGS}" \
--ci-node-index "${CI_NODE_INDEX}" \
--ci-node-total "${CI_NODE_TOTAL}"
- lava_job_id=`lavacli jobs submit lava-${TEST_SUITE}.yml` || lavacli jobs submit lava-${TEST_SUITE}.yml
- lava_job_id=`lavacli jobs submit lava.yml` || lavacli jobs submit lava.yml
- echo $lava_job_id
- rm -rf artifacts/*
- cp lava-${TEST_SUITE}.yml artifacts/.
- lavacli jobs logs $lava_job_id | tee artifacts/lava-${TEST_SUITE}-$lava_job_id.log
- cp lava.yml artifacts/.
- lavacli jobs logs $lava_job_id | tee artifacts/lava-$lava_job_id.log
- lavacli jobs show $lava_job_id
- result=`lavacli results $lava_job_id 0_${TEST_SUITE} ${TEST_SUITE} | head -1`
- result=`lavacli results $lava_job_id 0_mesa mesa | head -1`
- echo $result
- '[[ "$result" == "pass" ]]'
artifacts:
......@@ -103,6 +103,7 @@ kernel+rootfs_armhf:
KERNEL_IMAGE_TYPE: "type:\ zimage"
BOOT_METHOD: u-boot
TEST_SUITE: "deqp"
LAVA_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .lava-test
- .use-arm_build
......@@ -117,6 +118,7 @@ kernel+rootfs_armhf:
KERNEL_IMAGE_TYPE: "type:\ image"
BOOT_METHOD: u-boot
TEST_SUITE: "deqp"
LAVA_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .lava-test
- .use-arm_build
......@@ -134,6 +136,7 @@ kernel+rootfs_armhf:
KERNEL_IMAGE_TYPE: "type:\ zimage"
BOOT_METHOD: u-boot
TEST_SUITE: "deqp"
LAVA_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .use-x86_build-base # for same $MESA_BASE_TAG as in kernel+rootfs_amd64
- .use-arm_build # ARM because it must match the architecture of the runner
......@@ -154,6 +157,7 @@ kernel+rootfs_armhf:
.lava-piglit:
variables:
TEST_SUITE: "piglit"
LAVA_TEST_SCRIPT: "/install/piglit/run.sh"
.lava-piglit-traces:amd64:
extends:
......
job_name: mesa-piglit-{{ gpu_version }} {{ pipeline_info }}
job_name: mesa-{{ test_suite }}-{{ deqp_version }}-{{ gpu_version }} {{ pipeline_info }}
device_type: {{ device_type }}
context:
extra_nfsroot_args: " init=/init rootwait"
......@@ -63,8 +63,8 @@ actions:
- repository:
metadata:
format: Lava-Test Test Definition 1.0
name: piglit
description: "Mesa piglit test plan"
name: mesa
description: "Mesa test plan"
os:
- oe
scope:
......@@ -81,16 +81,26 @@ actions:
- modprobe amdgpu || true
- DEVFREQ_GOVERNOR=`find /sys/devices -name governor | grep gpu || true`
- echo performance > $DEVFREQ_GOVERNOR || true
- GPU_AUTOSUSPEND=`find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1`
- echo -1 > $GPU_AUTOSUSPEND || true
{% if env_vars %}
- export {{ env_vars }}
{% endif %}
# piglit/run.sh assumes some stuff is in pwd
# runner script assumes some stuff is in pwd
- cd /
- wget -S --progress=dot:giga -O- {{ mesa_url }} | tar -xz
- export DEQP_NO_SAVE_RESULTS=1
- export GPU_VERSION={{ gpu_version }}
- export DEQP_VER={{ deqp_version }}
- export PYTHONPATH=$(python3 -c "import sys;print(\":\".join(sys.path))")
- export LIBGL_DRIVERS_PATH=`pwd`/install/lib/dri
- export PIGLIT_REPLAY_EXTRA_ARGS="--keep-image"
- export PIGLIT_REPLAY_REFERENCE_IMAGES_BASE_URL="/mesa-tracie-results/${CI_PROJECT_PATH}"
- export PIGLIT_REPLAY_ARTIFACTS_BASE_URL="/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}/${CI_JOB_ID}"
......@@ -98,13 +108,15 @@ actions:
- export PIGLIT_REPLAY_DEVICE_NAME=gl-{{ gpu_version }}
- export PIGLIT_RESULTS={{ gpu_version }}-${PIGLIT_PROFILES}
- "if sh /install/piglit/run.sh; then
echo 'piglit: pass';
- export LIBGL_DRIVERS_PATH=`pwd`/install/lib/dri
- "if sh $LAVA_TEST_SCRIPT; then
echo 'mesa: pass';
else
echo 'piglit: fail';
echo 'mesa: fail';
fi"
parse:
pattern: '(?P<test_case_id>\S*):\s+(?P<result>(pass|fail))'
from: inline
name: piglit
path: inline/mesa-piglit.yaml
name: mesa
path: inline/mesa.yaml
......@@ -44,7 +44,7 @@ tar -cf artifacts/install.tar install
if [ -n "$MINIO_ARTIFACT_NAME" ]; then
# Pass needed files to the test stage
cp $CI_PROJECT_DIR/.gitlab-ci/generate_lava.py artifacts/.
cp $CI_PROJECT_DIR/.gitlab-ci/lava-*.yml.jinja2 artifacts/.
cp $CI_PROJECT_DIR/.gitlab-ci/lava.yml.jinja2 artifacts/.
MINIO_ARTIFACT_NAME="$MINIO_ARTIFACT_NAME.tar.gz"
gzip -c artifacts/install.tar > ${MINIO_ARTIFACT_NAME}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment