-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix root on gradio mounted apps #10882
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/7fe006e83dfa8da4cd41360e400886be2fc2d791/gradio-5.23.1-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@7fe006e83dfa8da4cd41360e400886be2fc2d791#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/7fe006e83dfa8da4cd41360e400886be2fc2d791/gradio-client-1.14.0.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/7fe006e83dfa8da4cd41360e400886be2fc2d791/dist/lite.js""></script> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
…into fix_root_mount
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.
Just verified the fix nice @aliabid94 ! I think we can remove the print?
Any way we could add a test for this? |
There needs to be an nginx setup for reverse proxying, which would be pretty hard :/ |
An idea: We can host a space in the gradio-test org that is an app behind nginx and then we have a flaky unit test that ensures the events work (and maybe that the css is properly loaded) by calling via the client/requests module. But I don't think we should do this until we fix most of the "cloud" related issues and can come up with the most representative "test cases" |
I like that, and perhaps we can also write a simpler unit test that runs locally that "simulates" an nginx reverse proxy using two FastAPI apps. The idea would be to have:
Then we basically see if we can make requests to localhost:8000 and see if they get completed successfully |
Ok with merging this for now though and like @freddyaboulton said, we can add the tests once we've fixed more cloud issues. |
When gradio apps are mounted on fastapi and theres a reverse proxy, the root was not correctly pointing to the mounted path of the fastapi app. Fixed now. Fixes: #8073
Test by adding this nginx config:
and this app: