From 0b139b648f7d0bb94a57c3a5e71069e34b58f6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sta=C5=84czak?= Date: Thu, 24 Oct 2019 13:53:30 +0200 Subject: [PATCH] Add cron.sh script following astropy-benchmarks --- cron.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 cron.sh diff --git a/cron.sh b/cron.sh new file mode 100755 index 0000000..f4c43e9 --- /dev/null +++ b/cron.sh @@ -0,0 +1,34 @@ +#!/bin/bash -xe + +MACHINE=`python -c "from asv.machine import Machine; print(Machine.load('~/.asv-machine.json').machine)"` + +echo "asv: "`asv --version` +echo "Machine: "$MACHINE + +git clean -fxd +git checkout master +git pull origin master + +# We now run all benchmarks since the last one run in this benchmarks repository. This assumes +# you have previously run at least ``asv run HEAD^!`` and added the results to the repository +# otherwise running ``asv run NEW`` will run all benchmarks since the start of the project. +# We add || true to make sure that if no commits are run (because there aren't any) things don't +# fail. But asv should have a way to return a zero status code in that case, so we should fix +# that in future. The timeout command is used to make sure that the command finishes before +# the next cron job - the timeout value is in seconds and can be adjusted. + +# On Linux - using taskset -c 0 ensures that the same core is always used when running the benchmarks. +taskset -c 0 asv run NEW || true +timeout 7200 taskset -c 0 asv run ALL --skip-existing-commits || true + +# On MacOSX: +# asv run NEW || true +# timeout 7200 asv run ALL --steps 10 --skip-existing-commits || true + +git add results/$MACHINE +git commit -m "New results from $MACHINE" + +git push origin master +asv gh-pages --no-push +git push -f origin gh-pages +