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

core: move ES module path into FrontendMetadata #2317

Merged
merged 2 commits into from
Jun 5, 2019

Conversation

wchargin
Copy link
Contributor

@wchargin wchargin commented Jun 5, 2019

Summary:
The two loading mechanisms are now specified in the same data object, so
switching from one to the other requires only a single change.

The HTTP API and the frontend are unchanged.

Test Plan:
Modify the scalar plugin’s frontend_metadata to use an ES module path:

diff --git a/tensorboard/plugins/scalar/scalars_plugin.py b/tensorboard/plugins/scalar/scalars_plugin.py
index 1b864a74..2e06c86a 100644
--- a/tensorboard/plugins/scalar/scalars_plugin.py
+++ b/tensorboard/plugins/scalar/scalars_plugin.py
@@ -85,7 +85,8 @@ class ScalarsPlugin(base_plugin.TBPlugin):

   def frontend_metadata(self):
     return super(ScalarsPlugin, self).frontend_metadata()._replace(
-        element_name='tf-scalar-dashboard',
+        #element_name='tf-scalar-dashboard',
+        es_module_path='/magic.js',
         use_data_selector=True,
     )

Then, launch TensorBoard and note that the plugins_listing response
contains the right values for both the scalar and image plugins.

wchargin-branch: es-module-metadata

Summary:
The two loading mechanisms are now specified in the same data object, so
switching from one to the other requires only a single change.

The HTTP API and the frontend are unchanged.

Test Plan:
Modify the scalar plugin’s `frontend_metadata` to use an ES module path:

```diff
diff --git a/tensorboard/plugins/scalar/scalars_plugin.py b/tensorboard/plugins/scalar/scalars_plugin.py
index 1b864a74..2e06c86a 100644
--- a/tensorboard/plugins/scalar/scalars_plugin.py
+++ b/tensorboard/plugins/scalar/scalars_plugin.py
@@ -85,7 +85,8 @@ class ScalarsPlugin(base_plugin.TBPlugin):

   def frontend_metadata(self):
     return super(ScalarsPlugin, self).frontend_metadata()._replace(
-        element_name='tf-scalar-dashboard',
+        #element_name='tf-scalar-dashboard',
+        es_module_path='/magic.js',
         use_data_selector=True,
     )
```

Then, launch TensorBoard and note that the `plugins_listing` response
contains the right values for both the scalar and image plugins.

wchargin-branch: es-module-metadata
wchargin-source: 0a7e48329acba4b58ab9223e6b9ad7dbea98aff8
wchargin-branch: es-module-metadata
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.

Logical evolution. LGTM!

@wchargin wchargin merged commit b4db8ec into master Jun 5, 2019
@wchargin wchargin deleted the wchargin-es-module-metadata branch June 17, 2019 22:50
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.

2 participants