Commit 13f48521 authored by Rohan Garg's avatar Rohan Garg Committed by Alexandros Frantzis

ci: Re-architect the CI run to download individual traces

Embedded devices such as ARM boards might not have enough storage
capacity to store all of the traces together. By moving to a LFS
based git repository for the traces, we can download traces one
at a time in order to ensure that there's enough storage space
in order to be able to replace trace files.
Signed-off-by: default avatarRohan Garg <rohan.garg@collabora.com>
parent 6336cceb
......@@ -54,7 +54,7 @@ x86_build:
- .debian@container-ifnot-exists
- .container
variables:
DEBIAN_TAG: &x86_build "2019-11-13"
DEBIAN_TAG: &x86_build "2019-11-22"
.use-x86_build:
variables:
......@@ -126,8 +126,8 @@ mesa-build:
dependencies:
- mesa-build
before_script:
- git clone "$TRACES_DB_REPO" traces-db
- (cd traces-db; git checkout "$TRACES_DB_COMMIT")
- git clone --no-checkout "$TRACES_DB_REPO" traces-db
- (cd $CI_PROJECT_DIR/traces-db; git reset "$TRACES_DB_COMMIT")
- export DISPLAY=:0
- export MESA_SHA=$(cat $CI_PROJECT_DIR/mesa_sha.txt)
- export LD_LIBRARY_PATH="$CI_PROJECT_DIR/mesa/install/lib/:/usr/local/lib/"
......@@ -139,11 +139,12 @@ mesa-build:
- bash -c "echo MESA_SHA=$MESA_SHA >>$CI_PROJECT_DIR/results/summary.txt"
script:
- cd $CI_PROJECT_DIR/traces-db
# Pull reference images
- git lfs pull -I '*.png'
# Run renderdoc traces with the surfaceless platform
- EGL_PLATFORM=surfaceless DISPLAY= python3 $CI_PROJECT_DIR/scripts/dump_trace_images.py --trace-types renderdoc --device-name "$DEVICE_NAME" .
- EGL_PLATFORM=surfaceless DISPLAY= $CI_PROJECT_DIR/.gitlab-ci/run-tests.sh rdc
# Run apitrace traces with xvfb (for now, until we add surfaceless support)
- python3 $CI_PROJECT_DIR/scripts/dump_trace_images.py --trace-types apitrace --device-name "$DEVICE_NAME" .
- python3 $CI_PROJECT_DIR/scripts/diff_trace_images.py --device-name "$DEVICE_NAME" --output-dir "$CI_PROJECT_DIR/results" .
- $CI_PROJECT_DIR/.gitlab-ci/run-tests.sh trace
# Disable performance replays, since we don't need them at the moment and
# the replay started failing: https://gitlab.freedesktop.org/gfx-ci/tracie/tracie/issues/1
# - python3 $CI_PROJECT_DIR/scripts/replay_trace_fps.py .
......
......@@ -59,7 +59,7 @@ apt-get install -y mesa-utils
# Renderdoc and apitrace
export APITRACE_VERSION=0f541f460bba86a69c8c714076db5a7607cc8d16
export RENDERDOC_VERSION=ba3df46052afd78b8d24a136aa450c08548ef2c9
apt-get install -y git xvfb cmake autoconf gcc g++ make python3-pil python3-pilkit
apt-get install -y git git-lfs xvfb cmake autoconf gcc g++ make python3-pil python3-pilkit
apt-get install -y libx11-dev libx11-xcb-dev mesa-common-dev libgl1-mesa-dev libxcb-keysyms1-dev \
cmake python3-dev bison autoconf automake libpcre3-dev qt5-qmake qt5-default
......
#!/usr/bin/env bash
set -x
ret=0
for trace in $(git lfs ls-files -n -I \*.$1)
do
_trace="${trace//,/?}"
git lfs pull -I "$_trace"
python3 $CI_PROJECT_DIR/scripts/dump_trace_images.py --device-name "$DEVICE_NAME" "$trace"
python3 $CI_PROJECT_DIR/scripts/diff_trace_images.py --device-name "$DEVICE_NAME" --output-dir "$CI_PROJECT_DIR/results" "$trace"
if [[ $? -ne 0 ]]; then
ret=1
fi
rm "$trace"
done
exit $ret
......@@ -96,14 +96,14 @@ def dump_from_trace(trace, device_name):
log("Debug", "=== Failure log end ===")
return False
def find_traces_with_reference_images(directory, device_name, trace_types):
traces = []
for trace_path in iter_trace_paths(directory, trace_types):
def filter_trace_paths_with_ref_images(trace_paths, device_name):
out = []
for trace_path in trace_paths:
if trace_has_images(trace_path, str(Path("references") / device_name)):
traces.append(str(trace_path))
out.append(str(trace_path))
else:
log("Warning", "%s has no reference images, skipping" % str(trace_path))
return traces
return out
def main():
parser = argparse.ArgumentParser()
......@@ -118,13 +118,13 @@ def main():
args = parser.parse_args()
trace_types = [trace_type_from_name(t) for t in args.trace_types.split(",")]
traces = []
if os.path.isdir(args.tracepath):
traces.extend(find_traces_with_reference_images(args.tracepath,
args.device_name,
trace_types))
all_trace_paths = iter_trace_paths(args.tracepath, trace_types)
elif os.path.isfile(args.tracepath):
traces.append(args.tracepath)
all_trace_paths = [Path(args.tracepath)]
traces = filter_trace_paths_with_ref_images(all_trace_paths,
args.device_name)
failed_dump = False
......
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