-
Notifications
You must be signed in to change notification settings - Fork 226
Run benchmark on Travis-CI #816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
49db73e
run benchmark on Travis
553626b
send bm report from Travis
336239b
append date string to job name
77f34f7
recover ci jobs
0824f07
rename script
3ea402d
[bm] use master branch of TuringBenchmarks
59c6506
translate bash script to jl code
5e0598b
Delete run-benchmarks-on-travis.sh
yebai 5cd6d4a
Rename scripts/run-benchmarks-on-travis.jl to benchmarks/runbenchmark…
yebai 6062c5b
Update .travis.yml
yebai 29b5738
Update .travis.yml
yebai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
set -v | ||
|
||
BASE_BRANCH=master | ||
|
||
if [[ $TRAVIS == true ]]; then | ||
if [[ $TRAVIS_PULL_REQUEST == true ]]; then | ||
CURRENT_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH | ||
exit 0 # avoid double run on commit and PR | ||
else | ||
CURRENT_BRANCH=$TRAVIS_BRANCH | ||
fi | ||
else | ||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
fi | ||
|
||
COMMIT_MSG=$(git show -s --format="%s") | ||
|
||
SANTI_BR_NAME=$(echo $CURRENT_BRANCH | sed 's/\W/_/g') | ||
COMMIT_SHA=$(git rev-parse HEAD) | ||
TIME=$(date +%Y%m%d%H%M%S) | ||
BM_JOB_NAME="BMCI-${SANTI_BR_NAME}-${COMMIT_SHA:0:7}-${TIME}" | ||
|
||
if [[ $COMMIT_MSG != *"[bm]"* ]]; then | ||
KDr2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "skipping the benchmark jobs." | ||
exit 0 | ||
fi | ||
|
||
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' | ||
git fetch --all --unshallow | ||
|
||
git clone https://github.com/TuringLang/TuringBenchmarks.git ../TuringBenchmarks | ||
# Notice: uncomment the following line to use travis-ci branch of TuringBenchmarks | ||
# git -C ../TuringBenchmarks checkout -b travis-ci origin/travis-ci | ||
|
||
unset JULIA_PROJECT | ||
cat > pre.jl <<EOF | ||
using Pkg | ||
# Pkg.instantiate() | ||
try pkg"develop ." catch end | ||
try pkg"develop ." catch end | ||
try pkg"build Turing" catch end | ||
using Turing | ||
try pkg"develop ../TuringBenchmarks" catch end | ||
try pkg"develop ../TuringBenchmarks" catch end | ||
pkg"add SpecialFunctions" | ||
using TuringBenchmarks | ||
EOF | ||
|
||
julia pre.jl | ||
|
||
cat > run.jl <<EOF | ||
using TuringBenchmarks.Runner | ||
Runner.run_bm_on_travis("$BM_JOB_NAME", ("master", "$CURRENT_BRANCH"), "$COMMIT_SHA") | ||
EOF | ||
|
||
cat run.jl | ||
julia run.jl |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.