-
Notifications
You must be signed in to change notification settings - Fork 112
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
Improve kedro viz build
usage documentation
#2126
Conversation
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Quick question here - can we enable kedro-viz to run on a simple python using kedro viz cli locally ... maybe we could kedro viz |
@rashidakanchwala If I understood correctly, then It will become |
Sorry, I didn't read your PR properly. I meat running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for this!
Co-authored-by: rashidakanchwala <37628668+rashidakanchwala@users.noreply.github.com> Signed-off-by: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com>
# Conflicts: # RELEASE.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @jitu5 ! Maybe I'd remove the "using a local server" sub-heading and rearrange the information like
"""
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.
To view your pipeline visualization, you need to serve index.html
using an HTTP server. Here are a few simple ways to do this:
(explain two different ways)
::: warning
simply opening index.html
using the file://
protocol is not supported due to Cross-Origin Resource Sharing (CORS) policies in modern browsers.
:::
"""
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
Resolves #1918
This PR adds additional documentation to clarify why
kedro-viz
cannot be run directly from a local filesystem (file://
protocol) without encountering specific issues. The intention is to provide more context to users who may try to use the file protocol and run into these issues.Context
Currently, attempting to run
kedro-viz
by simply opening index.html through thefile://
protocol causes CORS issues. Most modern browsers enforce strict CORS policies for local files to prevent security vulnerabilities.The file protocol (
file://
) is treated differently compared to other network requests. Requests to resources from a local file context (e.g., scripts, APIs) are treated as cross-origin requests by the browser, which results in CORS errors when trying to access JavaScript assets or other dynamic resources required by kedro-viz.Therefore, the recommendation for a proper user experience is to run kedro-viz using a local web server, which avoids CORS policy issues and guarantees that all resources are correctly served and accessed. Examples of lightweight static servers include Python's
http.server
or Node.jshttp-server
, which can easily serve the generated HTML.This PR proposes updated documentation to explain why users need to run Kedro-Viz through a server, helping prevent confusion.
Checklist
RELEASE.md
file