Skip to content

Commit

Permalink
Generate manifest for examples page in viewer (#3332)
Browse files Browse the repository at this point in the history
### What

Part of #3212

- Check that examples with a `thumbnail` have `thumbnail_dimensions` too
- Add `scripts/ci/thumbnails.py` script for checking/updating
`thumbnail_dimensions`
- Add `build.rs` to `re_viewer`
  - Keeps `re_viewer/data/examples_manifest.json` up to date
  - The file is committed, and is only updated in rerun workspace/CI
  - URLs point to:
    - `version/nightly` on `main`/local builds
    - `version/x.y.z` on release branches
    - `commit/{short_hash}` on PRs

### 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 [demo.rerun.io](https://demo.rerun.io/pr/3332) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3332)
- [Docs
preview](https://rerun.io/preview/1ba564f5afd6709dbe50ff411ba563b1d668caea/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/1ba564f5afd6709dbe50ff411ba563b1d668caea/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
  • Loading branch information
jprochazk authored Sep 18, 2023
1 parent 4401c7d commit d59a934
Show file tree
Hide file tree
Showing 45 changed files with 463 additions and 65 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ uploaded anywhere.
- `RELEASE_VERSION` - If producing a release, the version number. This must match the version in `Cargo.toml`.
- [reusable_upload_web.yml](reusable_upload_web.yml) - This job uploads the web assets to google cloud. By default this
only uploads to: `app.rerun.io/commit/<commit>/`
- `MARK_PRERELEASE_FOR_MAINLINE` - If true, then the web assets will go to `app.rerun.io/prelease/
- `MARK_TAGGED_VERSION` - If true, then the web assets will go to `app.rerun.io/version/<RELEASE_VERSION>`
- `RELEASE_VERSION` - If producing a release, the version number.
- `RRD_ARTIFACT_NAME` - Intermediate name of the GitHub rrd artifact. This should match the name passed to
Expand All @@ -54,7 +53,6 @@ uploaded anywhere.
source source code link in the built app always points to the pull request's `HEAD`.
- [reusable_upload_web_demo.yml](reusable_upload_web_demo.yml) - This job uploads the `demo.rerun.io` assets to google cloud. By default this
only uploads to: `demo.rerun.io/commit/<commit>/`
- `MARK_PRERELEASE_FOR_MAINLINE` - If true, then the web assets will go to `demo.rerun.io/prelease/
- `MARK_TAGGED_VERSION` - If true, then the web assets will go to `demo.rerun.io/version/<RELEASE_VERSION>`
- `RELEASE_VERSION` - If producing a release, the version number.
- `UPLOAD_COMMIT_OVERRIDE` - If set, will replace the value of `<commit>`. This is necessary because we want pull
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/manual_adhoc_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web.yml
with:
CONCURRENCY: adhoc-web-${{ github.event.inputs.ADHOC_NAME }}
MARK_PRERELEASE_FOR_MAINLINE: false
MARK_TAGGED_VERSION: false
ADHOC_NAME: ${{ github.event.inputs.ADHOC_NAME }}
RRD_ARTIFACT_NAME: linux-rrd-fast
Expand All @@ -62,7 +61,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web_demo.yml
with:
CONCURRENCY: adhoc-web-${{ github.event.inputs.ADHOC_NAME }}
MARK_PRERELEASE_FOR_MAINLINE: false
MARK_TAGGED_VERSION: false
ADHOC_NAME: ${{ github.event.inputs.ADHOC_NAME }}
UPLOAD_COMMIT: false
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/manual_build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web.yml
with:
CONCURRENCY: manual-dispatch-${{ github.run_id}}
MARK_PRERELEASE_FOR_MAINLINE: false
MARK_TAGGED_VERSION: true
RRD_ARTIFACT_NAME: linux-rrd
RELEASE_VERSION: ${{ github.event.inputs.RELEASE_VERSION }}
Expand All @@ -137,7 +136,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web_demo.yml
with:
CONCURRENCY: manual-dispatch-${{ github.run_id}}
MARK_PRERELEASE_FOR_MAINLINE: false
MARK_TAGGED_VERSION: true
RELEASE_VERSION: ${{ github.event.inputs.RELEASE_VERSION }}
secrets: inherit
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/manual_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web.yml
with:
CONCURRENCY: manual-dispatch-${{ github.run_id}}
MARK_PRERELEASE_FOR_MAINLINE: false
MARK_TAGGED_VERSION: false
RRD_ARTIFACT_NAME: linux-rrd-fast
secrets: inherit
Expand All @@ -235,7 +234,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web_demo.yml
with:
CONCURRENCY: manual-dispatch-${{ github.run_id}}
MARK_PRERELEASE_FOR_MAINLINE: false
MARK_TAGGED_VERSION: false
secrets: inherit

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/on_push_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
with:
CONCURRENCY: push-${{ github.ref_name }}
RRD_ARTIFACT_NAME: linux-rrd
MARK_PRERELEASE_FOR_MAINLINE: true
secrets: inherit

build-web-demo:
Expand All @@ -73,7 +72,6 @@ jobs:
uses: ./.github/workflows/reusable_upload_web_demo.yml
with:
CONCURRENCY: push-${{ github.ref_name }}
MARK_PRERELEASE_FOR_MAINLINE: true
secrets: inherit

build-rerun_c-and-upload-linux:
Expand Down Expand Up @@ -273,3 +271,4 @@ jobs:
allowUpdates: true
removeArtifacts: true
replacesArtifacts: true

5 changes: 5 additions & 0 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ jobs:
- name: Install dependencies
run: |
pip install gitignore_parser python-frontmatter
pip install -r ./scripts/ci/requirements.txt
- name: Rerun lints
run: |
Expand All @@ -279,6 +280,10 @@ jobs:
run: |
./scripts/ci/check_requirements.py
- name: Check Python example thumbnails
run: |
./scripts/ci/thumbnails.py check
# ---------------------------------------------------------------------------

spell-check:
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/reusable_upload_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ on:
type: string
required: false
default: ""
MARK_PRERELEASE_FOR_MAINLINE:
required: false
type: boolean
default: false
MARK_TAGGED_VERSION:
required: false
type: boolean
Expand Down Expand Up @@ -100,21 +96,39 @@ jobs:
parent: false

- name: "Upload web-viewer (prerelease)"
if: inputs.MARK_PRERELEASE_FOR_MAINLINE
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_viewer"
destination: "rerun-web-viewer/prerelease"
parent: false

- name: "Upload RRD (prerelease)"
if: inputs.MARK_PRERELEASE_FOR_MAINLINE
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "rrd"
destination: "rerun-example-rrd/prerelease"
parent: false

- name: "Upload web-viewer (nightly)"
# TEMP: Tracking `main` until we can do actual nightly builds.
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_viewer"
destination: "rerun-web-viewer/version/nightly"
parent: false

- name: "Upload RRD (nightly)"
# TEMP: Tracking `main` until we can do actual nightly builds.
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "rrd"
destination: "rerun-example-rrd/version/nightly"
parent: false

- name: "Upload web-viewer (tagged)"
if: inputs.MARK_TAGGED_VERSION
uses: google-github-actions/upload-cloud-storage@v1
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/reusable_upload_web_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ on:
type: string
required: false
default: ""
MARK_PRERELEASE_FOR_MAINLINE:
required: false
type: boolean
default: false
MARK_TAGGED_VERSION:
required: false
type: boolean
Expand Down Expand Up @@ -85,13 +81,22 @@ jobs:
parent: false

- name: "Upload web demo (prerelease)"
if: inputs.MARK_PRERELEASE_FOR_MAINLINE
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_demo"
destination: "rerun-demo/prerelease"
parent: false

- name: "Upload web demo (nightly)"
# TEMP: Tracking `main` until we can do actual nightly builds.
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_demo"
destination: "rerun-demo/version/nightly"
parent: false

- name: "Upload web demo (tagged)"
if: inputs.MARK_TAGGED_VERSION
uses: google-github-actions/upload-cloud-storage@v1
Expand Down
21 changes: 21 additions & 0 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions crates/re_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,9 @@ web-sys = { version = "0.3.52", features = ["Window"] }

[build-dependencies]
re_build_tools.workspace = true

# External
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "=0.9.21"
xshell = "0.2"
Loading

0 comments on commit d59a934

Please sign in to comment.