From af1e6117f8b83af1edb0514fb1e382bc74e9aa82 Mon Sep 17 00:00:00 2001 From: Yuan Gong Date: Wed, 19 Feb 2020 17:03:48 +0800 Subject: [PATCH 1/3] Remove @jupyter/html-manager from full.tpl --- .../src/apiserver/visualization/exporter.py | 2 +- .../visualization/templates/full.tpl | 29 ++----------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/backend/src/apiserver/visualization/exporter.py b/backend/src/apiserver/visualization/exporter.py index c5cc3d0f8cc..2f56f57711f 100644 --- a/backend/src/apiserver/visualization/exporter.py +++ b/backend/src/apiserver/visualization/exporter.py @@ -149,5 +149,5 @@ def generate_html_from_notebook(self, nb: NotebookNode) -> Text: # Output generator self.ep.preprocess(nb, {"metadata": {"path": Path.cwd()}}, self.km) # Export all html and outputs - body, _ = html_exporter.from_notebook_node(nb) + body, _ = html_exporter.from_notebook_node(nb, resources={}) return body diff --git a/backend/src/apiserver/visualization/templates/full.tpl b/backend/src/apiserver/visualization/templates/full.tpl index 58107182f62..2aac4185414 100644 --- a/backend/src/apiserver/visualization/templates/full.tpl +++ b/backend/src/apiserver/visualization/templates/full.tpl @@ -15,32 +15,7 @@ {% block ipywidgets %} -{%- if "widgets" in nb.metadata -%} - -{%- endif -%} + {% endblock ipywidgets %} {% for css in resources.inlining.css -%} @@ -98,4 +73,4 @@ div#notebook-container{ {% block footer %} {{ super() }} -{% endblock footer %} \ No newline at end of file +{% endblock footer %} From b16cc3f2a63aff7189b3a836fae43acbe8ed5854 Mon Sep 17 00:00:00 2001 From: Yuan Gong Date: Wed, 19 Feb 2020 17:05:47 +0800 Subject: [PATCH 2/3] Include visualization server cloudbuild yaml to facilitate local dev --- test/cloudbuild/visualization.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/cloudbuild/visualization.yaml diff --git a/test/cloudbuild/visualization.yaml b/test/cloudbuild/visualization.yaml new file mode 100644 index 00000000000..61c0a29adc3 --- /dev/null +++ b/test/cloudbuild/visualization.yaml @@ -0,0 +1,8 @@ +steps: + - id: "visualization-server" + name: "gcr.io/cloud-builders/docker" + args: + ["build", "-t", "$_GCR_BASE/visualization-server", "-f", "backend/Dockerfile.visualization", "."] +images: + - "$_GCR_BASE/visualization-server" +timeout: 1800s # 30min From 4428b2922685fc53b271ba32bf2d1d9106c9ea50 Mon Sep 17 00:00:00 2001 From: Yuan Gong Date: Wed, 19 Feb 2020 18:01:34 +0800 Subject: [PATCH 3/3] Stop fallback behavior of KFP UI to improve dev experience --- frontend/server/app.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/frontend/server/app.ts b/frontend/server/app.ts index b3e4065b6e7..2b9e819ac3b 100644 --- a/frontend/server/app.ts +++ b/frontend/server/app.ts @@ -192,8 +192,5 @@ function createUIServer(options: UIConfigs) { app.use(basePath, StaticHandler(options.server.staticDir)); app.use(StaticHandler(options.server.staticDir)); - /** Fallback to index.html */ - app.get('*', indexHtmlHandler); - return app; }