From 51c99d8bf6b796e2a4e58e339864d85b5118b8ed Mon Sep 17 00:00:00 2001 From: Stephan Lee Date: Mon, 6 Jul 2020 17:33:40 -0700 Subject: [PATCH] Change default FE to Angular TB (#3779) 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. Please access the legacy Polymer based TensorBoard via localhost:6006/legacy.html. --- tensorboard/BUILD | 35 ++++++--------------- tensorboard/components/BUILD | 6 ++-- tensorboard/pip_package/test_pip_package.sh | 2 +- tensorboard/webapp/BUILD | 12 +++---- 4 files changed, 19 insertions(+), 36 deletions(-) diff --git a/tensorboard/BUILD b/tensorboard/BUILD index ee3b18bf87c..c9b9a991405 100644 --- a/tensorboard/BUILD +++ b/tensorboard/BUILD @@ -276,43 +276,26 @@ py_test( ], ) -config_setting( - name = "dev_build", - # consider changing this to fastbuild - values = {"compilation_mode": "dbg"}, -) - tensorboard_zip_file( name = "webfiles", 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 = [ - "//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 = [ + "//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", - ] + select({ - "//tensorboard:dev_build": monaco_imports, - "//conditions:default": [], - }), + ], ) # This is a dummy rule used as a numpy dependency in open-source. diff --git a/tensorboard/components/BUILD b/tensorboard/components/BUILD index a580e53ce38..5b6e6670a96 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/pip_package/test_pip_package.sh b/tensorboard/pip_package/test_pip_package.sh index 0f1e91c6764..b58064fdc7a 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 diff --git a/tensorboard/webapp/BUILD b/tensorboard/webapp/BUILD index f7d7a1cc58b..41c93ec7c64 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"], )