SDK DataLoaders 3: barebones C and C++ support#5330
Merged
Conversation
This was referenced Feb 28, 2024
Contributor
Size changes
|
5 tasks
6439524 to
48498ce
Compare
b997a7f to
66144c4
Compare
Wumpf
reviewed
Feb 28, 2024
Member
Wumpf
left a comment
There was a problem hiding this comment.
haven't looked through the entire pr yet but to pre-empt the question: using std::string_view to pass around non-string bytes is super confusing and strange, let's not do that. I wish the obvious next thing to say was "just use array view" but that's std::span and it's C++20. So std::byte* data, size_t data_size is the way to go I fear..
bcd19c1 to
bcf4aa7
Compare
4e2bd3d to
c5ecc9c
Compare
bcf4aa7 to
9e28fc9
Compare
c5ecc9c to
cc8f15d
Compare
8 tasks
teh-cmc
added a commit
that referenced
this pull request
Feb 29, 2024
Exposes raw `DataLoader`s to the Rust SDK through 2 new methods: `RecordingStream::log_file_from_path` & `RecordingStream::log_file_from_contents`. Everything streams asynchronously, as expected. There's no way to configure the behavior of the `DataLoader` at all, yet. That comes next. ```rust rec.log_file_from_path(filepath)?; ```  This highlighted some brittleness on the shutdown path, see: - #5335 --- Part of series of PR to expose configurable `DataLoader`s to our SDKs: - #5327 - #5328 - #5330 - #5337
cc8f15d to
fc4d655
Compare
Wumpf
requested changes
Feb 29, 2024
Member
Wumpf
left a comment
There was a problem hiding this comment.
feeling fairly strongly about the api for raw bytes not using a string_view, otherwise (minus typos) lgtm
8 tasks
teh-cmc
added a commit
that referenced
this pull request
Feb 29, 2024
Exposes raw `DataLoader`s to the Python SDK through 2 new methods: `RecordingStream.log_file_from_path` & `RecordingStream.log_file_from_contents`. Everything streams asynchronously, as expected. There's no way to configure the behavior of the `DataLoader` at all, yet. That comes next. ```python rr.log_file_from_path(filepath) ```  --- Part of series of PR to expose configurable `DataLoader`s to our SDKs: - #5327 - #5328 - #5330 - #5337 - #5351 - #5355
Co-authored-by: Andreas Reich <andreas@rerun.io>
Wumpf
approved these changes
Feb 29, 2024
teh-cmc
added a commit
that referenced
this pull request
Feb 29, 2024
Introduces `RecordingStream::clone_weak`, so `DataLoader` threads started from the SDK don't prevent the recording from flushing once `main` goes out of scope, all the while making sure that `DataLoader`s run to completion.  - Mitigates #5335 --- Part of series of PR to expose configurable `DataLoader`s to our SDKs: - #5327 - #5328 - #5330 - #5337 - #5351 - #5355
teh-cmc
added a commit
that referenced
this pull request
Feb 29, 2024
Adds new `RecommendedLoadSettings` that gets passed to all `DataLoader`s -- builtin and external -- in order to customize their behaviors. This includes: - A recommended recording ID - The ID of the currently opened recording in the viewer (not implemented) - Related: #5350 - A recommended entity path prefix - A recommended timepoint ```bash cargo r -p rerun-loader-rust-file -- run_wasm/src/main.rs --recording-id this-one --entity-path-prefix a/b/c --time sim_time=1000 --time wall_time=1709204046 --sequence sim_frame=42 | rerun - ```  Checks: - [x] external loader ran manually (`loader | rerun`) - [x] external loader via rerun (`rerun xxx.rs`) - [x] log_file with external loader (`log_file xxx.rs`) --- Part of series of PR to expose configurable `DataLoader`s to our SDKs: - #5327 - #5328 - #5330 - #5337 - #5351 - #5355
8 tasks
teh-cmc
added a commit
that referenced
this pull request
Mar 1, 2024
Introduces the new `DataLoaderSettings` business to Python and update examples accordingly (`external_data_loader` & `log_file`). ```bash python examples/python/external_data_loader/main.py --recording-id this-one --entity-path-prefix a/b/c --time sim_time=1000 --time wall_time=1709204046 --sequence sim_frame=42 examples/python/dna/main.py | rerun - ```  Checks: - [x] external loader ran manually (`python loader | rerun`) - [x] external loader via rerun (`rerun xxx.py`) - [x] log_file with external loader (`log_file xxx.py`) --- Part of series of PR to expose configurable `DataLoader`s to our SDKs: - #5327 - #5328 - #5330 - #5337 - #5351 - #5355 - #5361
This was referenced Mar 4, 2024
teh-cmc
added a commit
that referenced
this pull request
Mar 4, 2024
This makes the `log_file` APIs behave more like the standard `log` APIs; i.e. they inherit the state of their associated `RecordingStream` (app_id, rec_id, timepoint, etc...). Also inherit the application ID while we're at it. Makes the API much nicer to use _and_ much more consistent with the rest. Checks: - [x] external loader ran manually (`python loader | rerun`) - [x] external loader via rerun (`rerun xxx.py`) - [x] log_file with external loader (`log_file xxx.py`) - [x] external loader ran manually (`loader | rerun`) - [x] external loader via rerun (`rerun xxx.rs`) - [x] log_file with external loader (`log_file xxx.rs`) --- Part of series of PR to expose configurable `DataLoader`s to our SDKs: - #5327 - #5328 - #5330 - #5337 - #5351 - #5355 - #5379 - #5361 - #5388 --------- Co-authored-by: Andreas Reich <andreas@rerun.io>
teh-cmc
added a commit
that referenced
this pull request
Mar 4, 2024
Introduces the new `DataLoaderSettings` business to C++ and update examples accordingly (`external_data_loader` & `log_file`). ```bash ./build/debug/examples/cpp/log_file/example_log_file --recording-id this-one --entity-path-prefix a/b/c --time sim_time=1000 --time wall_time=1709204046 --sequence sim_frame=42 rerun_cpp/tests/main.cpp | rerun - ```  Checks: - [x] external loader ran manually (`loader.exe | rerun`) - [x] external loader via rerun (`rerun xxx.cpp`) - [x] log_file with external loader (`log_file xxx.cpp`) --- Part of series of PR to expose configurable `DataLoader`s to our SDKs: - #5327 - #5328 - #5330 - #5337 - #5351 - #5355 - #5379 - #5361 - #5388
teh-cmc
added a commit
that referenced
this pull request
Mar 6, 2024
I guess that's good enough 🤷. I don't know, my brain has been completely friend by C++ non-sense all day. This includes a fix to make sure that a viewer that was spawned from the python SDK is still allowed to spawn dataloaders implemented in python (`RERUN_APP_ONLY` shenaniganeries). - Fixes #4526 --- Part of series of PR to expose configurable `DataLoader`s to our SDKs: - #5327 - #5328 - #5330 - #5337 - #5351 - #5355 - #5379 - #5361 - #5388
This was referenced Apr 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exposes raw
DataLoaders to the C++ SDK through 2 new methods:RecordingStream::log_file_from_path&RecordingStream::log_file_from_contents.Everything streams asynchronously, as expected.
There's no way to configure the behavior of the
DataLoaderat all, yet. That comes next.string_view(seerr_bytes) and related, and the internet has been unhelpful to tell e whether I should or shouldn't.Part of series of PR to expose configurable
DataLoaders to our SDKs:DataLoaders 1: barebones Rust support #5327DataLoaders 2: barebones Python support #5328DataLoaders 3: barebones C and C++ support #5330DataLoaders 4: working around shutdown brittleness #5337DataLoaders 5: customizable (external) loaders for Rust #5351DataLoaders 6: customizable (external) loaders for Python #5355Checklist
mainbuild: app.rerun.ionightlybuild: app.rerun.io