Skip to content
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

build: use mirror.tensorflow.org, now populated #2245

Merged
merged 2 commits into from
May 20, 2019

Conversation

wchargin
Copy link
Contributor

Summary:
It’s easier for TensorBoard team members to upload files to the
TensorFlow.org mirror than the Bazel mirror. Many of our files were not
mirrored, and fetches from GitHub can be noticeably slow. (For instance,
the Bazel 0.22.0 binary is 1.8–2.0 seconds from the TF mirror and 8.5–12
seconds from GitHub.) As of this commit, all mirror.bazel.build URLs
are replaced with mirror.tensorflow.org URLs, and all such URLs
contain valid content.

Along the way, I swapped out the defunct numericjs source to a host that
actually still resolves.

On Travis, getting Bazel and running bazel fetch //tensorboard/...
typically takes about 44 seconds. Let’s see if this speeds that up.

Test Plan:
Check that Bazel URLs resolve:

$ git grep -Pho '(?<=")https?://mirror\.tensorflow\.org/[^"]*' |
> grep -vF '${BAZEL}' | sort | uniq |
> xargs -n 1 -P 32 -- \
> sh -c 'curl -sfL "$1" >/dev/null && echo OK || echo FAIL' unused |
> sort | uniq -c
    231 OK

Check that the Travis URL resolves:

$ BAZEL=0.22.0
$ curl -sfL "http://mirror.tensorflow.org/github.com/bazelbuild/bazel/releases/download/${BAZEL}/bazel-${BAZEL}-linux-x86_64" |
> shasum -a 256
8474ed28ed4998e2f5671ddf3a9a80ae9e484a5de3b8b70c8b654c017c65d363

Check that we caught ’em all:

$ git grep mirror.bazel | wc -l
0

wchargin-branch: mirror-tensorflow-org

Summary:
It’s easier for TensorBoard team members to upload files to the
TensorFlow.org mirror than the Bazel mirror. Many of our files were not
mirrored, and fetches from GitHub can be noticeably slow. (For instance,
the Bazel 0.22.0 binary is 1.8–2.0 seconds from the TF mirror and 8.5–12
seconds from GitHub.) As of this commit, all `mirror.bazel.build` URLs
are replaced with `mirror.tensorflow.org` URLs, and all such URLs
contain valid content.

Along the way, I swapped out the defunct numericjs source to a host that
actually still resolves.

On Travis, getting Bazel and running `bazel fetch //tensorboard/...`
typically takes about 44 seconds. Let’s see if this speeds that up.

Test Plan:
Check that Bazel URLs resolve:

```
$ git grep -Pho '(?<=")https?://mirror\.tensorflow\.org/[^"]*' |
> grep -vF '${BAZEL}' | sort | uniq |
> xargs -n 1 -P 32 -- \
> sh -c 'curl -sfL "$1" >/dev/null && echo OK || echo FAIL' unused |
> sort | uniq -c
    231 OK
```

Check that the Travis URL resolves:

```
$ BAZEL=0.22.0
$ curl -sfL "http://mirror.tensorflow.org/github.com/bazelbuild/bazel/releases/download/${BAZEL}/bazel-${BAZEL}-linux-x86_64" |
> shasum -a 256
8474ed28ed4998e2f5671ddf3a9a80ae9e484a5de3b8b70c8b654c017c65d363
```

Check that we caught ’em all:

```
$ git grep mirror.bazel | wc -l
0
```

wchargin-branch: mirror-tensorflow-org
@wchargin
Copy link
Contributor Author

Well, fetch down from 44s to 40s on Travis. Sure, okay.

Copy link
Contributor

@stephanwlee stephanwlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in guessing that http is okay since we have the checksum?

@@ -74,7 +74,7 @@
'Chrome/62.0.3202.94 '
'Safari/537.36',
'HTTP User-Agent header to send to Google Fonts')
flags.DEFINE_string('mirror', 'https://mirror.bazel.build/',
flags.DEFINE_string('mirror', 'https://mirror.tensorflow.org/',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this url be http instead of https?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Thank you.

Copy link
Contributor Author

@wchargin wchargin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in guessing that http is okay since we have the
checksum?

Yes, exactly. A mitm could eavesdrop or deny service, but can never
corrupt the build because everything has known checksums.

I would have used HTTPS anyway, but the TensorFlow mirror does not
support it; it has a bad certificate.

@@ -74,7 +74,7 @@
'Chrome/62.0.3202.94 '
'Safari/537.36',
'HTTP User-Agent header to send to Google Fonts')
flags.DEFINE_string('mirror', 'https://mirror.bazel.build/',
flags.DEFINE_string('mirror', 'https://mirror.tensorflow.org/',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Thank you.

Copy link
Contributor

@nfelt nfelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's perhaps still at least worth asking the mirror.tensorflow.org folks to do whatever mirror.bazel.build did, since it does support HTTPS.

wchargin-source: 7a5d9d7e62962de5645333721c7dd0ec7a3cb485
wchargin-branch: mirror-tensorflow-org
@wchargin wchargin merged commit 6bc1ff2 into master May 20, 2019
@wchargin wchargin deleted the wchargin-mirror-tensorflow-org branch May 20, 2019 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants