Skip to content

Conversation

@nfelt
Copy link
Contributor

@nfelt nfelt commented Aug 19, 2019

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.


def testNonPathComponentWildcardRoute(self):
self._test('/foo*', False)
with six.assertRaisesRegex(self, ValueError, r'invalid route'):
Copy link
Contributor

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,
Copy link
Contributor

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?

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, 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):

# 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.

@nfelt nfelt merged commit f06f40b into master Aug 20, 2019
@nfelt nfelt deleted the wsgi-app-refactor-1 branch August 20, 2019 18:54
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