Skip to content

Commit

Permalink
Evaluate Circle CI (23171 but from a branch in JuliaLang) (#23188)
Browse files Browse the repository at this point in the history
This runs in circleci's python 2.7 docker image which is based on
debian jessie, mostly for convenience since that image has a non-root
user added and some of the Julia tests work differently when run as root.

Circle CI caching is a little odd - I'm using ccache here since it's
actually fast enough to handle it pretty well, about 15 minutes to build
deps from scratch and about 3 minutes to build deps with a primed ccache.
We save the ARCH, HOME (default location where ccache saves its data, in
case we switch containers and try to run tests as a different user), and
year and week number into a tag file, then determine which saved circleci
cache tag to load from based on the checksum of that tag file. So this
will throw out the cache and have to rebuild it once a week, but since that
only adds about 10-15 minutes to a build that's not a big deal. It would be
better if circle's cache worked like Travis and AppVeyor's where it loads
the latest and checksums the content to decide whether to upload a new
replacement cache, but that's up to circle to fix.

This has to skip the socket tests, since circle doesn't currently support
ipv6 in their docker workers. They have other types of workers, but they
aren't anywhere near as fast to build or run tests.

This currently doesn't do a doc build or deployment, that's a TODO if
we decide to switch to this. It also looks like it checks out the branch
tip instead of the merge commit, but that should be fixable.

Here I've set JULIA_CPU_CORES to 6 - in some testing on my fork this was a
few minutes faster, but may run a higher risk of getting OOM killed.

The merge commit is checked out manually due to Circle limitations.
  • Loading branch information
tkelman authored and ararslan committed Aug 15, 2017
1 parent 0df3f7d commit 3b51323
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: 2
workflows:
version: 2
linux-builds:
jobs:
- build-i686
- build-x86_64

jobs:
build-i686:
docker:
- image: circleci/python:2.7
environment:
JULIA_CPU_CORES: 6
JULIA_TEST_MAXRSS_MB: 800
ARCH: i686
steps: &steps
- run: | # install build dependencies
sudo apt-get install -y g++-4.8-multilib gfortran-4.8-multilib \
time ccache bar &&
for prog in gcc g++ gfortran; do
sudo ln -s /usr/bin/$prog-4.8 /usr/local/bin/$prog;
done
- checkout # circle ci code checkout step
# (FIXME: need to unset url."ssh://git@github.com".insteadOf or libgit2 tests fail)
- run: | # checkout merge commit, set versioning info and Make.user variables
git config --global --unset url."ssh://git@github.com".insteadOf &&
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
git fetch origin +refs/pull/$(basename $CIRCLE_PULL_REQUEST)/merge &&
git checkout -qf FETCH_HEAD;
fi &&
make -C base version_git.jl.phony &&
echo "override ARCH = $ARCH" | tee -a Make.user &&
for var in FORCE_ASSERTIONS LLVM_ASSERTIONS USECCACHE NO_GIT; do
echo "override $var = 1" | tee -a Make.user;
done &&
echo "$ARCH $HOME $(date +%Y%W)" | tee /tmp/weeknumber
- restore_cache: # silly to take a checksum of the tag file here instead of
keys: # its contents but this is the only thing that works on circle
- ccache-{{ checksum "/tmp/weeknumber" }}
- run: | # compile julia deps
contrib/download_cmake.sh &&
make -j8 -C deps || make
- run: | # build julia, output ccache stats when done
make -j8 all &&
make prefix=/tmp/julia install &&
ccache -s &&
make build-stats
- run: | # move source tree out of the way, run tests from install tree
cd .. &&
mv project julia-src &&
/tmp/julia/bin/julia -e 'versioninfo()' &&
/tmp/julia/bin/julia --precompiled=no -e 'true' &&
/tmp/julia/bin/julia-debug --precompiled=no -e 'true' &&
pushd /tmp/julia/share/julia/test &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip socket | bar -i 30 &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg &&
popd &&
mkdir /tmp/embedding-test &&
make check -C /tmp/julia/share/doc/julia/examples/embedding \
JULIA=/tmp/julia/bin/julia BIN=/tmp/embedding-test \
"$(cd julia-src && make print-CC)" &&
mv julia-src project
# - run: cd project && make -C doc deploy
# - run:
# command: sudo dmesg
# when: on_fail
- save_cache:
key: ccache-{{ checksum "/tmp/weeknumber" }}
paths:
- ~/.ccache

build-x86_64:
docker:
- image: circleci/python:2.7
environment:
JULIA_CPU_CORES: 6
JULIA_TEST_MAXRSS_MB: 800
ARCH: x86_64
steps: *steps

0 comments on commit 3b51323

Please sign in to comment.