Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Setup ssh tunnel in example #29

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eapolinario
Copy link
Contributor

@eapolinario eapolinario commented Feb 15, 2022

This PR introduces an ssh tunnel (by way of remote port forwarding) such that connections coming from the gradio.app end up hitting the local port where we're running the uvicorn server.

The intent behind this is for us to experiment with this kind of experience and eventually decide if we should offer this as part of mulearn.

Notice how we changed the http verb for the predict method from a get to post as the gradio proxy does not allow for get requests. This also affects the aws lambda work, so we might as well get this change in.

TODO

  • use a proper command-line parser to parse url in scripts under /requests, including bash and python.
  • modify other files under /requests
  • unit tests
  • document the use of gradio remote port forwarding using mermaid diagrams

Signed-off-by: Eduardo Apolinario eapolinario@users.noreply.github.com

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
warnings.simplefilter("ignore")
# Setup ssh tunnel used to route connections from gradio.app to localhost on the specific
# local port
share_url = networking.setup_tunnel(local_server_port=local_port, endpoint=None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

experience is still not the best?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we add, start_server, start_server_public_endpoint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, so a flag to control if we want to start a server, but what would be the use of start_server_public_endpoint? This is part of the gradio API, apparently they allow for proxy servers other than gradio.app (probably for testing or maybe segmenting by stage?). In our case we would only use the production one until we decide if we want to have this implemented on our side.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants