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

Load examples manifest via HTTP #4391

Merged
merged 29 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4c5c3a4
load example manifest via http
jprochazk Nov 29, 2023
afee69a
override `EXAMPLES_MANIFEST_URL` at runtime in CLI
jprochazk Nov 29, 2023
7dfb188
move examples_manifest build script
jprochazk Nov 29, 2023
52e89ab
support `manifest_url` query param
jprochazk Nov 29, 2023
2b0ea81
support `--base-url` arg
jprochazk Nov 30, 2023
99b68d2
remove unused deps
jprochazk Nov 30, 2023
beed08f
add `build-examples-manifest` task to pixi
jprochazk Nov 30, 2023
09848dc
set default manifest to real values
jprochazk Nov 30, 2023
22daf12
build manifest on CI
jprochazk Nov 30, 2023
46921d0
fix clippy lints
jprochazk Nov 30, 2023
aee399f
get rid of `UPLOAD_COMMIT_OVERRIDE` dance
jprochazk Nov 30, 2023
1b9f878
fix trailing commas
jprochazk Nov 30, 2023
eb11397
ignore generated js file
jprochazk Nov 30, 2023
fc0807b
remove log about using default manifest
jprochazk Nov 30, 2023
43248c0
Merge branch 'main' into jan/online-manifest
jprochazk Nov 30, 2023
f9b14c6
update pr template with nightly app rerun io
jprochazk Nov 30, 2023
d3375b9
Merge branch 'main' into jan/online-manifest
jprochazk Nov 30, 2023
d8fa1ba
sort
jprochazk Nov 30, 2023
815bd94
move code around for readability
jprochazk Nov 30, 2023
c27c570
remove unnecessary `pub(crate)`
jprochazk Nov 30, 2023
9936fc7
use `ReUi::error_text` instead of plain `label` for error message
jprochazk Nov 30, 2023
7cd767e
remove unnecessary handle.start args
jprochazk Nov 30, 2023
1a39da1
downgrade prettier
jprochazk Nov 30, 2023
1b109a7
uppercase doctype
jprochazk Nov 30, 2023
252b6be
update pr template
jprochazk Nov 30, 2023
811b020
update pr template again
jprochazk Nov 30, 2023
50638c2
fix usage of `error_text`
jprochazk Nov 30, 2023
c6c2960
Merge branch 'main' into jan/online-manifest
jprochazk Nov 30, 2023
cf3b24b
Merge branch 'main' into jan/online-manifest
jprochazk Dec 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ To get an auto-generated PR description you can put "copilot:summary" or "copilo
### 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)
* [ ] I have tested [app.rerun.io](https://app.rerun.io/pr/{{ pr.number }}) (if applicable)
* [ ] I have tested the web demo (if applicable):
* Full build: [app.rerun.io](https://app.rerun.io/pr/{{ pr.number }}/index.html)
* Partial build: [app.rerun.io](https://app.rerun.io/pr/{{ pr.number }}/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) - 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

- [PR Build Summary](https://build.rerun.io/pr/{{ pr.number }})
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
UPLOAD_COMMIT_OVERRIDE: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
secrets: inherit

Expand Down Expand Up @@ -151,7 +150,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web_demo.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
UPLOAD_COMMIT_OVERRIDE: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
secrets: inherit

Expand All @@ -163,7 +161,6 @@ jobs:
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
WHEEL_ARTIFACT_NAME: linux-wheel-fast
UPLOAD_COMMIT_OVERRIDE: ${{ github.event.pull_request.head.sha }}
secrets: inherit

save-pr-summary:
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/reusable_build_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,21 @@ jobs:
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

- name: Build web-viewer (release)
uses: actions-rs/cargo@v1
with:
command: run
args: --locked -p re_build_web_viewer -- --release ${{ inputs.EXTRA_FLAGS }}
shell: bash
run: |
cargo run --locked -p re_build_web_viewer -- --release ${{ inputs.EXTRA_FLAGS }}

# We build a single manifest pointing to the `commit`
# All the `pr`, `nightly`, release tag, etc. variants will always just point to the resolved commit
- name: Build examples manifest
shell: bash
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
sha="$(echo $full_commit | cut -c1-7)"

cargo run --locked -p re_build_examples_manifest -- \
--base-url "https://demo.rerun.io/commit/$sha" \
web_viewer/examples_manifest.json

- name: Upload web assets
uses: actions/upload-artifact@v3
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/reusable_publish_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ jobs:
run: |
pixi run cargo run --locked -p re_build_web_viewer -- --release

- name: Build examples manifest
shell: bash
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
sha="$(echo $full_commit | cut -c1-7)"

pixi run build-examples-manifest \
--base-url "https://demo.rerun.io/commit/$sha" \
web_viewer/examples_manifest.json

- name: Build web demo
env:
COMMIT_HASH: ${{ needs.get-commit-sha.outputs.short-sha }}
Expand All @@ -125,13 +135,20 @@ jobs:
destination: "rerun-web-viewer/commit/${{ needs.get-commit-sha.outputs.short-sha }}"
parent: false

- name: Upload demo.rerun.io
- name: Upload demo.rerun.io (versioned)
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_demo"
destination: "rerun-demo/version/${{ inputs.release-version }}"
parent: false

- name: Upload demo.rerun.io (commit)
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_demo"
destination: "rerun-demo/commit/${{ needs.get-commit-sha.outputs.short-sha }}"
parent: false

- name: Publish app.rerun.io
if: inputs.update-latest
shell: bash
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/reusable_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ jobs:
run: |
pixi run cargo run --locked -p re_build_web_viewer -- --release

# Run the build script for `re_viewer`, then commit it this
# will ensure that any other dirty files will emit the usual
# "dirty git tree" error for all files except the manifest
- name: Build examples manifest
shell: bash
run: |
pixi run cargo build --locked -p re_viewer

- name: Commit examples manifest
shell: bash
run: |
git add ./crates/re_viewer/data/examples_manifest.json
git commit -m 'temp'

- name: Publish
shell: bash
run: |
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/reusable_run_notebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ on:
required: false
type: string
default: ""
# We need this because PRs use a merged commit but we really want
# to track uploads based on the source commit.
UPLOAD_COMMIT_OVERRIDE:
required: false
type: string
default: ""

concurrency:
group: ${{ inputs.CONCURRENCY }}-run-notebook
Expand Down Expand Up @@ -77,19 +71,16 @@ jobs:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

- name: Add SHORT_SHA env property with commit short sha
- name: Get sha
id: get-sha
shell: bash
run: |
if [ -z "${{ inputs.UPLOAD_COMMIT_OVERRIDE }}" ]; then
USED_SHA=${{ github.sha }}
else
USED_SHA=${{ inputs.UPLOAD_COMMIT_OVERRIDE }}
fi
echo "SHORT_SHA=$(echo $USED_SHA | cut -c1-7)" >> $GITHUB_ENV
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"

- name: "Upload Notebook"
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "/tmp/cube.html"
destination: "rerun-builds/commit/${{env.SHORT_SHA}}/notebooks"
destination: "rerun-builds/commit/${{ steps.get-sha.outputs.sha }}/notebooks"
parent: false
24 changes: 5 additions & 19 deletions .github/workflows/reusable_upload_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ on:
required: false
type: string
default: "prerelease"
# We need this because PRs use a merged commit but we really want
# to track uploads based on the source commit.
UPLOAD_COMMIT_OVERRIDE:
required: false
type: string
default: ""
UPLOAD_COMMIT:
required: false
type: boolean
default: true
PR_NUMBER:
required: false
type: string
Expand Down Expand Up @@ -64,22 +54,18 @@ jobs:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

- name: Add SHORT_SHA env property with commit short sha
- name: Get sha
id: get-sha
shell: bash
run: |
if [ -z "${{ inputs.UPLOAD_COMMIT_OVERRIDE }}" ]; then
USED_SHA=${{ github.sha }}
else
USED_SHA=${{ inputs.UPLOAD_COMMIT_OVERRIDE }}
fi
echo "SHORT_SHA=$(echo $USED_SHA | cut -c1-7)" >> $GITHUB_ENV
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"

- name: "Upload web-viewer (commit)"
if: ${{ inputs.UPLOAD_COMMIT }}
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_viewer"
destination: "rerun-web-viewer/commit/${{env.SHORT_SHA}}"
destination: "rerun-web-viewer/commit/${{ steps.get-sha.outputs.sha }}"
parent: false

- name: "Upload web-viewer (tagged)"
Expand Down
24 changes: 5 additions & 19 deletions .github/workflows/reusable_upload_web_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ on:
required: false
type: string
default: "prerelease"
# We need this because PRs use a merged commit but we really want
# to track uploads based on the source commit.
UPLOAD_COMMIT_OVERRIDE:
required: false
type: string
default: ""
UPLOAD_COMMIT:
required: false
type: boolean
default: true
PR_NUMBER:
type: string
default: ""
Expand Down Expand Up @@ -63,22 +53,18 @@ jobs:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

- name: Add SHORT_SHA env property with commit short sha
- name: Get sha
id: get-sha
shell: bash
run: |
if [ -z "${{ inputs.UPLOAD_COMMIT_OVERRIDE }}" ]; then
USED_SHA=${{ github.sha }}
else
USED_SHA=${{ inputs.UPLOAD_COMMIT_OVERRIDE }}
fi
echo "SHORT_SHA=$(echo $USED_SHA | cut -c1-7)" >> $GITHUB_ENV
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"

- name: "Upload web demo (commit)"
if: ${{ inputs.UPLOAD_COMMIT }}
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_demo"
destination: "rerun-demo/commit/${{env.SHORT_SHA}}"
destination: "rerun-demo/commit/${{ steps.get-sha.outputs.sha }}"
parent: false

- name: "Upload web demo (tagged)"
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
rerun_cpp/docs/**/*

rerun_js/web-viewer/re_viewer_bg.js
rerun_js/web-viewer/re_viewer.js
web_viewer/re_viewer.js
crates/re_web_viewer_server/web_viewer/re_viewer.js

.pixi
1 change: 1 addition & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
semi = true
tabWidth = 4
trailingComma = "all"

[[overrides]]
files = ["*.yml", "*.yaml"]
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
"ruff.lint.args": [
"--config=rerun_py/pyproject.toml"
],

"prettier.configPath": ".prettierrc.toml",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
},
Expand Down
13 changes: 12 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ version = "0.12.0-alpha.1+dev"
# re_log_types 0.3.0-alpha.0, NOT 0.3.0-alpha.4 even though it is newer and semver-compatible.
re_analytics = { path = "crates/re_analytics", version = "=0.12.0-alpha.1", default-features = false }
re_arrow_store = { path = "crates/re_arrow_store", version = "=0.12.0-alpha.1", default-features = false }
re_build_examples_manifest = { path = "crates/re_build_examples_manifest", version = "=0.12.0-alpha.1", default-features = false }
re_build_info = { path = "crates/re_build_info", version = "=0.12.0-alpha.1", default-features = false }
re_build_tools = { path = "crates/re_build_tools", version = "=0.12.0-alpha.1", default-features = false }
re_build_web_viewer = { path = "crates/re_build_web_viewer", version = "=0.12.0-alpha.1", default-features = false }
Expand Down
26 changes: 26 additions & 0 deletions crates/re_build_examples_manifest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "re_build_examples_manifest"
authors.workspace = true
description = "Build the rerun web-viewer Wasm from source"
edition.workspace = true
homepage.workspace = true
include.workspace = true
license.workspace = true
publish = true
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[package.metadata.docs.rs]
all-features = true


[dependencies]
re_build_tools.workspace = true

# External
anyhow.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
serde_yaml.workspace = true
Loading
Loading