From 35cd13953e0a717b115c167dedaedfba73ea76fc Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya Date: Mon, 7 Oct 2024 11:39:34 +0100 Subject: [PATCH 1/4] Updated build related docs Signed-off-by: Jitendra Gundaniya --- ...latform_agnostic_sharing_with_kedro_viz.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/source/platform_agnostic_sharing_with_kedro_viz.md b/docs/source/platform_agnostic_sharing_with_kedro_viz.md index 228e875d42..c9092e1432 100644 --- a/docs/source/platform_agnostic_sharing_with_kedro_viz.md +++ b/docs/source/platform_agnostic_sharing_with_kedro_viz.md @@ -46,6 +46,32 @@ Starting from Kedro-Viz 9.2.0, `kedro viz build` will not include dataset previe This creates a `build` folder containing your Kedro-Viz app package in your project directory. +## Running Kedro-Viz Locally + +When you generate build folder with the command `kedro viz build`, it creates a build directory with an `index.html` file, which is the entry point for visualizing your pipeline. However, simply opening `index.html` using the file protocol `file://` is not supported due to Cross-Origin Resource Sharing Policy in modern browsers. + +### Using a Local Server + +To view your pipeline visualization correctly, you need to serve `index.html` using an HTTP server. Here are a few simple ways to do this: + +1. Python's Built-in HTTP Server: + - Navigate to the build directory and run: + ```bash + python -m http.server + ``` + - This starts a web server at `http://localhost:8000`, which you can use to view index.html. + +2. Node's http-server: + - First, install it globally: + ```bash + npm install -g http-server + ``` + - Then, run it from the build directory: + ```bash + http-server + ``` + + ## Static website hosting platforms such as GitHub Pages Follow the steps [listed in the GitHub pages documentation](https://docs.github.com/en/pages/quickstart) to create a Git repository that supports GitHub Pages. On completion, push the contents of the previously created `build` folder to this new repository. Your site will be available at the following URL: `http://.github.io` From 4b6e82dc7205f129d471e527867d74b27ff96258 Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya Date: Mon, 7 Oct 2024 12:04:28 +0100 Subject: [PATCH 2/4] Release note added Signed-off-by: Jitendra Gundaniya --- RELEASE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE.md b/RELEASE.md index 72cfee8cdb..6680b51378 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -12,6 +12,10 @@ Please follow the established format: - Update Kedro-Viz telemetry for opt-out model (#2022) +## Bug fixes and other changes + +- Improve `kedro viz build` usage documentation (#2126) + # Release 10.0.0 From eb1168834e2e378612be5f4ac3f38602ffdcc62e Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:59:09 +0100 Subject: [PATCH 3/4] Update docs/source/platform_agnostic_sharing_with_kedro_viz.md Co-authored-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Signed-off-by: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com> --- docs/source/platform_agnostic_sharing_with_kedro_viz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/platform_agnostic_sharing_with_kedro_viz.md b/docs/source/platform_agnostic_sharing_with_kedro_viz.md index c9092e1432..1dcfdb89f9 100644 --- a/docs/source/platform_agnostic_sharing_with_kedro_viz.md +++ b/docs/source/platform_agnostic_sharing_with_kedro_viz.md @@ -48,7 +48,7 @@ This creates a `build` folder containing your Kedro-Viz app package in your proj ## Running Kedro-Viz Locally -When you generate build folder with the command `kedro viz build`, it creates a build directory with an `index.html` file, which is the entry point for visualizing your pipeline. However, simply opening `index.html` using the file protocol `file://` is not supported due to Cross-Origin Resource Sharing Policy in modern browsers. +When you generate the build folder using the command `kedro viz build`, it creates a build directory with an `index.html` file, which serves as the entry point for visualizing your pipeline. However, simply opening `index.html` using the `file://` protocol is not supported due to Cross-Origin Resource Sharing (CORS) policies in modern browsers. ### Using a Local Server From cf5256df0a115214f7d3df8bf6c908c6f772fe26 Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya Date: Thu, 10 Oct 2024 11:28:13 +0100 Subject: [PATCH 4/4] review suggestion. Signed-off-by: Jitendra Gundaniya --- docs/source/platform_agnostic_sharing_with_kedro_viz.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/platform_agnostic_sharing_with_kedro_viz.md b/docs/source/platform_agnostic_sharing_with_kedro_viz.md index 1dcfdb89f9..a08c1adac4 100644 --- a/docs/source/platform_agnostic_sharing_with_kedro_viz.md +++ b/docs/source/platform_agnostic_sharing_with_kedro_viz.md @@ -48,9 +48,8 @@ This creates a `build` folder containing your Kedro-Viz app package in your proj ## Running Kedro-Viz Locally -When you generate the build folder using the command `kedro viz build`, it creates a build directory with an `index.html` file, which serves as the entry point for visualizing your pipeline. However, simply opening `index.html` using the `file://` protocol is not supported due to Cross-Origin Resource Sharing (CORS) policies in modern browsers. +When you generate the build folder using the command `kedro viz build`, it creates a build directory with an `index.html` file, which serves as the entry point for visualizing your pipeline. -### Using a Local Server To view your pipeline visualization correctly, you need to serve `index.html` using an HTTP server. Here are a few simple ways to do this: @@ -71,6 +70,9 @@ To view your pipeline visualization correctly, you need to serve `index.html` us http-server ``` +```{warning} +Simply opening `index.html` using the `file://` protocol is not supported due to Cross-Origin Resource Sharing (CORS) policies in modern browsers. +``` ## Static website hosting platforms such as GitHub Pages