Skip to content

Commit 8823f10

Browse files
committed
Make Travis go faster
Since we're compiling things like protobuf from scratch, it makes a lot of sense to cache the blaze-bin directories. This really plays to Bazel's strengths, which is that it solves the cache invalidation problem. Results: Rather than taking 8 minutes, Travis now takes somewhere between two minutes and eight minutes.
1 parent 84b7dd0 commit 8823f10

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

.travis.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1+
dist: trusty
2+
sudo: required
3+
14
language: python
25
python:
36
- "2.7"
47
- "3.4"
5-
# trusty beta image has jdk8, gcc4.8.4
6-
dist: trusty
7-
sudo: required
88

99
os:
1010
- linux
1111

1212
env:
1313
- BAZEL=0.5.1 TF=NIGHTLY
1414

15+
cache:
16+
directories:
17+
- $HOME/.bazel-output-base
18+
1519
before_install:
1620
- |
1721
set -e
1822
BAZEL_URL="https://github.com/bazelbuild/bazel/releases/download/${BAZEL}/bazel-${BAZEL}-installer-linux-x86_64.sh"
19-
wget -O install.sh "${BAZEL_URL}"
23+
wget -t 3 -O install.sh "${BAZEL_URL}"
2024
chmod +x install.sh
2125
./install.sh --user
2226
rm -f install.sh
@@ -40,20 +44,45 @@ before_install:
4044
script:
4145
- |
4246
bazel \
43-
--output_base=$HOME/.cache/bazel \
47+
--output_base="${HOME}/.bazel-output-base" \
4448
--batch \
4549
--host_jvm_args=-Xmx500m \
4650
--host_jvm_args=-Xms500m \
47-
test \
51+
build \
4852
tensorboard/... \
4953
--worker_verbose \
5054
--verbose_failures \
51-
--test_output=errors \
5255
--spawn_strategy=sandboxed \
5356
--genrule_strategy=sandboxed \
5457
--local_resources=400,2,1.0 \
58+
--worker_max_instances=2 \
5559
--strategy=Javac=worker \
5660
--strategy=Closure=worker
61+
- |
62+
bazel \
63+
--output_base="${HOME}/.bazel-output-base" \
64+
--batch \
65+
--host_jvm_args=-Xmx500m \
66+
--host_jvm_args=-Xms500m \
67+
test \
68+
tensorboard/... \
69+
--verbose_failures \
70+
--test_output=errors \
71+
--spawn_strategy=sandboxed \
72+
--local_resources=400,2,1.0
73+
74+
before_cache:
75+
- |
76+
find "${HOME}/.bazel-output-base" \
77+
-name \*.runfiles -print0 \
78+
-or -name \*.tar.gz -print0 \
79+
-or -name \*-execroot.json -print0 \
80+
-or -name \*-tsc.json -print0 \
81+
-or -name \*-params.pbtxt -print0 \
82+
-or -name \*-args.txt -print0 \
83+
-or -name \*.runfiles_manifest -print0 \
84+
-or -name \*.server_params.pbtxt -print0 \
85+
| xargs -0 rm -rf
5786
5887
notifications:
59-
email: false
88+
email: false

0 commit comments

Comments
 (0)