Skip to content

Commit

Permalink
Add cron.sh script following astropy-benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
StanczakDominik committed Oct 24, 2019
1 parent 57b88c3 commit 0b139b6
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cron.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0b139b6

Please sign in to comment.