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

Restructure the WSGI app for easier direct use #2573

Open
6 of 13 tasks
nfelt opened this issue Aug 19, 2019 · 2 comments
Open
6 of 13 tasks

Restructure the WSGI app for easier direct use #2573

nfelt opened this issue Aug 19, 2019 · 2 comments

Comments

@nfelt
Copy link
Contributor

nfelt commented Aug 19, 2019

This issue tracks refactoring the main TensorBoard WSGI app to make it easier to use the app as a standalone WSGI app (rather than only via the tensorboard CLI).

The essential stream of work is the "core" stream below, but it leaves behind a lot of cleanup that we should at least partially address as well.

CORE

CLEANUP: WSGI

  • Create dispatch middleware for mapping WSGI apps to paths
  • Change path_prefix to be application of dispatch middleware to TensorBoardWSGIApp, rather than built-in feature - partly done in application: extract path prefix logic to middleware #2733
  • Make each plugin itself a WSGI app, so that their backends can be tested entirely independent of the main TB app, and remove calls to TensorBoardWSGI
    • could do this by implementing __call__ in BasePlugin using dispatch middleware plus get_plugin_apps()?
    • could change get_plugin_apps() to memoized default implementation that searches class for attributes carrying a special tag, and use a method decorator to apply this tag to the individual routes (e.g. @tb_route("/tags") def tags_route(self, request): ...)
  • Refactor away TensorBoardWSGI inner surface (move plugin route aggregation logic into a helper that we can test directly)
  • Change TensorBoardWSGIApp.__call__() to just use dispatch middleware logic

CLEANUP: CORE PLUGIN

@nfelt
Copy link
Contributor Author

nfelt commented Oct 18, 2019

Factored out the CorePlugin flags cleanup into #2801.

@nfelt
Copy link
Contributor Author

nfelt commented May 20, 2020

Update: several more pieces done in #3643.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants