Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

abey79
Copy link
Member

@abey79 abey79 commented May 26, 2025

Related

What

This PR introduces a new ConnectionRegistry structure to hold on open redap connections and known tokens.

  • The main user dev-facing change is that RedapClient are now locally sourced from your friendly neighbourhood ConnectionRegistry. re_grpc_client::redap::client is no longer pub.
  • For the viewer, this structure is created by the entry point and passed to App. In the future, the entrypoint may pre-populate it with token passed from the CLI.
  • The Add Server model now has a token field.
  • The Python SDK's CatalogClient now has an optional token argument.
  • The REDAP_TOKEN env variable is still used, but is overridden by any user provided token.
  • The viewer persists (in clear text!) the tokens across session.

Todo

  •  dataplatfom will need a quick use fix after landing this
image

Copy link

github-actions bot commented May 26, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
6b8a1c1 https://rerun.io/viewer/pr/10078 +nightly +main

Note: This comment is updated whenever you push a commit.

@abey79 abey79 added sdk-python Python logging API 📺 re_viewer affects re_viewer itself include in changelog dataplatform Rerun Data Platform integration feat-redap-browser Everything related to the in-viewer Redap browser labels May 26, 2025
@abey79 abey79 changed the title Introduce ConnectionRegistry Introduce ConnectionRegistry for centralised redap client and token management May 26, 2025
@abey79 abey79 force-pushed the antoine/connection-registry branch from 148da13 to 1f28051 Compare May 27, 2025 14:05
app_env: &crate::AppEnvironment,
startup_options: StartupOptions,
creation_context: &eframe::CreationContext<'_>,
connection_registry: Option<ConnectionRegistry>,
Copy link
Member Author

Choose a reason for hiding this comment

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

Can we make do without that as argument, and a App::add_token(origin, token) instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is annoying because of how entrypoints.rs and streaming works. We start streaming data before creating App, this this requires a connection registry (seeded with --token). If App would create it's own registry, the following sequence would apply:

  1. create a temp registry with --token if any
  2. kick off stream with temp registry
  3. create App
  4. set the --token again on App's registry

with the added downside that App's registry doesnt inherit from the connection established by stream (not that it's a huge deal).

Also, see:

@abey79 abey79 requested a review from Wumpf May 28, 2025 08:22
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

lgtm! thanks again for the walkthrough

@abey79 abey79 merged commit 219cb92 into main May 28, 2025
39 of 40 checks passed
@abey79 abey79 deleted the antoine/connection-registry branch May 28, 2025 09:15
abey79 added a commit that referenced this pull request May 28, 2025
)

### Related

- closes https://github.com/rerun-io/dataplatform/issues/726
- closes https://github.com/rerun-io/dataplatform/issues/721
- part of https://github.com/rerun-io/dataplatform/issues/750
- part of https://github.com/rerun-io/dataplatform/issues/763
- follow-up to #10078
- DNM: chained

### What

This PR introduce the concept of "fallback token", which is essentially
the same as the `REDAP_TOKEN` env var for the purpose of the web viewer.
It is now automatically set from the enclosing notebook environment, if
that environment has `REDAP_TOKEN` set.

Thanks @jprochazk for the help 🙏🏻
abey79 added a commit that referenced this pull request May 29, 2025
### Related

- Follow up to #10078 

### What

One should not hold to a `RedapClient` for extended periods of time, as
they might need to be periodically refreshed in the future (for auth
purposes). This PR changes the SDK implementation such that it always
gets a fresh copy of the client instead of holding on to the same one
forever.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dataplatform Rerun Data Platform integration feat-redap-browser Everything related to the in-viewer Redap browser include in changelog 📺 re_viewer affects re_viewer itself sdk-python Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants