From ce60afd281e932e0a26c35c8aec74c1c030fe670 Mon Sep 17 00:00:00 2001 From: Stephan Lee Date: Wed, 1 Jul 2020 10:38:09 -0700 Subject: [PATCH 1/3] Change default FE to Angular TB This commit changes the default route (e.g., localhost:6006/) to the Angular based TensorBoard. More an entire minor version, we intend to keep the legacy build around as an escape hatch. --- tensorboard/BUILD | 27 +++++++-------------------- tensorboard/components/BUILD | 6 +++--- tensorboard/webapp/BUILD | 12 ++++++------ 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/tensorboard/BUILD b/tensorboard/BUILD index 4594f2b71a..c04dbe1162 100644 --- a/tensorboard/BUILD +++ b/tensorboard/BUILD @@ -276,12 +276,6 @@ py_test( ], ) -config_setting( - name = "dev_build", - # consider changing this to fastbuild - values = {"compilation_mode": "dbg"}, -) - tensorboard_zip_file( name = "webfiles", deps = [":assets"], @@ -296,23 +290,16 @@ monaco_imports = [ tf_web_library( name = "assets", srcs = [ - "//tensorboard/components:index.html", - "//tensorboard/components:index.js", - ] + select({ - "//tensorboard:dev_build": [ - "//tensorboard/webapp:ng_index.html", - "//tensorboard/webapp:ng_index.js", - "//tensorboard/webapp:svg_bundle", - ], - "//conditions:default": [], - }), + "//tensorboard/components:legacy.html", + "//tensorboard/components:legacy.js", + "//tensorboard/webapp:index.html", + "//tensorboard/webapp:index.js", + "//tensorboard/webapp:svg_bundle", + ], path = "/", deps = [ "@com_google_fonts_roboto", - ] + select({ - "//tensorboard:dev_build": monaco_imports, - "//conditions:default": [], - }), + ] + monaco_imports, ) # This is a dummy rule used as a numpy dependency in open-source. diff --git a/tensorboard/components/BUILD b/tensorboard/components/BUILD index a580e53ce3..5b6e6670a9 100644 --- a/tensorboard/components/BUILD +++ b/tensorboard/components/BUILD @@ -38,11 +38,11 @@ tf_web_library( ) tensorboard_html_binary( - name = "index", + name = "legacy", compile = False, input_path = "/tensorboard.html", - js_path = "/index.js", - output_path = "/index.html", + js_path = "/legacy.js", + output_path = "/legacy.html", deps = [":tensorboard"], ) diff --git a/tensorboard/webapp/BUILD b/tensorboard/webapp/BUILD index 8c8890766b..abd7d79a4a 100644 --- a/tensorboard/webapp/BUILD +++ b/tensorboard/webapp/BUILD @@ -104,7 +104,7 @@ tf_web_library( tf_web_library( name = "tensorboard-webapp", srcs = [ - "index.html", + "index.inlined.html", ":styles.css", ], path = "/", @@ -118,17 +118,17 @@ tf_web_library( genrule( name = "gen_index.html", srcs = ["index.uninlined.html"], - outs = ["index.html"], + outs = ["index.inlined.html"], cmd = "$(execpath //tensorboard/logo:inline_favicon) $< >$@", tools = ["//tensorboard/logo:inline_favicon"], ) # A Vulcanized html binary for the complete app (both Angular and Polymer parts) tensorboard_html_binary( - name = "ng_index", - input_path = "/index.html", - js_path = "/ng_index.js", - output_path = "/ng_index.html", + name = "index", + input_path = "/index.inlined.html", + js_path = "/index.js", + output_path = "/index.html", deps = [":tensorboard-webapp"], ) From 0c1ac4e05413b06e67c71f52af298395c9e1c9f7 Mon Sep 17 00:00:00 2001 From: Stephan Lee Date: Wed, 1 Jul 2020 13:57:50 -0700 Subject: [PATCH 2/3] yeah... component name changed --- tensorboard/pip_package/test_pip_package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorboard/pip_package/test_pip_package.sh b/tensorboard/pip_package/test_pip_package.sh index 0f1e91c676..b58064fdc7 100755 --- a/tensorboard/pip_package/test_pip_package.sh +++ b/tensorboard/pip_package/test_pip_package.sh @@ -134,7 +134,7 @@ smoke() ( tensorboard --port=0 --logdir=smokedir 2>pipe & perl -ne 'print STDERR;/http:.*:(\d+)/ and print $1.v10 and exit 0' port curl -fs "http://localhost:$(cat port)" >index.html - grep 'logdir.json grep 'smokedir' logdir.json curl -fs "http://localhost:$(cat port)/data/plugin/projector/runs" >projector_runs.json From 4cf20f5b481449c3e49e4a4e47e4918ffb61c83a Mon Sep 17 00:00:00 2001 From: Stephan Lee Date: Mon, 6 Jul 2020 16:58:23 -0700 Subject: [PATCH 3/3] CR --- tensorboard/BUILD | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tensorboard/BUILD b/tensorboard/BUILD index c04dbe1162..b028887fa7 100644 --- a/tensorboard/BUILD +++ b/tensorboard/BUILD @@ -281,12 +281,6 @@ tensorboard_zip_file( deps = [":assets"], ) -monaco_imports = [ - "//tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/source_code/monaco:monaco_editor", - "//tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/source_code/monaco:monaco_languages", -] - -# TODO(stephanwlee): add ng_index.html to the srcs when it is ready for mass consumption. tf_web_library( name = "assets", srcs = [ @@ -298,8 +292,10 @@ tf_web_library( ], path = "/", deps = [ + "//tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/source_code/monaco:monaco_editor", + "//tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/source_code/monaco:monaco_languages", "@com_google_fonts_roboto", - ] + monaco_imports, + ], ) # This is a dummy rule used as a numpy dependency in open-source.