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

Split viewer binary out from python_bridge.so #5196

Closed
jleibs opened this issue Feb 14, 2024 · 0 comments · Fixed by #5996
Closed

Split viewer binary out from python_bridge.so #5196

jleibs opened this issue Feb 14, 2024 · 0 comments · Fixed by #5996
Assignees
Labels
enhancement New feature or request 🐍 Python API Python logging API

Comments

@jleibs
Copy link
Member

jleibs commented Feb 14, 2024

Context

We currently package the entire viewer within the rerun_bindings.so library.

When we run the viewer from the CLI, the python process imports this library and then invokes a method on it that spawns the viewer.

While this has been convenient for packaging, only requiring users to have a single library, it leads to several issues:

Proposal

Make the python library act more like C++/rust by spawning an external executable.

Since we already have builds for a standalone rerun-cli executable, ideally we should modify the rerun python package to use this same artifact and (optionally?) pack it into the python wheel at a known location.

Unlike C++/Rust where we run whichever executable we find on the path, we could include functionality in python to specifically spawn the packaged executable.

@jleibs jleibs added enhancement New feature or request 🐍 Python API Python logging API labels Feb 14, 2024
@jleibs jleibs self-assigned this Apr 15, 2024
jleibs added a commit that referenced this issue Apr 18, 2024
### What

- Resolves: #5196

- Move `rerun_py` over to a dependency on `re_sdk` instead of `rerun`
- Modify the pyproject / build script to look for a bin/rerun in the
python project.
- Update the launch/spawn scripts to use the embedded copy of the
`rerun` executable.
- Spawn now dispatches through the SDK the same way as cpp / rust.
- When executed inside the editable dev environment, use the copy of
`rerun` from `target/debug`
- Build and upload a copy of rerun-cli to embed into the wheel during PR
builds.

- [x] Verify wheels build correctly on nightly

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/5996?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/5996?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5996)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.

---------

Co-authored-by: Andreas Reich <[email protected]>
Co-authored-by: Emil Ernerfeldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant