kedro-org / kedro-viz

Visualise your Kedro data and machine-learning pipelines and track your experiments.
https://demo.kedro.org
Apache License 2.0
680 stars 113 forks source link

Inconsistent GUI rendering when accessing Kedro pipeline via localhost vs device IP #2198

Open kravitsjacob opened 2 days ago

kravitsjacob commented 2 days ago

Description/Context

I am currently hosting a kedro viz instance on my local machine (for example, local ip address of 192.168.0.9) on a specified port, for this example let's say port 1234.

So, if I go to localhost:1234 I get a "complete" kedro visualization: image

I want to quickly share this visualization with my coworker on my network. I expose that port, and direct them to `192.168.0.9:1234'. However, when they visit, they get an "incomplete" kedro visualization that is missing the experiments tab, among other things: image

Interestingly, if I direct them to the experiments page directly 192.168.0.7:1008/experiment-tracking, the page does work and they are able to access the experiments page. So, this appears to just be a GUI problem (Cross-Origin Resource Sharing?!?).

I acknowledge that there are better ways of sharing these dashboards, but give my current development needs, I want to be able to quickly share the dashboard running on my machine with coworkers on my network.

Steps to Reproduce

  1. Host a kedro instance on a specified port kedro viz run --host=0.0.0.0 --port=1008
  2. Ensure that port is exposed
  3. Visit localhost:1234 and note that the full dashboard is hosted, as expected.
  4. Visit <your-local-ip>:1234

Expected Result

<your-local-ip>:1234 should be exactly the same as the localhost:1234 version.

Actual Result

<your-local-ip>:1234 is missing certain functionality, for example the experiments button, when compared to the localhost:1234 version.

Environment

Thank you in advance for your help! I've only been using kedro a few hours, so my apologies if this is basic question!

tynandebold commented 3 hours ago

It isn't a CORS issue. It's because there's a function that checks if the URL is deemed to be running locally, which then changes some elements of the UI. This is the code: https://github.com/kedro-org/kedro-viz/blob/eac8d39dba221cba63b4cc1a4346782690b6fd95/src/utils/index.js#L194-L207

If your 192.168.0.9:1234 address was included there, you'd see what you'd expect to see.