From e281d3213880158636208cea4b7f09037506750d Mon Sep 17 00:00:00 2001 From: Blaise Tine Date: Sun, 22 Nov 2020 19:07:46 -0800 Subject: [PATCH] travis timeout workaround --- .travis.yml | 22 +++++++++++----------- ci/blackbox.sh | 39 ++++++--------------------------------- ci/travis_run.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 44 deletions(-) create mode 100755 ci/travis_run.py diff --git a/.travis.yml b/.travis.yml index ee775f73..ab49a900 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,17 +25,17 @@ script: - travis_wait 45 ci/test_driver.sh - travis_wait 45 ci/test_riscv_isa.sh - travis_wait 45 ci/test_opencl.sh - - travis_wait 45 ci/blackbox.sh --travis --driver=rtlsim - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=1 --scope --app=demo --args="-n1" - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --debug - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=1 - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=2 - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=4 - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=2 --l2cache - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=4 --l2cache - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=2 --l2cache --clusters=2 - - travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=2 --l2cache --clusters=4 + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=rtlsim + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=1 --scope --app=demo --args="-n1" + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --debug + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=1 + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=2 + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=4 + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=2 --l2cache + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=4 --l2cache + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=2 --l2cache --clusters=2 + - travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=2 --l2cache --clusters=4 after_success: # Gather code coverage diff --git a/ci/blackbox.sh b/ci/blackbox.sh index 0841bc8a..28d010d7 100755 --- a/ci/blackbox.sh +++ b/ci/blackbox.sh @@ -6,7 +6,7 @@ set -e show_usage() { echo "Vortex BlackBox Test Driver v1.0" - echo "Usage: [[--clusters=#n] [--cores=#n] [--warps=#n] [--threads=#n] [--l2cache] [[--driver=rtlsim|vlsim] [--debug] [--scope] [--travis] [--app=vecadd|sgemm|basic|demo|dogfood] [--args=] [--help]]" + echo "Usage: [[--clusters=#n] [--cores=#n] [--warps=#n] [--threads=#n] [--l2cache] [[--driver=rtlsim|vlsim] [--debug] [--scope] [--app=vecadd|sgemm|basic|demo|dogfood] [--args=] [--help]]" } DRIVER=vlsim @@ -18,7 +18,6 @@ THREADS=4 L2=0 DEBUG=0 SCOPE=0 -TRAVIS=0 HAS_ARGS=0 for i in "$@" @@ -65,17 +64,13 @@ case $i in HAS_ARGS=1 shift ;; - --travis) - TRAVIS=1 - shift - ;; --help) show_usage - exit + exit 0 ;; *) show_usage - exit + exit -1 ;; esac done @@ -91,7 +86,7 @@ case $DRIVER in ;; *) echo "invalid driver: $DRIVER" - exit + exit -1 ;; esac @@ -113,7 +108,7 @@ case $APP in ;; *) echo "invalid app: $APP" - exit + exit -1 ;; esac @@ -124,13 +119,7 @@ echo "CONFIGS=$CONFIGS" make -C $DRIVER_PATH clean if [ $DEBUG -eq 1 ] -then - if [ $TRAVIS -eq 1 ] - then - while sleep 5m; do echo "*** still running..."; done & - sleep_pid=$! - fi - +then if [ $SCOPE -eq 1 ] then DEBUG=1 SCOPE=1 CONFIGS="$CONFIGS" make -C $DRIVER_PATH $DRIVER_EXTRA > build.log 2>&1 @@ -144,29 +133,13 @@ then else make -C $APP_PATH run-$DRIVER > run.log 2>&1 fi - - if [ $TRAVIS -eq 1 ] - then - kill $sleep_pid - fi else - if [ $TRAVIS -eq 1 ] - then - while sleep 5m; do echo "*** still running..."; done & - sleep_pid=$! - fi - if [ $SCOPE -eq 1 ] then SCOPE=1 CONFIGS="$CONFIGS" make -C $DRIVER_PATH $DRIVER_EXTRA > build.log 2>&1 else CONFIGS="$CONFIGS" make -C $DRIVER_PATH $DRIVER_EXTRA > build.log 2>&1 fi - - if [ $TRAVIS -eq 1 ] - then - kill $sleep_pid - fi if [ $HAS_ARGS -eq 1 ] then diff --git a/ci/travis_run.py b/ci/travis_run.py new file mode 100755 index 00000000..5ae46755 --- /dev/null +++ b/ci/travis_run.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +import sys +import time +import threading +import subprocess + +PingInterval = 15 + +def PingCallback(stop): + wait_time = 0 + while True: + time.sleep(PingInterval) + wait_time += PingInterval + print(" + still running (" + str(wait_time) + "s) ...") + sys.stdout.flush() + if stop(): + break + +def run_command(command): + process = subprocess.Popen(command, stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + if output: + print output.strip() + return process.returncode + +def main(argv): + + stop_threads = False + t = threading.Thread(target = PingCallback, args =(lambda : stop_threads, )) + t.start() + + exitcode = run_command(argv) + print(" + exitcode="+str(exitcode)) + + stop_threads = True + t.join() + + sys.exit(exitcode) + +if __name__ == "__main__": + main(sys.argv[1:]) \ No newline at end of file