-
Notifications
You must be signed in to change notification settings - Fork 111
[RELEASE NOTES + DOCS] CLI tunnel feature should use all tunnel servers #3950
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
Conversation
| use bytes::{BufMut, BytesMut}; | ||
| use http::Uri; | ||
|
|
||
| pub fn parse_tunnel_destination( |
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.
this has been copied over verbatim from the standalone tunnel client
1e271c0 to
95a234e
Compare
| futures.next().await.unwrap() | ||
| } | ||
|
|
||
| fn do_proxy( |
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.
this proxy logic is very similar to what we use in the standalone tunnel client
596158a to
fc8ff90
Compare
Test Results 5 files - 2 5 suites - 2 1m 18s ⏱️ - 1m 18s Results for commit c693d98. ± Comparison against base commit 3369991. This pull request removes 47 and adds 34 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
| } | ||
| DeploymentEndpoint::Uri(uri) if uri.scheme_str() == Some("tunnel") => { | ||
| return Err(anyhow::anyhow!( | ||
| "tunnel:// URLs are no longer supported; instead use the destination URL and --tunnel-name" |
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.
Nice!
pcholakov
left a comment
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.
Thanks @jackkleeman, this looks great! It looks this improves on HTTP version handling too.
Sorry for the slow turnaround on this!
fc8ff90 to
7a97055
Compare
7a97055 to
c693d98
Compare
Currently the CLI tunnel is a bit of a special case. It talks to only a single tunnel server eg :19082, which it is assigned randomly after first hitting 19080, and it then asks users to register a tunnel url that has a particular port, like tunnel://foo:9082 which means their restate env will hit the same tunnel server. This means that on the infra side, we have to maintain the ability for restate to hit a particular tunnel server using a port and a dns name, and this is potentially cross zone, which is not desirable. Instead, the cli should talk to all the tunnel servers (as discovered from the srv record eg
tunnel.us.restate.cloud, and the restate environment should talk to its zone local tunnel servers to try and find a connection. This behaviour matches the standalone tunnel client that people run in their clusters. In the CLI we have a slightly simplified client however, as we do not handle tunnel draining mechanism and we don't handle the srv record changing.In addition, the tunnel:// urls that map to a single local port are confusing. Instead we move to a generic local proxy approach, where you can register any url, providing
--tunnel-nameto specify that it should go through the tunnel for your environment. This will unify CLI + standalone tunnels, so that users don't have to build the tunnel url themselves.eg:
Summary of changes: