Skip to content

Commit d7c867d

Browse files
authored
Introduce a mechanism of building wheels with extra features (#8010)
### What - Useful for making and sharing early versions of wheels ### 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/8010?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/8010?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)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/8010) - [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`.
1 parent 8b2b7b3 commit d7c867d

File tree

4 files changed

+154
-4
lines changed

4 files changed

+154
-4
lines changed

.github/workflows/adhoc_wheels.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Adhoc Wheels
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
MODE:
7+
type: choice
8+
required: false
9+
options:
10+
- pypi
11+
- pr
12+
- extra
13+
description: "The build mode (`pypi` includes the web viewer, `pr` does not)"
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
permissions:
20+
contents: "write"
21+
id-token: "write"
22+
deployments: "write"
23+
24+
jobs:
25+
# -----------------------------------------------------------------------------------
26+
# Build rerun-cli (rerun binaries):
27+
28+
build-rerun-cli-and-upload-linux-arm64:
29+
name: "Linux-arm64: Build & Upload rerun-cli"
30+
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
31+
with:
32+
CONCURRENCY: adhoc-wheels-linux-arm64
33+
PLATFORM: linux-arm64
34+
secrets: inherit
35+
36+
build-rerun-cli-and-upload-linux-x64:
37+
name: "Linux-x64: Build & Upload rerun-cli"
38+
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
39+
with:
40+
CONCURRENCY: adhoc-wheels-linux-x64
41+
PLATFORM: linux-x64
42+
secrets: inherit
43+
44+
build-rerun-cli-and-upload-macos-x64:
45+
name: "Mac-x64: Build & Upload rerun-cli"
46+
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
47+
with:
48+
CONCURRENCY: adhoc-wheels-macos-x64
49+
PLATFORM: macos-x64
50+
secrets: inherit
51+
52+
build-rerun-cli-and-upload-macos-arm64:
53+
name: "Mac-arm64: Build & Upload rerun-cli"
54+
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
55+
with:
56+
CONCURRENCY: adhoc-wheels-macos-arm64
57+
PLATFORM: macos-arm64
58+
secrets: inherit
59+
60+
build-rerun-cli-and-upload-windows-x64:
61+
name: "Windows-x64: Build & Upload rerun-cli"
62+
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
63+
with:
64+
CONCURRENCY: adhoc-wheels-windows-x64
65+
PLATFORM: windows-x64
66+
secrets: inherit
67+
68+
# ---------------------------------------------------------------------------
69+
# Build wheels:
70+
71+
build-wheel-linux-arm64:
72+
needs: [build-rerun-cli-and-upload-linux-arm64]
73+
name: "Linux-arm64: Build & Upload Wheels"
74+
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
75+
with:
76+
CONCURRENCY: adhoc-wheels-linux-arm64
77+
PLATFORM: linux-arm64
78+
WHEEL_ARTIFACT_NAME: linux-arm64-wheel
79+
MODE: ${{ inputs.MODE }}
80+
secrets: inherit
81+
82+
build-wheel-linux-x64:
83+
needs: [build-rerun-cli-and-upload-linux-x64]
84+
name: "Linux-x64: Build & Upload Wheels"
85+
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
86+
with:
87+
CONCURRENCY: adhoc-wheels-linux-x64
88+
PLATFORM: linux-x64
89+
WHEEL_ARTIFACT_NAME: linux-x64-wheel
90+
MODE: ${{ inputs.MODE }}
91+
secrets: inherit
92+
93+
build-wheel-macos-arm64:
94+
needs: [build-rerun-cli-and-upload-macos-arm64]
95+
name: "Macos-arm64: Build & Upload Wheels"
96+
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
97+
with:
98+
CONCURRENCY: adhoc-wheels-macos-arm64
99+
PLATFORM: macos-arm64
100+
WHEEL_ARTIFACT_NAME: macos-arm64-wheel
101+
MODE: ${{ inputs.MODE }}
102+
secrets: inherit
103+
104+
build-wheel-macos-x64:
105+
needs: [build-rerun-cli-and-upload-macos-x64]
106+
name: "Macos-x64: Build & Upload Wheels"
107+
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
108+
with:
109+
CONCURRENCY: adhoc-wheels-macos-x64
110+
PLATFORM: macos-x64
111+
WHEEL_ARTIFACT_NAME: "macos-x64-wheel"
112+
MODE: ${{ inputs.MODE }}
113+
secrets: inherit
114+
115+
build-wheel-windows-x64:
116+
needs: [build-rerun-cli-and-upload-windows-x64]
117+
name: "Windows-x64: Build & Upload Wheels"
118+
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
119+
with:
120+
CONCURRENCY: adhoc-wheels-windows-x64
121+
PLATFORM: windows-x64
122+
WHEEL_ARTIFACT_NAME: windows-x64-wheel
123+
MODE: "pypi"
124+
secrets: inherit
125+
126+
# --------------------------------------------------------------------------
127+
128+
generate-pip-index:
129+
name: "Generate Pip Index"
130+
needs:
131+
[
132+
build-wheel-linux-arm64,
133+
build-wheel-linux-x64,
134+
build-wheel-macos-arm64,
135+
build-wheel-macos-x64,
136+
build-wheel-windows-x64,
137+
]
138+
uses: ./.github/workflows/reusable_pip_index.yml
139+
with:
140+
CONCURRENCY: adhoc-wheels
141+
secrets: inherit

.github/workflows/reusable_build_and_upload_wheels.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ on:
4040
options:
4141
- pypi
4242
- pr
43+
- extra
4344
description: "The build mode (`pypi` includes the web viewer, `pr` does not)"
4445
CONCURRENCY:
4546
required: false
@@ -226,15 +227,15 @@ jobs:
226227

227228
- name: "Build rerun_notebook"
228229
# only build the notebook if we are building for pypi and running linux-x64
229-
if: ${{ inputs.MODE == 'pypi' && inputs.PLATFORM == 'linux-x64' }}
230+
if: ${{ (inputs.MODE == 'pypi' || inputs.MODE == 'extra') && inputs.PLATFORM == 'linux-x64' }}
230231
run: |
231232
rm -rf dist
232233
pixi run js-build-base
233234
pixi run python scripts/ci/build_and_upload_rerun_notebook.py \
234235
--dir commit/${{ steps.get-sha.outputs.sha }}/wheels
235236
236237
- name: Save rerun_notebook wheel artifact
237-
if: ${{ inputs.MODE == 'pypi' && inputs.PLATFORM == 'linux-x64' }}
238+
if: ${{ (inputs.MODE == 'pypi' || inputs.MODE == 'extra') && inputs.PLATFORM == 'linux-x64' }}
238239
uses: actions/upload-artifact@v4
239240
with:
240241
name: rerun_notebook_wheel

rerun_py/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ name = "rerun_bindings" # name of the .so library that the Python module will im
1717
[features]
1818
default = ["extension-module"]
1919

20+
## Extra features that aren't ready to be included in release builds yet.
21+
extra = ["pypi", "remote"]
22+
2023
## The features we turn on when building the `rerun-sdk` PyPi package
2124
## for <https://pypi.org/project/rerun-sdk/>.
2225
pypi = ["extension-module", "nasm", "web_viewer"]

scripts/ci/build_and_upload_wheels.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,23 @@ def detect_target() -> str:
5656
class BuildMode(Enum):
5757
PYPI = "pypi"
5858
PR = "pr"
59+
EXTRA = "extra"
5960

6061
def __str__(self) -> str:
6162
return self.value
6263

6364

6465
def build_and_upload(bucket: Bucket | None, mode: BuildMode, gcs_dir: str, target: str, compatibility: str) -> None:
65-
if mode is BuildMode.PYPI:
66-
# Only build web viewer when publishing to pypi
66+
# pypi / extra builds require a web build
67+
if mode in (BuildMode.PYPI, BuildMode.EXTRA):
6768
run("pixi run rerun-build-web-release")
69+
70+
if mode is BuildMode.PYPI:
6871
maturin_feature_flags = "--no-default-features --features pypi"
6972
elif mode is BuildMode.PR:
7073
maturin_feature_flags = "--no-default-features --features extension-module"
74+
elif mode is BuildMode.EXTRA:
75+
maturin_feature_flags = "--no-default-features --features extra"
7176

7277
dist = f"dist/{target}"
7378

0 commit comments

Comments
 (0)