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

Add more examples to app.rerun.io #2062

Merged
merged 34 commits into from
May 16, 2023
Merged

Add more examples to app.rerun.io #2062

merged 34 commits into from
May 16, 2023

Conversation

jprochazk
Copy link
Member

@jprochazk jprochazk commented May 9, 2023

Closes #2017

To run it locally:

$ ./scripts/build_demo_app.py --serve

And open localhost:8080

What

Added the build_demo_app.py script, which runs a cherry-picked list of examples, producing .rrd files. The result is then wrapped up into a shell app which adds a dropdown to switch between the individual examples, a description for each example, and a link to its source code on GitHub.

image

The app is built on every commit, just like the existing web-viewer app (app.rerun.io), and deployed to a GCS bucket, which is available at demo.rerun.io. The examples app supports the same prefixes as the original web viewer (adhoc/<name>, version/<tag>, commit/<short hash>)

Checklist

PR Build Summary: https://build.rerun.io/pr/2062

@jprochazk jprochazk changed the title Jan/more web examples Add more examples to app.rerun.io May 9, 2023
@jprochazk jprochazk added 📖 documentation Improvements or additions to documentation 🕸️ web regarding running the viewer in a browser examples Issues relating to the Rerun examples labels May 9, 2023
@jprochazk jprochazk force-pushed the jan/more-web-examples branch from 03d3269 to 71cd0dd Compare May 11, 2023 09:48
@jprochazk jprochazk force-pushed the jan/more-web-examples branch 2 times, most recently from ac2cb62 to 2a681de Compare May 11, 2023 18:04
@jprochazk jprochazk marked this pull request as ready for review May 11, 2023 18:04
@jprochazk jprochazk force-pushed the jan/more-web-examples branch from 2281379 to ed6c9ef Compare May 12, 2023 07:30
@jprochazk
Copy link
Member Author

The deployments work now, but I'm getting some weirdness in the app itself:

fdsa

@jprochazk
Copy link
Member Author

The weirdness is not caused by the stuff in this PR

@jprochazk jprochazk force-pushed the jan/more-web-examples branch from 6619a92 to 87dc036 Compare May 12, 2023 12:08
@teh-cmc teh-cmc self-requested a review May 15, 2023 08:45
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

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

Absolutely fantastic 🤌

A few things I'd like to see fixed before this gets merged, but otherwise it's 🟢:

  • Make sure to bind to all network interfaces (0.0.0.0)
  • Highlight on the Github button is behaving a bit weird:
    image

scripts/build_demo_app.py Outdated Show resolved Hide resolved
scripts/build_demo_app.py Outdated Show resolved Hide resolved
.github/workflows/reusable_build_web_demo.yml Outdated Show resolved Hide resolved

- name: Build web demo
env:
COMMIT_HASH: ${{ github.env.GITHUB_SHA }}
Copy link
Member

Choose a reason for hiding this comment

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

Don't you need to do the whole commit override dance here? Asking just in case, I'm not too familiar with the matter...

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, either. Maybe @jleibs can comment on this?

Copy link
Member

Choose a reason for hiding this comment

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

I believe so. Without the commit-override-dance then when running this job *on pull request, GITHUB_SHA is going to sometimes point to an ephemeral merge-commit, which I think means your code-link from the examples will be broken.

Not necessarily the end of the world for this use-case since the adhoc / on-push-main versions which are the only ones I expect someone in the public to see will still do the right thing, but probably worth adding in the support.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added this in the form of a SOURCE_LINK_COMMIT_OVERRIDE input to the build_web_demo workflow.

@jprochazk jprochazk force-pushed the jan/more-web-examples branch from 87dc036 to 6879bc7 Compare May 15, 2023 10:28
@jprochazk
Copy link
Member Author

jprochazk commented May 15, 2023

Seems like the icon just needed a static width and height. Tested it on chrome/firefox/safari, looks to be fine now.

https://demo.rerun.io/commit/6879bc7/examples/colmap/

jprochazk added 13 commits May 16, 2023 09:44
the script:
- cleans the `web_demo` dir
- copies static assets (favicon, index.html, js, css, etc.)
- uses `re_build_web_viewer` to build the WASM
  and copies the binaries to `web_demo`
- runs the examples with `--save`
- renders the example template for each example
- include example titles and descriptions
- add `--serve` flag for locally serving the resulting dir
- changed `<select>` to a custom dropdown
- added `?` icon with description
@jprochazk jprochazk force-pushed the jan/more-web-examples branch from 6879bc7 to 6dd3953 Compare May 16, 2023 07:44
@jprochazk jprochazk requested a review from teh-cmc May 16, 2023 08:01
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

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

Looking good 👌

(Please avoid force-pushing once someone has started reviewing your PR 🙏)

@jprochazk
Copy link
Member Author

Please avoid force-pushing once someone has started reviewing your PR

I did this out of habit, I'll merge instead from now on, sorry!

@jprochazk jprochazk merged commit c21fba8 into main May 16, 2023
@jprochazk jprochazk deleted the jan/more-web-examples branch May 16, 2023 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation Improvements or additions to documentation examples Issues relating to the Rerun examples 🕸️ web regarding running the viewer in a browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more examples to app.rerun.io, and link to their source code
3 participants