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