-
Notifications
You must be signed in to change notification settings - Fork 482
Make use of the new serve_web_viewer
function
#9547
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
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
Latest documentation preview deployed successfully.
Note: This comment is updated whenever you push a commit. |
serve_web_viewer
function
@rerun-bot full-check |
Started a full build: https://github.com/rerun-io/rerun/actions/runs/14338462242 |
@rerun-bot full-check |
Started a full build: https://github.com/rerun-io/rerun/actions/runs/14338984207 |
How difficult would it be for this new architecture to handle multiple servers serving to the same viewer? |
The viewer on |
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!
crates/utils/re_uri/src/origin.rs
Outdated
let mut has_port = true; | ||
{ | ||
// Parsing with a non-standard scheme | ||
// is a hack to work around the `url` crate bug | ||
// <https://github.com/servo/rust-url/issues/957>. | ||
if let Some(rest) = http_url.to_string().strip_prefix("http://") { | ||
has_port = url::Url::parse(&format!("foobarbaz://{rest}"))? | ||
.port() | ||
.is_some(); | ||
} else if let Some(rest) = http_url.to_string().strip_prefix("https://") { | ||
has_port = url::Url::parse(&format!("foobarbaz://{rest}"))? | ||
.port() | ||
.is_some(); | ||
} else { | ||
// Should not happen. | ||
}; | ||
} | ||
|
||
if !has_port { | ||
// If no port is specified, we assume the default: | ||
http_url.set_port(Some(crate::DEFAULT_PROXY_PORT)).ok(); |
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.
Wild! 🤓
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.
I might be missing something here, but maybe we should set the port based on the actual route? I.e. using 9876 for /proxy
and 51234 for /recording
and /catalog
?
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.
yes, that would be nice, but since Origin
doesn't know about that it would require more structural changes (e.g. have Origin
parse port to None
). I guess I could do an ugly search for /proxy
here though 🙈
It would be easier to just switch redap to use the same port as OSS
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.
It doesn't make sense for Origin
to even be able to produce a default port. Only RedapUri
has sufficient context for that.
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.
It would be easier to just switch redap to use the same port as OSS
It can't be on the same port until it's the same service
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.
It can't be on the same port until it's the same service
They can be the same, as long as we don't run both at the same time on the same machine
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.
as long as we don't run both at the same time on the same machine
Just to clarify, that always happens by default right now. The following:
/dataplatform $ pixi run redap-server
/rerun $ pixi run rerun rerun+http://localhost:51234
will start both a proxy server, and a catalog server. The Viewer starts the proxy server unless it's run with --connect
.
So people working on dataplatform are pretty much always running both at the same time on the same machine.
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.
It's probably because I lack the context, but I'm confused as to why this serve_web
PR changes defaults related to connecting to a remote server.
9d91a57
to
bb07517
Compare
Changes:
|
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.
lgtm, thanks!
Related
rr.serve_web_viewer
#9540serve_web_viewer
function #9469serve_web
#9541What
This makes use of the new
serve_web_viewer
function, and refers to it from docs.