Skip to content

Commit

Permalink
Merge upstream (#10)
Browse files Browse the repository at this point in the history
* `arrow2_convert` primitive (de)serialization benchmarks (rerun-io#1742)

* arrow2_convert primitive benchmarks

* addressing PR comments

* Fix logged obb being displayed with half of the requested size (rerun-io#1749)

* benchmarks for common vector ops across `smallvec`/`tinyvec`/std (rerun-io#1747)

* benchmarks for common vector ops

* handle N=1

* Tracked 3D cameras lead now to on-hover rays in other space views that show the same camera but don't track it. (rerun-io#1751)

In the same way as a 2D scene causes a on-hover ray in all space views that contain the space camera at which the 2D view "sits".

* Improve dealing with raw buffers for texture read/write (rerun-io#1744)

* Replace TextureRowDataInfo with the more versatile Texture2DBufferInfo

* comment & naming fixes

* `arrow2` erased refcounted clones benchmarks (rerun-io#1745)

* arrow2 erased refcounted clone benchmarks

* lint

* addressing PR comments

* dude

* `arrow2` estimated_bytes_size benchmarks (rerun-io#1743)

* arrow2 estimated_bytes_size benchmarks

* cleanup

* Fix crash when trying to do picking on depth clouds

* Readback depth from GPU picking (rerun-io#1752)

* gpu picking in the viewer picks up depth now
* WebGL workarounds

* Add new ARKitScenes example (rerun-io#1538)

Co-authored-by: Nikolaus West <[email protected]>
Co-authored-by: Emil Ernerfeldt <[email protected]>

* Fix log_obb usage (rerun-io#1761)

* Make sure all log_obb uses uses half_size correctly

* Remove outdated link from README

* Fix docstring of save

* Force named arguments of log_scalar

* Add link to --memory-limit docs

* update ros example

* Python SDK: document that we also accept colors in 0-1 floats (rerun-io#1740)

* Python SDK: document that we also accept colors in 0-1 floats

* Assume float colors to be in gamma-space, and document that

* Update arkitscenes example

* Fix bug

* typo

* py-format

* Collapse space-view by default if there is only one child (rerun-io#1762)

* Always create the log_time timeline (rerun-io#1763)

* Columnar timepoints in data tables and during transport (rerun-io#1767)

* columnar timepoints

* self review

* Fix undo/redo selection shortcut/action changing selection history without changing selection (rerun-io#1765)

* Fix undo/redo selection shortcut/action changing selection history without changing selection
Fixes rerun-io#1172

* typo fix

* Don't initialize an SDK session if we are only going to be launching the app (rerun-io#1768)

* Allow torch tensors for log_rigid3 (rerun-io#1769)

* Option to show scene bounding box (rerun-io#1770)

* Include depth clouds in bounding box calculation

* Don't wrap text when showing bbox in ui

* Handle projective transforms

* Nicer selection view: don't wrap second column too early

* Add checkbox to show the scene bounding box

* Fix a whole lot of crashes, all at once (rerun-io#1780)

* Add typing_extensions to requirements-doc.txt (rerun-io#1786)

* auto_color class-ids if they are present (rerun-io#1783)

* auto_color class-ids if they are present

* Update log line in segmentation demo

* Avoid tuple structs

* Don't run 3rd party bench suites on CI (rerun-io#1787)

* dont run 3rd party bench suites on CI

* typo

* and other annoyances

* Use copilot markers in PR template (rerun-io#1784)

* Use copilot markers in PR template

* remove poem

Co-authored-by: Clement Rey <[email protected]>

---------

Co-authored-by: Clement Rey <[email protected]>

* re_format: barebone support for custom formatting (rerun-io#1776)

* implement barebone support for custom formatting and apply to Tuid

* unwrap

* <ERR> rather than []

* use re_tuid

* Always send recording_id as part of LogMsg (rerun-io#1778)

* Always send recording_id as part of LogMsg

* Rename build_chunk_from_components -> build_data_table_from_components

* Don't make RecordingInfo optional

* Always default the recording id

* Log an error if we hit the initialization issue

* Refactor: Add new helper crate `re_log_encoding` (rerun-io#1772)

* CI: Check `rerun` with --no-default features and/or with --features sdk

* Create a new helper crate re_transport containing stream_rrd_from_http

* Fix warnings

* Move file sink to re_transport

* wasm compilation fix

* Move LogMsg encoding/decoding into re_transport

* Fix typo

* Fix web build

* Fix tests

* Remove a lot of unused dependencies with `cargo machete`

* Build fix

* Clarify

* Rename the crate to re_log_encoding

* better docstring

Co-authored-by: Jeremy Leibs <[email protected]>

* better readme

Co-authored-by: Jeremy Leibs <[email protected]>

---------

Co-authored-by: Jeremy Leibs <[email protected]>

* New example code for facebook research segment anything (rerun-io#1788)

* New example code for facebook research segment anything

* Add segmentation workaround for users still on 0.4.0

* Images should use class-id as label

* Add an alternative tensor-based view

* Implement `re_tuid::Tuid::random()` on web (rerun-io#1796)

* Implement `re_tuid::Tuid::random()` on web

* Fix bad error message

* ci: fix benchmarks (rerun-io#1799)

* workflow: just run --all

* datastore: skip bucket permutations etc on CI

* i give up, just replace re_log_types by re_log_encoding

* Add `minimal_options` example (`RerunArgs`) (rerun-io#1773)

* Allows connecting to remote server through rerun's RerunArgs.

Co-authored-by: Clement Rey <[email protected]>

* Add `pacman` support to `setup_web.sh` (rerun-io#1797)

Co-authored-by: Clement Rey <[email protected]>

* fix ci (cargo-deny): cargo update -p crossbeam-channel (rerun-io#1806)

* Compile with `panic = "abort"` (rerun-io#1813)

* Compile with `panic = "abort"`

This PR sets `panic = "abort"` for both debug and release builds.

This cuts down the `rerun` binary size in release builds from
29.9 MB to 22.7 MB - a 25% reduction!

## Details
The default panic behavior in Rust is to unwind the stack.
This leads to a lot of extra code bloat, and some missed
opportunities for optimization.

The benefit is that one can let a thread die without crashing the whole
application, and one can use `std::panic::catch_unwind` as a kind of
try-catch block.

We don't make use of these features at all (at least not intentionally),
and so are paying a cost for something we don't need.

I would also argue that a panic SHOULD lead to a hard crash unless
you are building an Erlang-like robust actor system where you use
defensive programming to protect against programmer errors
(all panics are programmer errors - user errors should use `Result`).

* Quiet clippy

* Add `rerun --strict`: crash if any warning or error is logged (rerun-io#1812)

* Add `rerun --strict`: crash if any warning or error is logged

Part of rerun-io#1483

* Can't doc-test private functions

* Refactor: Remove `TensorTrait` (rerun-io#1819)

* Refactor: Remove `TensorTrait`

We don't need it anymore

* End-to-end testing of python logging -> store ingestion (rerun-io#1817)

* Sort the arguments to `rerun`

* Pass on `LogMsg::Goodbye` just like any other message

* Add `rerun --test-receive`

* `just py-build --quiet` is now possible

* Add scripts/run_python_e2e_test.py

* replace `cargo r -p rerun` with `python3 -m rerun`

* lint and explain choice of examples

* Add to CI

* check returncode

* Fix e2e test on CI: Don't try to re-build rerun-sdk (rerun-io#1821)

* Use gpu picking for points, streamline/share picking code some more (rerun-io#1814)

* use gpu picking for picking points
* gpu based picking no longer works like a fallback but integrates with other picking sources
* fix incorrect cursor rounding for picking
* refactor picking context to be a pub struct with exposed state
* unify ui picking method for 2d & 3d space views
* less indentation for picking method
* picking rect size is dynamically chosen
* fix accidental z scaling in projection correction for picking & make cropped_projection_from_projection easier to read

* CI: install pip requirements for Python e2e test

* Process 2d points always in batches (rerun-io#1820)

* Fix CI syntax error

* New option to disable persistent storage (rerun-io#1825)

* New option to disable persistent storage

* New API to reset_time (rerun-io#1826)

* Datastore revamp 1: new indexing model & core datastructures (rerun-io#1727)

* Datastore revamp 2: serialization & formatting (rerun-io#1735)

* Datastore revamp 3: efficient incremental stats (rerun-io#1739)

* Datastore revamp 4: sunset `MsgId` (rerun-io#1785)

* Datastore revamp 5: (rerun-io#1791)

* Datastore revamp 6: sunset `LogMsg` storage + save store to disk (rerun-io#1795)

* Datastore revamp 7: garbage collection (rerun-io#1801)

* Don't assert if inserting a rowid with a matching timepoint does not create a conflict (rerun-io#1832)

* CI: Try installing the correct wheel on CI

* CI: try again with the CI

* re_query: up to date with latest data types and structures (rerun-io#1828)

* No more raw arrays for primary components

* Don't need to carry around component names no more

* Cluster keys are now raw-array-less and _not_ optional anymore

* that is done indeed

* helpers

* datastore: incremental metadata registry stats (rerun-io#1833)

* add profile scopes for stats

* implement incremental metadata registry stats

* lint

* future proofing comment

* RFC: datastore state of the union & end-to-end batching  (rerun-io#1610)

* add batching rfc

* Update design/batching.md

Co-authored-by: Emil Ernerfeldt <[email protected]>

* Update design/batching.md

Co-authored-by: Emil Ernerfeldt <[email protected]>

* Update design/batching.md

Co-authored-by: Emil Ernerfeldt <[email protected]>

* Update design/batching.md

Co-authored-by: Emil Ernerfeldt <[email protected]>

* qa component instances vs. instance keys

* no sticky

* qa are there any special components & non-integer instance keys

* give some clue about cell incompatibility

* temporary constructs

* zstd is already setup

* more planning

* date and links

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>

* Python CI: use bash as shell

* Fix too many points crash (rerun-io#1822)

* Simplify point cloud builder and fix crash on too many points
Fixes rerun-io#1779
* faster point cloud population by not chaining iterators with default values

* Use GPU picking for line(like) primitives, fix `interactive` flags (rerun-io#1829)

* line strip builder no longer has user data, exposes picking id instead (not implemented yet)
* handle interactive object property when evaluating picking code
* take line strip builder directly when building up line draw data
* finish implementing picking for lines
* remove unused iter_strips_with_vertices
* Simplify picking handling now that there are a lot less types. Labels & textured rects are always picked now, fixes rerun-io#1021

* CI: try to fix mac wheel build

* Reduce memory used by staging belts on Web (rerun-io#1836)

In particular this prevents crashing with out of memory on a run-away belt memory usage caused by failure to unmap buffers. A bit concerningly, the fix uses our knowledge of how `wgpu::Device::poll` is broken in the current wgpu version.

I took the opportunity to sharpens the definition of `HardwareTier` a bit.

* CI: only test the x86_64 wheel on macos

* Always flush when we remove a sink (rerun-io#1830)

Whenever we disconnect (or implicitly disconnect by swapping a sink) we should flush the pending messages. Additionally disconnect and flush calls both require releasing the GIL (for the same reason as shutdown previously).

* GPU colormapping, first step (rerun-io#1835)

* Add TextureManager2D::get_or_create_with

* Small code cleanup

* Add code to upload a Tensor to a GPU texture

* Add helper method Tensor::image_height_width_depth

* Minor code cleanup (multiplicative_tint)

* Hook up color textures via the new path

* Refactor: introduce ColormappedTexture

* Start working on an uint sampler

* merge fix

* Dumb colormapping of depth textures!

* Use turbo for depth maps (and single-channel images :grimace:)

* Use grayscale for luminance

* ColorMap -> Colormap

* Apply annotation context colormaps

* Support sint textures too

* cleanup

* merge fix

* Fix RGB images

* More cleanup

* Better error-handlign and nicer error message

* Clean up the SAMPLE_TYPE with constants

* Nicer shader interface

* Better error handling

* Remove dead code

* Self-review cleanup

* Fix bug in shader when sampling sint textures

* Use textureSampleLevel

* Apply a gamma to the image (unused as of now)

* image_height_width_channels

* fix various review comments

* Optimize narrow_f64_to_f32s: avoid one allocation

* Test and handle all tensor dtypes as images (rerun-io#1840)

* Support i64 and u64 tensors

* api_demo: log all image types

* Don't even print out the contents of a tensor

* Handle unfilterable float textures

* fix typo

* py-format

* Simplify is_float_filterable

* Add a helper function pad_and_narrow_and_cast

* Reuse existing image

* Exclude image_tensors demo from default api_demo

* Still run all api demos in e2e test

* pyformat

* Install the rerun-sdk in CI using --no-index and split out linux wheel build to run first. (rerun-io#1838)

* Install the rerun-sdk by the expected version

* Fix comment

* typo

* Use --no-index when installing the rerun wheel

* Use the cargo_version, not the new_version

* Split dependency install into its own step

* Don't use force-reinstall

* Refactor setting of expected_version variable.

* Use bash when setting env

* Always run the linux job first and use its rrds for the other wheels

* GPU tensor colormapping (rerun-io#1841)

* Refactor: introduce struct SliceSelection

* Refactor: use SliceSelection inside of ViewTensorState

* MVP of tensor colormapping on GPU

* Remove old ui code

* Support 64-bit tensors by narrowing to f32

* Allow more colormap options

* Clippy

* Report range errors instead of ignoring them

* Sort colormaps

* Shorten function name

* Create module gpu_bridge

* Move some code around

* Simnplify API

* Create ViewBuilder::new

* Fix missing colon in lint.py

* fix typos and formatting

* Disable texture filtering options for tensors for now

* Update docstrings

* Add profile scopes

* ViewBuilder cleanup

* Make ViewBuilder::setup non-Option

* Remove Result from thing that cannot fail

* Fix colormap numbering

* review cleanup

* pass in debug_name

* Unify the `range` function

* typo

* Show previews of colormaps when selecting them (rerun-io#1846)

* Make infallible version of get_or_create_texture

* Show colormap previews in UI

* Spelling

* Implement billinear filtering of textures (rerun-io#1850)

* Implement opt-in billinear filtering of textures

* bilinear

* MVP Support for inline-rendering of Rerun within jupyter notebooks (rerun-io#1798) (rerun-io#1834) (rerun-io#1844)

* Introduce the ability to push an rrd binary via iframe.contentWindow.postMessage
* New API to output the current buffered messages as a cell in jupyter
* Example notebook with the cube demo
* Track that we need to send another recording msg after draining the backlog
* Dynamically resolve the app location based on git commit. Allow override to use self-hosted assets
* Add some crude timeout logic in case the iframe fails to load
* Don't persist app state in notebooks
* Introduce new MemoryRecording for use with Jupyter notebooks (rerun-io#1834)
* Refactor the relationship between the assorted web / websocket servers (rerun-io#1844)
* Rename RemoteViewerServer to WebViewerSink
* CLI arguments for specifying ports
* Proper typing for the ports

* Disable wheel tests for x86_64-apple-darwin (rerun-io#1853)

* Fix typos in notebook readme (rerun-io#1852)

* Fix the python build when running without web_viewer enabled (rerun-io#1856)

* Error instead of expect inside msg_encode. (rerun-io#1857)

* Restore: New API to reset_time (rerun-io#1826) (rerun-io#1854)

* Revert "Implement billinear filtering of textures (rerun-io#1850)" (rerun-io#1859)

This reverts commit d33dab6.

* Add Restart command and keyboard shortcut for moving time to start of timeline (rerun-io#1802)

* Add Restart button to timeline UI. This sets the timeline back to zero.

* Adds Restart Command & Timeline Command

* Adds Ctrl-Shift-Space keyboard modifier

* Remove restart button from timeline UI.

* Use cmd(Key::LeftArrow) as key combo for restart timeline.

* Add TimeControl::restart to restart the current timeline.

* Use this from the kb_shortcut function

* fix some code nits

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>

* Fix shutdown race condition in `re_sdk_comms` client (rerun-io#1861)

* Wait for encoder to shut down before shutting down the other threads

* Remove unused dependencies (rerun-io#1863)

* Gpu picking for depth clouds (rerun-io#1849)

* wip

* allow for hovering depth clouds via gpu picking

* Use `[x, y]: [u32; 2]` as argument

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>

* Remove manual depth projection from car and nyud examples (rerun-io#1869)

* Remove manual depth projection from car and nyud examples

* revert change to cube.ipynb

* revert changes to cube.ipynb

* third times a charm for cube.ipynb

* Improve end-to-end testing slightly (rerun-io#1862)

* CI: Run e2e tests with RUST_LOG=debug

* Move installing of pip packaged from CI to e2e script

* Re-enable bilinear interpolation again (rerun-io#1860)

* Revert "Revert "Implement billinear filtering of textures (rerun-io#1850)" (rerun-io#1859)"

This reverts commit 625d2bd.

* Split rectangle.wgsl into fragme/vertex parts to work around naga bug

* Use GPU colormapping when showing images in the GUI (rerun-io#1865)

* Cleanup: move Default close to the struct definition

* Simplify code: use if-let-else-return

* Simplify code: no need for Arc

* Add EntityDataUi so that the Tensor ui function knows entity path

* Better naming: selection -> item

* Simplify code: no optional tensor stats

* Less use of anyhow

* Use GPU colormapping when showing tensors in GUI

* Link to issue

* Optimize pad_to_four_elements for debug builds

* Refactor: simpler arguments to show_zoomed_image_region_area_outline

* Fix missing meter argument

* Refactor: break up long function

* Less use of Arc

* Pipe annotation context to the hover preview

* Simplify `AnnotationMap::find`

* Use new GPU colormapper for the hover-zoom-in tooltip

* Refactor

* Add helper function for turning a Tensor into an image::DynamicImage

* Fix warning on web builds

* Add helper function `Tensor::could_be_dynamic_image`

* Implement click-to-copy and click-to-save for tensors without egui

* Convert histogram to the new system

* Remove the TensorImageCache

* Fix TODO formatting

* bug fixes and cleanups

* Rename some stuff

* Build-fix

* Simplify some code

* Turn off benchmakrs comment on each PR (rerun-io#1872)

* Refactor: remove `GpuTexture2DHandle::invalid` (rerun-io#1866)

* Refactor TexturedRect

* Remove GpuTexture2DHandle::invalid

* `GpuTexture2DHandle` is always valid

* spacing

* Update enumflags2 to non-yanked version (rerun-io#1874)

* Update enumflags2 to non-yanked version
```
❯ cargo update -p enumflags2
    Updating crates.io index
    Updating enumflags2 v0.7.5 -> v0.7.7
    Updating enumflags2_derive v0.7.4 -> v0.7.7
    Updating proc-macro2 v1.0.47 -> v1.0.56
    Updating quote v1.0.21 -> v1.0.26
      Adding syn v2.0.15
```

Unfortunately this adds the syn v2 dependency for some platforms

* Updating dependencies is a valid label
* cargo deny: check more platforms

* fix stuff broken from merging upstream

---------

Co-authored-by: Clement Rey <[email protected]>
Co-authored-by: benjamin de charmoy <[email protected]>
Co-authored-by: Andreas Reich <[email protected]>
Co-authored-by: Emil Ernerfeldt <[email protected]>
Co-authored-by: Pablo Vela <[email protected]>
Co-authored-by: Nikolaus West <[email protected]>
Co-authored-by: Jeremy Leibs <[email protected]>
Co-authored-by: h3mosphere <[email protected]>
Co-authored-by: Urho Laukkarinen <[email protected]>
  • Loading branch information
10 people authored Apr 17, 2023
1 parent d0ab33d commit c0886c6
Show file tree
Hide file tree
Showing 263 changed files with 15,742 additions and 9,679 deletions.
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### WHAT
copilot:summary

### WHY
<!-- author to complete -->

### HOW
copilot:walkthrough

### Checklist
* [ ] 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)
* [ ] I've included a screenshot or gif (if applicable)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
with:
mode: minimum
count: 1
labels: "📊 analytics, 🪳 bug, 🧑‍💻 dev experience, 📖 documentation, 💬 discussion, examples, 📉 performance, 🐍 python API, ⛃ re_datastore, 📺 re_viewer, 🔺 re_renderer, ⛴ release, 🦀 rust SDK, 🔨 testing, ui, 🕸️ web"
labels: "📊 analytics, 🪳 bug, 🧑‍💻 dev experience, dependencies, 📖 documentation, 💬 discussion, examples, 📉 performance, 🐍 python API, ⛃ re_datastore, 📺 re_viewer, 🔺 re_renderer, 🚜 refactor, ⛴ release, 🦀 rust SDK, 🔨 testing, ui, 🕸️ web"
236 changes: 196 additions & 40 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,159 @@ jobs:
just py-requirements
# ---------------------------------------------------------------------------
# We need one wheel-build to be special so the other builds (namely mac arm) can use its rrd
# This copy-paste is awful, but we'll refactor the build soon.
wheels-linux:
if: github.event_name == 'push' || github.event.inputs.force_build_wheel
name: Build Python Wheels (Linux)
runs-on: ubuntu-latest
container:
image: rerunio/ci_docker:0.6
steps:
- uses: actions/checkout@v3

# These should already be in the docker container, but run for good measure. A no-op install
# should be fast, and this way things don't break if we add new packages without rebuilding
# docker
- name: Cache APT Packages
uses: awalsh128/[email protected]
with:
packages: ${{ env.UBUNTU_REQUIRED_PKGS }}
version: 2.0 # Increment this to pull newer packages
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
# Don't update the cache -- it will be updated by the lint job
# TODO(jleibs): this job will likely run before rust.yml updates
# the cache. Better cross-job sequencing would be nice here
save-if: False

# These should already be in the docker container, but run for good measure. A no-op install
# should be fast, and this way things don't break if we add new packages without rebuilding
# docker
- run: pip install -r rerun_py/requirements-build.txt

# ----------------------------------------------------------------------------------

- name: Patch Cargo.toml for pre-release
if: github.ref == 'refs/heads/main'
# After patching the pre-release version, run cargo update.
# This updates the cargo.lock file with the new version numbers and keeps the wheel build from failing
run: |
python3 scripts/version_util.py --patch_prerelease
cargo update -w
- name: Version check for tagged-release
if: startsWith(github.ref, 'refs/tags/v')
# This call to version_util.py will assert version from Cargo.toml matches git tagged version vX.Y.Z
run: |
python3 scripts/version_util.py --check_version
- name: Store the expected version
# Find the current cargo version and store it in the GITHUB_ENV var: `expected_version`
shell: bash
run: |
echo "expected_version=$(python3 scripts/version_util.py --bare_cargo_version)" >> $GITHUB_ENV
- name: Build Wheel
uses: PyO3/maturin-action@v1
with:
maturin-version: "0.14.10"
manylinux: manylinux_2_31
container: off
command: build
args: |
--manifest-path rerun_py/Cargo.toml
--release
--target x86_64-unknown-linux-gnu
--no-default-features
--features pypi
--out pre-dist
- name: Install wheel dependencies
# First we install the dependencies manually so we can use `--no-index` when installing the wheel.
# This needs to be a separate step for some reason or the following step fails
# TODO(jleibs): pull these deps from pyproject.toml
# TODO(jleibs): understand why deps can't be installed in the same step as the wheel
shell: bash
run: |
pip install deprecated numpy>=1.23 pyarrow==10.0.1
- name: Install built wheel
# Now install the wheel using a specific version and --no-index to guarantee we get the version from
# the pre-dist folder. Note we don't use --force-reinstall here because --no-index means it wouldn't
# find the dependencies to reinstall them.
shell: bash
run: |
pip uninstall rerun-sdk
pip install rerun-sdk==${{ env.expected_version }} --no-index --find-links pre-dist
- name: Verify built wheel version
shell: bash
run: |
python3 -m rerun --version
which rerun
rerun --version
- name: Run unit tests
shell: bash
run: cd rerun_py/tests && pytest

- name: Run e2e test
shell: bash
run: RUST_LOG=debug scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed

- name: Unpack the wheel
shell: bash
run: |
mkdir unpack-dist
wheel unpack pre-dist/*.whl --dest unpack-dist
- name: Get the folder name
shell: bash
run: |
echo "pkg_folder=$(ls unpack-dist)" >> $GITHUB_ENV
- name: Cache RRD dataset
id: dataset
uses: actions/cache@v3
with:
path: examples/python/colmap/dataset/
# TODO(jleibs): Derive this key from the invocation below
key: colmap-dataset-colmap-fiat-v0

- name: Generate Embedded RRD file
shell: bash
# If you change the line below you should almost definitely change the `key:` line above by giving it a new, unique name
run: |
mkdir rrd
pip install -r examples/python/colmap/requirements.txt
python3 examples/python/colmap/main.py --dataset colmap_fiat --resize 800x600 --save rrd/colmap_fiat.rrd
cp rrd/colmap_fiat.rrd unpack-dist/${{ env.pkg_folder }}/rerun_sdk/rerun_demo/colmap_fiat.rrd
- name: Repack the wheel
shell: bash
run: |
mkdir dist
wheel pack unpack-dist/${{ env.pkg_folder }} --dest dist/
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

# All platforms are currently creating the same rrd file, upload one of them
- name: Save RRD artifact
uses: actions/upload-artifact@v3
with:
name: rrd
path: rrd

# ---------------------------------------------------------------------------
matrix-setup:
# Building all the wheels is expensive, so we only run this job when we push (to main or release tags),
# or if the job was manually triggered with `force_build_wheel` set to true.
Expand All @@ -85,42 +237,30 @@ jobs:

- id: set-matrix
shell: bash
# TODO(jleibs): figure out why tests are failing to complete on `x86_64-apple-darwin`
# See: https://github.com/rerun-io/rerun/pull/1853
run: |
matrix=()
matrix+=('{"platform": "macos", "target": "x86_64-apple-darwin", "runs_on": "macos-latest"},')
matrix+=('{"platform": "macos", "target": "aarch64-apple-darwin", "runs_on": "macos-latest"},')
matrix+=('{"platform": "windows", "target": "x86_64-pc-windows-msvc", "runs_on": "windows-latest-8-cores"},')
matrix+=('{"platform": "linux", "target": "x86_64-unknown-linux-gnu", "runs_on": "ubuntu-latest-16-cores", container: {"image": "rerunio/ci_docker:0.6"}}')
matrix+=('{"platform": "macos", "target": "x86_64-apple-darwin", "run_tests": false, "runs_on": "macos-latest" },')
matrix+=('{"platform": "macos", "target": "aarch64-apple-darwin", "run_tests": false, "runs_on": "macos-latest" },') # NOTE: we can't run tests on arm since our macos runner is x86_64
matrix+=('{"platform": "windows", "target": "x86_64-pc-windows-msvc", "run_tests": true, "runs_on": "windows-latest-8-cores"},')
echo "Matrix values: ${matrix[@]}"
echo "matrix={\"include\":[${matrix[@]}]}" >> $GITHUB_OUTPUT
wheels:
name: Build Python Wheels
needs: [lint, matrix-setup]
name: Build Remaining Python Wheels
needs: [lint, matrix-setup, wheels-linux]

strategy:
matrix: ${{fromJson(needs.matrix-setup.outputs.matrix)}}

runs-on: ${{ matrix.runs_on }}

container: ${{ matrix.container }}

steps:
- uses: actions/checkout@v3

# These should already be in the docker container, but run for good measure. A no-op install
# should be fast, and this way things don't break if we add new packages without rebuilding
# docker
- name: Cache APT Packages
if: matrix.platform == 'linux'
uses: awalsh128/[email protected]
with:
packages: ${{ env.UBUNTU_REQUIRED_PKGS }}
version: 2.0 # Increment this to pull newer packages
execute_install_scripts: true

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -133,7 +273,6 @@ jobs:
# The pip-cache setup logic doesn't work in the ubuntu docker container
# That's probably fine since we bake these deps into the container already
- name: Setup python
if: matrix.platform != 'linux'
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand Down Expand Up @@ -194,6 +333,12 @@ jobs:
run: |
python3 scripts/version_util.py --check_version
- name: Store the expected version
# Find the current cargo version and store it in the GITHUB_ENV var: `expected_version`
shell: bash
run: |
echo "expected_version=$(python3 scripts/version_util.py --bare_cargo_version)" >> $GITHUB_ENV
- name: Build Wheel
uses: PyO3/maturin-action@v1
with:
Expand All @@ -210,12 +355,36 @@ jobs:
--out pre-dist
- name: Install built wheel
if: ${{ matrix.run_tests }}
# First we install the dependencies manually so we can use `--no-index` when installing the wheel.
# Then install the wheel using a specific version and --no-index to guarantee we get the version from
# the pre-dist folder. Note we don't use --force-reinstall here because --no-index means it wouldn't
# find the dependencies to reinstall them.
# TODO(jleibs): pull these deps from pyproject.toml
shell: bash
run: |
pip uninstall rerun-sdk
pip install deprecated numpy>=1.23 pyarrow==10.0.1
pip install rerun-sdk==${{ env.expected_version }} --no-index --find-links pre-dist
- name: Verify built wheel version
if: ${{ matrix.run_tests }}
shell: bash
run: |
pip install rerun-sdk --find-links pre-dist --force-reinstall
python3 -m rerun --version
which rerun
rerun --version
- name: Run tests
- name: Run unit tests
if: ${{ matrix.run_tests }}
shell: bash
run: cd rerun_py/tests && pytest

- name: Run e2e test
if: ${{ matrix.run_tests }}
shell: bash
run: RUST_LOG=debug scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed

- name: Unpack the wheel
shell: bash
run: |
Expand All @@ -227,21 +396,16 @@ jobs:
run: |
echo "pkg_folder=$(ls unpack-dist)" >> $GITHUB_ENV
- name: Cache RRD dataset
id: dataset
uses: actions/cache@v3
- name: Download RRD
uses: actions/download-artifact@v3
with:
path: examples/python/colmap/dataset/
# TODO(jleibs): Derive this key from the invocation below
key: colmap-dataset-colmap-fiat-v0
name: rrd
path: rrd

- name: Generate Embedded RRD file
- name: Insert the rrd
shell: bash
# If you change the line below you should almost definitely change the `key:` line above by giving it a new, unique name
run: |
mkdir rrd
pip install -r examples/python/colmap/requirements.txt
python3 examples/python/colmap/main.py --dataset colmap_fiat --resize 800x600 --save rrd/colmap_fiat.rrd
cp rrd/colmap_fiat.rrd unpack-dist/${{ env.pkg_folder }}/rerun_sdk/rerun_demo/colmap_fiat.rrd
- name: Repack the wheel
Expand All @@ -256,14 +420,6 @@ jobs:
name: wheels
path: dist

# All platforms are currently creating the same rrd file, upload one of them
- name: Save RRD artifact
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v3
with:
name: rrd
path: rrd

# ---------------------------------------------------------------------------

upload_rrd:
Expand Down
Loading

0 comments on commit c0886c6

Please sign in to comment.