Skip to content

DataLoaders 7: support for custom DataLoaders#4566

Merged
teh-cmc merged 5 commits intomainfrom
cmc/dataloaders_7_custom
Dec 19, 2023
Merged

DataLoaders 7: support for custom DataLoaders#4566
teh-cmc merged 5 commits intomainfrom
cmc/dataloaders_7_custom

Conversation

@teh-cmc
Copy link
Copy Markdown
Contributor

@teh-cmc teh-cmc commented Dec 17, 2023

Add support for registering custom loaders, the same way we offer support for registering custom space views and store subscribers.

Checks:

  • cargo r -p custom_data_loader -- Cargo.toml

Part of a series of PRs to make it possible to load any file from the local filesystem, by any means, on web and native:

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
    • Full build: app.rerun.io
    • Partial build: app.rerun.io - Useful for quick testing when changes do not affect examples in any way
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@teh-cmc teh-cmc added 📺 re_viewer affects re_viewer itself include in changelog labels Dec 17, 2023
@teh-cmc teh-cmc changed the title DataLoaders 6: support for custom DataLoaders DataLoaders 7: support for custom DataLoaders Dec 17, 2023
@teh-cmc teh-cmc added the do-not-merge Do not merge this PR label Dec 17, 2023
@emilk emilk self-requested a review December 19, 2023 10:39
Base automatically changed from cmc/dataloaders_6_unsupported_support to main December 19, 2023 18:50
teh-cmc added a commit that referenced this pull request Dec 19, 2023
Introduce a first-class protocol for `DataLoader`s -- whether they are
builtin, custom, or external -- to announce that they don't support
loading a given piece of data.

This fixes one of the oldest issue when loading files in Rerun: loading
unsupported data would always bottom out in either the image or
websocket paths, leading to unrelated errors very confusing to users.

The loading process is now a two-pass process:
1. Dispatch the data to be loaded to all loaders, which will respond
ASAP whether they can do it or not.
1.1. If at least one compatible loader is found, go to 2
1.2. Otherwise, fail early with a nice error message for the end user
2. Dispatch the actual data loading.

This has important/subtle ramifications on the threading model, but
other than that is what you'd expect.


Checks:
- [x] Native: CLI examples/assets/*
- [x] Native: CLI examples/assets
- [x] Native: CLI examples/assets/* containing unsupported files
- [x] Native: CLI examples/assets containing unsupported files
- [x] Native: File>Open examples/assets/*
- [x] Native: File>Open examples/assets
- [x] Native: File>Open examples/assets/* containing unsupported files
- [x] Native: File>Open examples/assets containing unsupported files
- [x] Native: Drag-n-drop examples/assets/*
- [x] Native: Drag-n-drop examples/assets
- [x] Native: Drag-n-drop examples/assets/* containing unsupported files
- [x] Native: Drag-n-drop examples/assets containing unsupported files
- [x] Web: File>Open examples/assets/*
- [x] Web: Drag-n-drop examples/assets/*
- [x] Web: File>Open examples/assets/* containing unsupported files
- [x] Web: Drag-n-drop examples/assets/* containing unsupported files



---

Part of a series of PRs to make it possible to load _any_ file from the
local filesystem, by any means, on web and native:
- #4516
- #4517 
- #4518 
- #4519 
- #4520 
- #4521 
- #4565
- #4566
- #4567
@teh-cmc teh-cmc force-pushed the cmc/dataloaders_7_custom branch from 6ed7787 to a3516ee Compare December 19, 2023 18:52
@teh-cmc teh-cmc removed the do-not-merge Do not merge this PR label Dec 19, 2023
@teh-cmc teh-cmc merged commit 47bec77 into main Dec 19, 2023
@teh-cmc teh-cmc deleted the cmc/dataloaders_7_custom branch December 19, 2023 19:00
teh-cmc added a commit that referenced this pull request Dec 22, 2023
Some docs for the whole thing.

It heavily relies on linking to the examples for exact details and to
avoid rot.

It's probably extremely bad. Help welcome.


---

Part of a series of PRs to make it possible to load _any_ file from the
local filesystem, by any means, on web and native:
- #4516
- #4517 
- #4518 
- #4519 
- #4520 
- #4521 
- #4565
- #4566
- #4567

Co-authored-by: Nikolaus West <niko@rerun.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants