MarquezProject / marquez

Collect, aggregate, and visualize a data ecosystem's metadata
https://marquezproject.ai
Apache License 2.0
1.74k stars 311 forks source link

[Marquez Web] Possible to set base path for static resources? #2793

Open devvvver opened 6 months ago

devvvver commented 6 months ago

Hi,

We are trying to get Marquez Web running behind a reverse proxy using Traefik. In essence we have the following setup:

The issue is loading the bundle.js file. When we goto ourdomain.com/marquez it loads the index.html but then it cannot load the bundle.js file because it’s requested via src=“./bundle.js” so it sends a request to ourdomain.com/bundle.js. However, it should actually include the Marquez prefix, so: ourdomain.com/marquez/bundle.js.

We can of course change the index.html so it gets the bundle.js file from marquez/bundle.js but also in the bundle.js itself there are references to static resources using a relative path. Also, this requires us to rebuild the image.

We were wondering whether it is possible to set the base path for static resources via an ENV variable or something (i.e., without having to rebuild the image)? Or is there another way to circumvent this issue that we might have overlooked?

Thanks!

boring-cyborg[bot] commented 6 months ago

Thanks for opening your first issue in the Marquez project! Please be sure to follow the issue template!

fangxingli commented 5 months ago

➕1

devvvver commented 5 months ago

Not a solution but more of a workaround. We decided to route the traffic via a subdomain instead of the path prefix. So marquez.ourdomain.com. This solves the issue regarding getting the bundle.js and the dependencies defined therein.

However, depending on your setup you have to change DNS settings etc. So I would still say that having the possibility to set a base_path or base_url could be very useful.

phixMe commented 3 months ago

Hmm, I don't quite have a setup like this, is this something somebody could possibly contribute and add to a webpack? I'd be happy to review and merge it.