forked from tensorflow/tensorboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
169 lines (150 loc) · 6.13 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
dist: trusty
sudo: required
language: python
python:
- "2.7"
- "3.6"
os:
- linux
branches:
only:
- master
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
env:
# Keep this Bazel version in sync with the `versions.check` directive
# near the top of our WORKSPACE file.
#
# Grab the BAZEL_SHA256SUM from the Bazel releases page; e.g.:
# bazel-0.20.0-linux-x86_64.sha256
global:
- BAZEL=0.22.0
- BAZEL_SHA256SUM=8474ed28ed4998e2f5671ddf3a9a80ae9e484a5de3b8b70c8b654c017c65d363
matrix:
- TF_VERSION_ID=tf-nightly
- TF_VERSION_ID=tf-nightly-2.0-preview
- TF_VERSION_ID= # Do not install TensorFlow in this case
cache:
directories:
- $HOME/.bazel-output-base
# Each bullet point is displayed in the Travis log as one collapsed line, which
# indicates how long it took. Travis will check the return code at the end. We
# can't use `set -e` in the YAML file since it might impact Travis internals.
# If inline scripts get too long, Travis surprisingly prints them twice.
before_install:
# Travis pre-installs an old version of numpy. We uninstall it to
# reduce the potential for strange behavior when upgrading in-place
# for TensorFlow's numpy dependency.
- pip uninstall -y numpy
- pip freeze # print installed distributions, for debugging purposes
- |
# Download Bazel
bazel_binary="$(mktemp)" &&
bazel_checksum_file="$(mktemp)" &&
printf >"${bazel_checksum_file}" \
'%s %s\n' "${BAZEL_SHA256SUM}" "${bazel_binary}" &&
for url in \
"https://mirror.bazel.build/github.com/bazelbuild/bazel/releases/download/${BAZEL}/bazel-${BAZEL}-linux-x86_64" \
"https://github.com/bazelbuild/bazel/releases/download/${BAZEL}/bazel-${BAZEL}-linux-x86_64" \
; do
if \
wget -t 3 -O "${bazel_binary}" "${url}" &&
shasum -a 256 --check "${bazel_checksum_file}"; then
break
else
rm -f "${bazel_binary}"
fi
done &&
rm "${bazel_checksum_file}" &&
[ -f "${bazel_binary}" ]
- chmod +x "${bazel_binary}"
- sudo mv "${bazel_binary}" /usr/local/bin/bazel
# Fix Boto and Travis issue https://github.com/travis-ci/travis-ci/issues/7940
- sudo rm -f /etc/boto.cfg
# Storing build artifacts in this directory helps Travis cache them. This
# will sometimes cut latency in half, when we're lucky.
- echo "startup --output_base=${HOME}/.bazel-output-base" >>~/.bazelrc
# Travis Trusty Sudo GCE VMs have 2 cores and 7.5 GB RAM. These settings
# help Bazel go faster and not OOM the system.
- echo "startup --host_jvm_args=-Xms500m" >>~/.bazelrc
- echo "startup --host_jvm_args=-Xmx500m" >>~/.bazelrc
- echo "startup --host_jvm_args=-XX:-UseParallelGC" >>~/.bazelrc
- echo "build --local_resources=400,2,1.0" >>~/.bazelrc
- echo "build --worker_max_instances=2" >>~/.bazelrc
# Make Bazel as strict as possible, so TensorBoard will build correctly
# for users, regardless of their Bazel configuration.
- echo "build --worker_verbose" >>~/.bazelrc
- echo "build --worker_sandboxing" >>~/.bazelrc
- echo "build --spawn_strategy=sandboxed" >>~/.bazelrc
- echo "build --genrule_strategy=sandboxed" >>~/.bazelrc
- echo "test --test_verbose_timeout_warnings" >>~/.bazelrc
# It's helpful to see the errors on failure.
- echo "build --verbose_failures" >>~/.bazelrc
- echo "test --test_output=errors" >>~/.bazelrc
# We need to pass the PATH from our virtualenv down into our tests,
# which is non-hermetic and so disabled by default in Bazel 0.21.0+.
- echo "test --action_env=PATH" >>~/.bazelrc
install:
- pip install boto3==1.9.86
- pip install flake8==3.5.0
- pip install futures==3.1.1
- pip install grpcio==1.6.3
- pip install moto==1.3.7
- pip install yamllint==1.5.0
- |
# Install TensorFlow if requested
if [ -n "${TF_VERSION_ID}" ]; then
pip install -I "${TF_VERSION_ID}"
else
# Requirements typically found through TensorFlow
pip install "absl-py>=0.7.0"
pip install "numpy<2.0,>=1.14.5"
fi
before_script:
# fail the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# a comment of '# noqa' or better yet '# noqa: <error code>' added to the code to silence flake8
- flake8 . --count --exit-zero --ignore=E111,E114 --max-complexity=10 --max-line-length=127 --statistics
# Lint .yaml docs files. Use '# yamllint disable-line rule:foo' to suppress.
- yamllint -c docs/.yamllint docs docs/.yamllint
# Make sure we aren't accidentally including work-in-progress code.
- tensorboard/tools/do_not_submit_test.sh
# Make sure all necessary files have the license information.
- tensorboard/tools/license_test.sh
# Make sure that IPython notebooks have valid Markdown.
- tensorboard/tools/docs_list_format_test.sh
# Commands in this section should only fail if it's our fault. Travis will
# categorize them as 'failed', rather than 'error' for other sections.
script:
# Note: bazel test implies fetch+build, but this gives us timing.
- bazel fetch //tensorboard/...
- bazel build //tensorboard/...
- |
# When TensorFlow is not installed, run a restricted subset of tests.
if [ -z "${TF_VERSION_ID}" ]; then
test_tag_filters=support_notf
else
test_tag_filters=
fi
- bazel test //tensorboard/... --test_tag_filters="${test_tag_filters}"
# Run manual S3 test
- bazel test //tensorboard/compat/tensorflow_stub:gfile_s3_test
- bazel run //tensorboard/pip_package:build_pip_package -- --tf-version "${TF_VERSION_ID}" --smoke
after_script:
# Bazel launches daemons unless --batch is used.
- bazel shutdown
before_cache:
- |
# Scrub tiny build artifacts not worth caching.
find "${HOME}/.bazel-output-base" \
-name \*.runfiles -print0 \
-or -name \*.tar.gz -print0 \
-or -name \*-execroot.json -print0 \
-or -name \*-tsc.json -print0 \
-or -name \*-params.pbtxt -print0 \
-or -name \*-args.txt -print0 \
-or -name \*.runfiles_manifest -print0 \
-or -name \*.server_params.pbtxt -print0 \
| xargs -0 rm -rf
notifications:
email: false