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

Generate an RRD file during the build which we inject into the wheel #1087

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Feb 3, 2023

Builds on top of: #1085 which will need to be landed first

We want it to be easy to spawn a rerun instance with some rich data with no other dependency on checking out the examples repo, etc.

The rrd file is a reasonable and portable mechanism of packing this data. Given that RRD files change over time, we don't want to check it into the repo, but instead generate it and inject it into the package at build time.

This PR also adds a new package rerun_demo, similar to the rerun/main.py which instead spawns the viewer with the path to the rrd file.

After pip installing the rerun package you can run the demo with:

python -m rerun_demo

As long as the package was built with the injected rrd file it will spawn the viewer. Otherwise you'll get an error

No demo file found at /home/jleibs/venv/lib/python3.10/site-packages/rerun_sdk/rerun_demo/demo.rrd. Package was built without demo support

image

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I've added a line to CHANGELOG.md (if this is a big enough change to warrant it)

@jleibs jleibs force-pushed the jleibs/rerun_demo_rrd branch 2 times, most recently from bdff221 to 1540ba0 Compare February 3, 2023 23:11
@jleibs jleibs changed the base branch from main to jleibs/maturin_path2 February 3, 2023 23:21
@jleibs jleibs marked this pull request as ready for review February 3, 2023 23:55
Base automatically changed from jleibs/maturin_path2 to main February 5, 2023 04:20
Comment on lines +60 to +86
- name: Cache APT Packages
#uses: awalsh128/cache-apt-pkgs-action@v1.2.2
#TODO(john) merge upstream
uses: rerun-io/cache-apt-pkgs-action@59534850182063abf1b2c11bb3686722a12a8397
with:
packages: libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libfontconfig1-dev libatk-bridge2.0 libfreetype6-dev libglib2.0-dev
version: 1.0
execute_install_scripts: true

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
env-vars: CARGO CC CFLAGS CXX CMAKE RUST CACHE_KEY
# See: https://github.com/rerun-io/rerun/pull/497
save-if: ${{ github.event_name == 'push'}}

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
cache: "pip"
cache-dependency-path: "rerun_py/requirements-build.txt"

- name: Build and install rerun
run: |
pip install rerun_py/
Copy link
Contributor

Choose a reason for hiding this comment

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

I would swap this with a download of the previously-built wheel to avoid re-installing and re-building everything.

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a chicken-and-egg problem here -- there is't a previously built wheel. The wheels need to be built after this because we want to be able to use this artifact to inject into the wheel.

https://github.com/rerun-io/rerun/actions/runs/4088811222

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah of course.

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need this yet, but an improvement (reduction in duplicate CI effort) will be to reduce the "generate .rrd" to entirely Rust so we can cut all the Python out of this job.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great idea.

@jleibs jleibs merged commit 878c6bb into main Feb 7, 2023
@jleibs jleibs deleted the jleibs/rerun_demo_rrd branch February 7, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants