https://kedro.org/ logo
#questions
Title
# questions
j

Jorit Studer

09/21/2023, 9:52 PM
Hi everyone, Is there a way to configure Kedro Viz to run on a subpath? http://127.0.0.1:4141/kedro-viz/
t

Tynan

09/22/2023, 7:37 AM
Not at the moment, no. Could you please elaborate a little on why you want to do this?
j

Jorit Studer

09/22/2023, 9:05 AM
Currently I’m working on a Code Server installation. So Kedro viz would need respect the subpath for that vscode code server installation.
n

Nok Lam Chan

09/22/2023, 11:39 AM
Hi @Jorit Studer , not sure if I understand the question. What’s in http://127.0.0.1:4141/? I have been using GitPod/Codespace and launch viz from there but haven’t run into sub-path issue.
j

Jorit Studer

09/22/2023, 11:46 AM
@Nok Lam Chan so internally our ubuntu code server images are deployed under a subpath of the base url. Let’s say https://something.com/code_server/ now if I launch kedro viz it will initially respect the base url path, but when you then click on elements it replaces the subpath with https://something.com/?pipeline_id=xxx instead of http://something.com/code_server/?pipeline_id=xxx
n

Nok Lam Chan

09/22/2023, 11:57 AM
I see! I am not familiar with front-end. Is it possible to configure the sub_path similar to this? @Tynan
t

Tynan

09/22/2023, 12:18 PM
no it isn't. we need to edit the way we add our URL params to respect if there's a subpath
👍🏼 1
j

Juan Luis

09/22/2023, 2:22 PM
or you could use a reverse proxy @Jorit Studer ?
I’m not on my keyboard but I believe you can redirect a specific path to a port in Nginx easily
j

Jorit Studer

09/22/2023, 2:29 PM
Sadly these are disallowed by policy. But yes normally I definitely could. I ended up wrapping the react component with another react + vite setup then patching the node_module folder. This definitely all works, its just that supporting specifying a subpath would be good feature.
👍🏼 1
t

Tynan

09/22/2023, 2:32 PM
i think if we weren't adding query params to the URL it would work fine. we actually implemented something to ensure this works some time ago, though i think it's being overwritten by the more recent URL params feature
we'll look into it. thanks for flagging!
👍 2
m

Matthias Roels

09/22/2023, 2:43 PM
The same issue happens if you run kedro-viz from a notebook server running on a JupyterHub. Then the hub proxy proxies each user to http://something.com/user/lab/. So it is impossible to run kedro viz from a base url!
t

Tynan

09/22/2023, 2:45 PM
does it load initially, or not at all?
(databricks example) Voz should at least load initially: https://docs.kedro.org/en/stable/deployment/databricks/databricks_visualisation.html
m

Matthias Roels

09/22/2023, 6:27 PM
It actually works (sort of). But if you click on a node to see details, you get nothing. You basically have to click previous page + refresh. Then it works again
Never tried the line magic (always ran viz from a terminal window in Jupyter)
n

Nero Okwa

12/20/2023, 3:33 PM
@Matthias Roels are you still having this issue?
n

Nok Lam Chan

12/20/2023, 3:38 PM
I think the recent kedro-viz release added sub-domain support which should fix this.
👍🏽 1
m

Matthias Roels

12/20/2023, 5:06 PM
I haven’t upgraded to a more recent version so I will try once I upgraded 😀
j

Jorit Studer

12/20/2023, 5:10 PM
yes this was fixed when starting using the command line in jupyter it still wont work, i think, because you can‘t inject the the full endpoint url, we simply monkey patched this part internally
4 Views