• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2# shellcheck disable=SC2086 # we want word splitting
3
4set -uex -o pipefail
5
6if [ -z "$GPU_VERSION" ]; then
7   echo 'GPU_VERSION must be set to something like "radeonsi-raven" or "freedreno-a630" (the name used in your ci/gpu-version-*.txt)'
8   exit 1
9fi
10
11if [ -z "$FLUSTER_CODECS" ]; then
12   echo 'FLUSTER_CODECS must be set to a space sparated list of codecs like "VP8" or "H.265"'
13   exit 1
14fi
15
16# Check which fluster vectors to get
17FLUSTER_VECTORS_HOST_PATH="${STORAGE_MAINLINE_HOST_PATH}/fluster/${FLUSTER_VECTORS_VERSION}"
18if [ "$CI_PROJECT_PATH" != "$FDO_UPSTREAM_REPO" ]; then
19  if ! curl -s -X HEAD -L --retry 4 -f --retry-delay 60 "https://${FLUSTER_VECTORS_HOST_PATH}/done"; then
20    echo "Using Fluster vectors from the fork, cached from mainline is unavailable."
21    FLUSTER_VECTORS_HOST_PATH="${STORAGE_FORK_HOST_PATH}/fluster/${FLUSTER_VECTORS_VERSION}"
22  else
23    echo "Using the cached Fluster vectors."
24  fi
25fi
26
27FLUSTER_VECTORS_HOST_PATH="${FDO_HTTP_CACHE_URI:-}https://${FLUSTER_VECTORS_HOST_PATH}/vectors.tar.zst"
28
29curl -L --retry 4 -f --retry-all-errors --retry-delay 60 ${FLUSTER_VECTORS_HOST_PATH} | tar --zstd -x -C /usr/local/
30
31INSTALL="$PWD/install"
32
33# Set up the driver environment.
34export LD_LIBRARY_PATH="$INSTALL/lib/"
35
36export LIBVA_DRIVERS_PATH=$INSTALL/lib/dri/
37# libva spams driver open info by default, and that happens per testcase.
38export LIBVA_MESSAGING_LEVEL=1
39
40RESULTS=$PWD/${FLUSTER_RESULTS_DIR:-results}
41mkdir -p $RESULTS
42
43if [ -n "${FLUSTER_FRACTION:-}" ] || [ -n "$CI_NODE_INDEX" ]; then
44    FRACTION=$((${FLUSTER_FRACTION:-1} * ${CI_NODE_TOTAL:-1}))
45    FLUSTER_RUNNER_OPTIONS="${FLUSTER_RUNNER_OPTIONS:-} --fraction $FRACTION"
46fi
47
48# If the job is parallel at the gitab job level, take the corresponding fraction
49# of the caselist.
50if [ -n "$CI_NODE_INDEX" ]; then
51    FLUSTER_RUNNER_OPTIONS="${FLUSTER_RUNNER_OPTIONS:-} --fraction-start ${CI_NODE_INDEX}"
52fi
53
54for codec in ${FLUSTER_CODECS}; do
55    DECODERS="${DECODERS:-} GStreamer-${codec}-VAAPI-Gst1.0"
56done
57
58# Default to an empty known flakes file if it doesn't exist.
59FLUSTER_FLAKES=$INSTALL/$GPU_VERSION-fluster-flakes.txt
60touch ${FLUSTER_FLAKES}
61
62# Default to an empty known fails file if it doesn't exist.
63FLUSTER_FAILS=$INSTALL/$GPU_VERSION-fluster-fails.txt
64touch ${FLUSTER_FAILS}
65
66# Default to an empty known skips file if it doesn't exist.
67FLUSTER_SKIPS=$INSTALL/$GPU_VERSION-fluster-skips.txt
68touch ${FLUSTER_SKIPS}
69
70set +e
71
72fluster-runner \
73        run \
74        --fluster /usr/local/fluster/fluster.py \
75        --output ${RESULTS} \
76        --jobs ${FDO_CI_CONCURRENT:-4} \
77        --skips ${FLUSTER_SKIPS} \
78        --flakes ${FLUSTER_FLAKES} \
79        --baseline ${FLUSTER_FAILS} \
80        --decoders ${DECODERS} \
81        ${FLUSTER_RUNNER_OPTIONS} \
82        -v -v
83
84FLUSTER_EXITCODE=$?
85
86set -e
87
88# Report the flakes to the IRC channel for monitoring (if configured):
89if [ -n "${FLAKES_CHANNEL:-}" ]; then
90    python3 $INSTALL/report-flakes.py \
91     --host irc.oftc.net \
92     --port 6667 \
93     --results $RESULTS/results.csv \
94     --known-flakes ${FLUSTER_FLAKES} \
95     --channel "$FLAKES_CHANNEL" \
96     --runner "$CI_RUNNER_DESCRIPTION" \
97     --job "$CI_JOB_ID" \
98     --url "$CI_JOB_URL" \
99     --branch "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-$CI_COMMIT_BRANCH}" \
100     --branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}" || true
101fi
102
103deqp-runner junit \
104   --testsuite "fluster-${FLUSTER_CODECS// /-}" \
105   --results $RESULTS/results.csv \
106   --output $RESULTS/junit.xml \
107   --template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
108
109# Compress results.csv to save on bandwidth during the upload of artifacts to
110# GitLab.
111zstd --rm -T0 -8qc $RESULTS/results.csv -o $RESULTS/results.csv.zst
112
113exit $FLUSTER_EXITCODE
114