-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Refactor away TensorBoardWSGIApp in its current form #2575
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
Conversation
|
|
||
| def testNonPathComponentWildcardRoute(self): | ||
| self._test('/foo*', False) | ||
| with six.assertRaisesRegex(self, ValueError, r'invalid route'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks; this is much easier to read.
| logdir=self.log_dir, multiplexer=multiplexer) | ||
| self.plugin = projector_plugin.ProjectorPlugin(context) | ||
| wsgi_app = application.TensorBoardWSGIApp( | ||
| self.log_dir, [self.plugin], multiplexer, reload_interval=0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This had reload_interval=0, so if I understand correctly we would
usually need to AddRunsFromDirectory and Reload manually here to
preserve existing behavior. Is it just that the projector plugin doesn’t
actually query data from the multiplexer except for PluginAssets, and
the plugin assets data path is not covered by these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that's basically the case. Specifically the tests here just rely on the fallback behavior that checks the root logdir directly (in the case of no event files at all):
tensorboard/tensorboard/plugins/projector/projector_plugin.py
Lines 331 to 334 in 15a6368
| # If there are no summary event files, the projector should still work, | |
| # treating the `logdir` as the model checkpoint directory. | |
| if not run_path_pairs: | |
| run_path_pairs.append(('.', self.logdir)) |
Thanks for pointing this out though since it reminded me I was going to file a bug based on what I determined after looking at this part of the mesh plugin test.
This removes TensorBoardWSGIApp, a thin wrapper over TensorBoardWSGI that launches the reloading thread. Instead, we move that logic up into
standard_tensorboard_wsgi()which is the only non-test caller of TensorBoardWSGIApp.For tests, we update these to use TensorBoardWSGI directly, and add an explicit
multiplexer.Reload()call where necessary to maintain the previous behavior.The only usage I know of outside the TB repo is in the TF Lite plugin which I have a PR out to fix in lintian06/tensorflow-lite-plugin#1, but I'm not blocking on that to land.
This addresses core task 1 in #2573, and frees up the name TensorBoardWSGIApp to reuse for a new API to come.