Skip to content

Conversation

@wchargin
Copy link
Contributor

@wchargin wchargin commented Apr 6, 2020

Summary:
Needed for tensorboard.__version__ to resolve, as used by (e.g.) the
What-If Tool. Fixes #3484.

Test Plan:
Running bazel run //tensorboard -- --logdir /tmp/logs in a virtualenv
with tensorboard-plugin-wit==1.6.0.post3 installed now works, instead
of failing with:

  File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load
    version = pkg_resources.parse_version(tensorboard.__version__)
AttributeError: module 'tensorboard' has no attribute '__version__'
terminate called without an active exception
Fatal Python error: Aborted

wchargin-branch: build-include-init

Summary:
Needed for `tensorboard.__version__` to resolve, as used by (e.g.) the
What-If Tool. Fixes #3484.

Test Plan:
Running `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv
with `tensorboard-plugin-wit==1.6.0.post3` installed now works, instead
of failing with:

```
  File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load
    version = pkg_resources.parse_version(tensorboard.__version__)
AttributeError: module 'tensorboard' has no attribute '__version__'
terminate called without an active exception
Fatal Python error: Aborted
```

wchargin-branch: build-include-init
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.

Do we need "//tensorboard:lib", # User-facing overall TensorBoard API on build_pip_package anymore?

wchargin added a commit that referenced this pull request Apr 6, 2020
Summary:
Prior to this change, any exception raised from `loader.load()` would
crash TensorBoard (see, e.g., #3484). As of this patch, we log an error,
drop the plugin, and continue loading.

Test Plan:
Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with
`tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in #3485.
Note that TensorBoard now prints:

```
E0406 09:57:12.844471 139872056727360 application.py:260] Failed to invoke plugin loader WhatIfToolPluginLoader.load
Traceback (most recent call last):
  File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp
    plugin = loader.load(context)
  File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load
    version = pkg_resources.parse_version(tensorboard.__version__)
AttributeError: module 'tensorboard' has no attribute '__version__'
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit)
```

wchargin-branch: application-load-failure-robustness
@wchargin
Copy link
Contributor Author

wchargin commented Apr 6, 2020

You’re right that it’s not strictly necessary, but I think that it’s
good to keep in the spirit of strict deps. That is, it’s something that
the Pip package semantically needs to provide, and is only incidentally
provided by //tensorboard.

Does this sound reasonable to you, or would you prefer that I remove it?

@stephanwlee
Copy link
Contributor

Ah, strict deps. I forgot that building pip package uses the init. Current change LGTM.

@wchargin wchargin merged commit e59e9c4 into master Apr 6, 2020
@wchargin wchargin deleted the wchargin-build-include-init branch April 6, 2020 17:58
wchargin added a commit that referenced this pull request Apr 6, 2020
Summary:
Prior to this change, any exception raised from `loader.load()` would
crash TensorBoard (see, e.g., #3484). As of this patch, we log an error,
drop the plugin, and continue loading.

Test Plan:
Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with
`tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in #3485
(i.e., run `git revert e59e9c4`). Note that TensorBoard now prints:

```
E0406 11:00:39.494363 140089282381632 application.py:260] Failed to load plugin WhatIfToolPluginLoader.load; ignoring it.
Traceback (most recent call last):
  File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp
    plugin = loader.load(context)
  File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load
    version = pkg_resources.parse_version(tensorboard.__version__)
AttributeError: module 'tensorboard' has no attribute '__version__'
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit)
```

wchargin-branch: application-load-failure-robustness
bileschi pushed a commit to bileschi/tensorboard that referenced this pull request Apr 15, 2020
Summary:
Needed for `tensorboard.__version__` to resolve, as used by (e.g.) the
What-If Tool. Fixes tensorflow#3484.

Test Plan:
Running `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv
with `tensorboard-plugin-wit==1.6.0.post3` installed now works, instead
of failing with:

```
  File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load
    version = pkg_resources.parse_version(tensorboard.__version__)
AttributeError: module 'tensorboard' has no attribute '__version__'
terminate called without an active exception
Fatal Python error: Aborted
```

wchargin-branch: build-include-init
bileschi pushed a commit to bileschi/tensorboard that referenced this pull request Apr 15, 2020
Summary:
Prior to this change, any exception raised from `loader.load()` would
crash TensorBoard (see, e.g., tensorflow#3484). As of this patch, we log an error,
drop the plugin, and continue loading.

Test Plan:
Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with
`tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in tensorflow#3485
(i.e., run `git revert e59e9c4`). Note that TensorBoard now prints:

```
E0406 11:00:39.494363 140089282381632 application.py:260] Failed to load plugin WhatIfToolPluginLoader.load; ignoring it.
Traceback (most recent call last):
  File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp
    plugin = loader.load(context)
  File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load
    version = pkg_resources.parse_version(tensorboard.__version__)
AttributeError: module 'tensorboard' has no attribute '__version__'
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit)
```

wchargin-branch: application-load-failure-robustness
bileschi pushed a commit that referenced this pull request Apr 15, 2020
Summary:
Needed for `tensorboard.__version__` to resolve, as used by (e.g.) the
What-If Tool. Fixes #3484.

Test Plan:
Running `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv
with `tensorboard-plugin-wit==1.6.0.post3` installed now works, instead
of failing with:

```
  File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load
    version = pkg_resources.parse_version(tensorboard.__version__)
AttributeError: module 'tensorboard' has no attribute '__version__'
terminate called without an active exception
Fatal Python error: Aborted
```

wchargin-branch: build-include-init
bileschi pushed a commit that referenced this pull request Apr 15, 2020
Summary:
Prior to this change, any exception raised from `loader.load()` would
crash TensorBoard (see, e.g., #3484). As of this patch, we log an error,
drop the plugin, and continue loading.

Test Plan:
Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with
`tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in #3485
(i.e., run `git revert e59e9c4`). Note that TensorBoard now prints:

```
E0406 11:00:39.494363 140089282381632 application.py:260] Failed to load plugin WhatIfToolPluginLoader.load; ignoring it.
Traceback (most recent call last):
  File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp
    plugin = loader.load(context)
  File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load
    version = pkg_resources.parse_version(tensorboard.__version__)
AttributeError: module 'tensorboard' has no attribute '__version__'
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit)
```

wchargin-branch: application-load-failure-robustness
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.

bazel run //tensorboard broken with What-If Tool 1.6.0post3

3 participants