Skip to content
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

Conbench UI breaks when deployed at non-root web path #1575

Open
DeaMariaLeon opened this issue Jan 17, 2024 · 6 comments
Open

Conbench UI breaks when deployed at non-root web path #1575

DeaMariaLeon opened this issue Jan 17, 2024 · 6 comments
Labels
UI/UX issues related to UI and UX

Comments

@DeaMariaLeon
Copy link
Contributor

DeaMariaLeon commented Jan 17, 2024

Hello,

I need to link the server where I set up conbench PoC for pandas, to pandas' website.

On the server where conbench is installed, all the links and styles work: http://57.128.112.95:5000/

Screenshot 2024-01-17 at 13 59 03

But if I try to link that to pandas' website: https://pandas.pydata.org/benchmarks/conbench/
The links for the runs are broken, and there is no css.

Screenshot 2024-01-17 at 14 00 46

I tried to fix that by setting the following on docker-compose.yml:
CONBENCH_INTENDED_BASE_URL: https://pandas.pydata.org/benchmarks/conbench/

But nothing changed.

On the server I'm using a "local" setup (no production deployment yet).
So I have:
CONBENCH_URL=http://0.0.0.0:5000 in an env variables file.

And on Makefile:

.PHONY: run-app
run-app: set-build-info
	export DCOMP_CONBENCH_HOST_PORT=0.0.0.0:5000 && \
		docker compose down && docker compose up --build

Would you have an idea? Thanks in advance.
Edit: clicking on the first run goes to here, which gives a 404:
https://pandas.pydata.org/runs/4d1d08bf206440baa92d5a52eab9926b/

But manually entering the following, it works!:
https://pandas.pydata.org/benchmarks/conbench/runs/4d1d08bf206440baa92d5a52eab9926b/

@DeaMariaLeon
Copy link
Contributor Author

DeaMariaLeon commented Jan 18, 2024

So CONBENCH_INTENDED_BASE_URL becomes INTENDED_BASE_URL, but then I fail to locate this variable anywhere else in the code.
There is this line, that looks like a base url should be used, but it's not:
https://github.com/conbench/conbench/blob/main/conbench/__init__.py#L147C5-L147C58

My next question is, where should I add a url_suffix?

edit: I don't think this is a bug.. but still working on this. Sorry for the garbage.

@DeaMariaLeon DeaMariaLeon changed the title Question about CONBENCH_INTENDED_BASE_URL Bug with CONBENCH_INTENDED_BASE_URL ? Jan 18, 2024
@jgehrcke
Copy link
Member

jgehrcke commented Jan 22, 2024

Hey!

The HTML source contains e.g. <link href="/static/app.css" ... which in your case resolves to https://pandas.pydata.org/static/app.css (which does not exist).

You try to deploy under a non-root web path. Clarification:

  • https://pandas.pydata.org/ would be root
  • https://pandas.pydata.org/benchmarks/conbench/ is non-root

We did not build (test, qualify) for deploying the Conbench web application at a non-root path yet.

Supporting this use case is typical for web applications, but it's also complexity that needs to be built and tested properly. We have punted on that so far, and you find the outfall. Sorry for that (and also for the lack in docs making it clear what CONBENCH_INTENDED_BASE_URL is doing and not doing) ! :)

I have adjusted the title of the issue to reflect the problem a little better.

@jgehrcke jgehrcke changed the title Bug with CONBENCH_INTENDED_BASE_URL ? Conbench UI breaks when deployed at non-root web path Jan 22, 2024
@jgehrcke jgehrcke added the UI/UX issues related to UI and UX label Jan 22, 2024
@DeaMariaLeon
Copy link
Contributor Author

Thanks a lot @jgehrcke for your reply. I will be working on this, as the link to my converter has already been added to pandas website.

If I understand correctly, I could add a reverse proxy like nginx to my setup. Then I need to "tell" Flask about it. After that, I can add a pre-fix.
I have to try it, does it sound logical to you?

@jgehrcke
Copy link
Member

jgehrcke commented Jan 22, 2024

I could add a reverse proxy like nginx to my setup.

Using a reverse proxy (with smart URL re-writing) is one of the traditional approaches to (try to) make a naive web application work on a non-root path! :) yes!

But it could be that this isn't quite enough. URLs (absolute or relative) that the web application generates need to after all be cooperative/supportive of the deployment approach; and here it may break down one way or another. The /static/app.css problem may be just one of many. I wish we could support you in this endeavor; will have to see about that and talk to people!

@DeaMariaLeon
Copy link
Contributor Author

Thank you. This will have to wait then.
Since it is a PoC, I used the "local" version - I didn't know that this was going to be needed actually.
Anyway, at least I removed the "test" mode. :)

BTW, I added an alert by email to avoid depending/passing through GitHub.
I haven't added tests to it (with pytest), but maybe I can contribute with it if that interests people.

@austin3dickey
Copy link
Member

but maybe I can contribute with it if that interests people

Sure, we'd always welcome a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI/UX issues related to UI and UX
Projects
None yet
Development

No branches or pull requests

3 participants