Skip to content
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

gRPC: download only specific time point or range #8877

Open
emilk opened this issue Jan 31, 2025 · 3 comments
Open

gRPC: download only specific time point or range #8877

emilk opened this issue Jan 31, 2025 · 3 comments
Assignees
Labels
dataplatform Rerun Data Platform integration project Tracking issues for so-called "Projects"

Comments

@emilk
Copy link
Member

emilk commented Jan 31, 2025

When looking at a recording, I want to be able to send a link to a colleague pointing them at a specific time point or time range (a point of interest). This should generate a rerun:// link on a format similar to this: rerun://ip:port/store/ID?log_time=2025-01-31T02:55:20Z...2025-01-31T02:58:40Z

gRPC protocol

I suggest we implement this by doing a latest-at or range-query on the server to find all chunk IDs that the viewer would need to show the given time range, and return their IDs. A separate rpc call would be used to then fetch the chunks (rpc get_chunks(StoreId, stream ChunkId) -> stream Chunk).

There are two big advantages to this approach

  • The server doesn't have to do expensive chunk slicing (saving CPU and memory)
  • We can reuse the same rpc calls to implement larger-than-RAM (on-demand streaming)

The disadvantage is a potential waste of bandwidth (streaming parts of chunks that are outside the time range). This is mitigated by limiting the sizes of chunks during compaction.

Viewer

When opening such a URI, we also set the timeline and time cursor according to the query parameter. If it is a single time point, just use it.
If it is a range, use the start of the range, and set the loop-range to the query range, and enable looping. Also zoom the time panel so that the time range fills the width of the screen.

Image

Related issues

@emilk emilk added dataplatform Rerun Data Platform integration 👀 needs triage This issue needs to be triaged by the Rerun team labels Jan 31, 2025
@emilk emilk removed the 👀 needs triage This issue needs to be triaged by the Rerun team label Jan 31, 2025
@jprochazk
Copy link
Member

Note that RPCs in the form of

rpc F(stream Request) (Response) {}
rpc F(stream Request) (stream Response) {}

are not supported by grpc-web at the moment, so are a non-starter. The blocker on their side is general availability of the WebTransport API... which will take a while.

grtlr added a commit that referenced this issue Feb 11, 2025
### Related

* Prepares #8876.
* Does not address the `time_log` aspect: #8877

### What

This implements `rerun://` (an alias for `rerun+https://`) and
`rerun+http://`.

Please test with:
* `pixi run rerun rerun://redap.rerun.io/catalog`
* `pixi run rerun rerun+https://redap.rerun.io/catalog`
* and ideally with local Redap build `pixi run rerun
rerun+http://localhost:51234/catalog`

---------

Co-authored-by: jprochazk <[email protected]>
@emilk
Copy link
Member Author

emilk commented Feb 12, 2025

@jprochazk Can you elaborate please? What is not supported? Streaming parameters? Is there some issue or discussion you can link to?

I guess your comment is about my proposed rpc get_chunks(StoreId, stream ChunkId) -> stream Chunk, but this could just as well be a rpc get_chunk(StoreId, ChunkId) -> Chunk (which I assume grpc-web supports), so afaict this is not really blocking this issue?

@emilk emilk added the project Tracking issues for so-called "Projects" label Feb 12, 2025
@jprochazk
Copy link
Member

Issue in grpc-web: grpc/grpc-web#24

We talked about this briefly in Slack, and we can likely do something like

rpc GetChunks(StoreId, ChunkIdSet) returns (stream RerunChunk) {}

instead, to amortize protocol overhead.

zehiko added a commit that referenced this issue Feb 13, 2025
…gs (#9010)

### What

Adding support for fetching chunks that belong to specific range of the
recording. This consists of the 2 APIs calls:
* fetching chunk ids for a given range
* fetching chunks for the given chunk ids (which we might want to
leverage separately in the future)

As there is a limitation for the client side gRPC streaming on the web
(see
[here](#8877 (comment))),
we've decided to send a batch of chunk ids to the server. To make the
APIs somewhat symmetrical, the 1st API call will stream batches of chunk
ids.

Closes
* #8877
jprochazk pushed a commit that referenced this issue Feb 13, 2025
…gs (#9010)

### What

Adding support for fetching chunks that belong to specific range of the
recording. This consists of the 2 APIs calls:
* fetching chunk ids for a given range
* fetching chunks for the given chunk ids (which we might want to
leverage separately in the future)

As there is a limitation for the client side gRPC streaming on the web
(see
[here](#8877 (comment))),
we've decided to send a batch of chunk ids to the server. To make the
APIs somewhat symmetrical, the 1st API call will stream batches of chunk
ids.

Closes
* #8877
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dataplatform Rerun Data Platform integration project Tracking issues for so-called "Projects"
Projects
None yet
Development

No branches or pull requests

3 participants