-
Notifications
You must be signed in to change notification settings - Fork 394
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
Make it possible to configure how rerun_notebook
fetches the widget
#6680
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jleibs
added
notebook
Jupyter notebooks etc
exclude from changelog
PRs with this won't show up in CHANGELOG.md
labels
Jun 28, 2024
jleibs
force-pushed
the
jleibs/notebook_asset_plumbing
branch
from
June 28, 2024 17:27
a091f81
to
b800fd5
Compare
Is it possible to print an error message pointing the user to |
Deployed docs
|
jleibs
commented
Jun 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Overview
Even though
rerun_notebook
ships with the widget asset bundled in, by default it will try to load the assetfrom
https://app.rerun.io
. This is because the way anywiget transmits the asset at the moment results ina memory leak of the entire module for each cell execution.
If your network does not allow you to access
app.rerun.io
, the behavior can be changed by setting thethe
RERUN_NOTEBOOK_ASSET
environment variable before you importrerun_notebook
. This variable mustbe set prior to your import because
AnyWidget
stores the resource on the widget class instanceonce at import time.
Inlined asset
Setting:
Will cause
rerun_notebook
to directly transmit the inlined asset to the widget over Jupyter comms.This will be the most portable way to use the widget, but is currently known to leak memory and
has some performance issues in environments such as Google colab.
Locally served asset
Setting:
Will cause
rerun_notebook
to launch a thread serving the asset from the local machine duringthe lifetime of the kernel. This will be the best way to use the widget in a notebook environment
when your notebook server is running locally.
Manually hosted asset
Setting:
Will cause
rerun_notebook
to load the asset from the provided URL. This is the most flexible way touse the widget, but requires you to host the asset yourself.
The
rerun_notebook
package has a minimal server that can be used to serve the asset nanually by running:However, any hosting platform can be used to serve the asset, as long as it is accessible to the notebook
and has appropriate CORS headers set.
asset_server.py
for a simple example.Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.