From 8a1c95caab25a5dda287809908ac3576110881e8 Mon Sep 17 00:00:00 2001 From: Sergi Blanch Torne Date: Mon, 17 Jul 2023 08:51:00 +0200 Subject: [PATCH] Introduce ci-kdl builder and launcher. A tool to collect relative changes in some registers of sysfs can be used in the Mesa jobs to record information while the tests are being executed. Signed-off-by: Sergi Blanch Torne Reviewed-by: Eric Engestrom Part-of: --- .gitlab-ci/common/kdl.sh | 28 ++++++++++++++++++++++++++++ .gitlab-ci/container/build-kdl.sh | 23 +++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 .gitlab-ci/common/kdl.sh create mode 100755 .gitlab-ci/container/build-kdl.sh diff --git a/.gitlab-ci/common/kdl.sh b/.gitlab-ci/common/kdl.sh new file mode 100755 index 00000000000..38e967ee2c0 --- /dev/null +++ b/.gitlab-ci/common/kdl.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# shellcheck disable=SC1091 # the path is created in build-kdl and +# here is check if exist + +terminate() { + echo "ci-kdl.sh caught SIGTERM signal! propagating to child processes" + for job in $(jobs -p) + do + kill -15 "$job" + done +} + +trap terminate SIGTERM + +if [ -f /ci-kdl.venv/bin/activate ]; then + source /ci-kdl.venv/bin/activate + echo -e "Launch ci-kdl" + /ci-kdl.venv/bin/python /ci-kdl.venv/bin/ci-kdl | tee -a /results/kdl.log & + child=$! + wait $child + ls -l + mv kdl_*.json /results/kdl.json + echo -e "ci-kdl json file moved to /results" + ls -ls /results +else + echo -e "Not possible to activate ci-kdl virtual environment" +fi + diff --git a/.gitlab-ci/container/build-kdl.sh b/.gitlab-ci/container/build-kdl.sh new file mode 100755 index 00000000000..5f00cfc6c60 --- /dev/null +++ b/.gitlab-ci/container/build-kdl.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# shellcheck disable=SC1091 # the path is created by the script + +set -ex + +KDL_REVISION="5056f71b100a68b72b285c6fc845a66a2ed25985" + +git clone \ + https://gitlab.freedesktop.org/gfx-ci/ci-kdl.git \ + --depth 1 \ + ci-kdl.git +pushd ci-kdl.git +git checkout ${KDL_REVISION} +popd + +python3 -m venv ci-kdl.venv +source ci-kdl.venv/bin/activate +pushd ci-kdl.git +pip install -r requirements.txt +pip install . +popd + +rm -rf ci-kdl.git