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

Enable Binder #2198

Open
wants to merge 65 commits into
base: master
from
Open

Enable Binder #2198

wants to merge 65 commits into from

Conversation

@MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented Apr 17, 2021

Address #1500, #1369 (comment) and #2218.

This will enable opening the Panel examples on Binder. Whether it will also be possible to add a binder link to all examples is unknown and "nice to have" for this PR.

image

For now you can access binder via https://mybinder.org/v2/gh/holoviz/panel/binder?urlpath=lab/tree/examples

I would like a suggestion from @philippjfr or @jbednar which link we should provide when released. I see the following options

  • Link to binder branch.
    • Pros: We can control what is available on Binder
    • Cons: We will have to remember and spend time on updating the binder branch
  • Link to master branch.
    • Pros: Everything is always the latest
    • Cons: There might be things is master that changes the behaviour of the current version of Panel released.
  • Link to release branch of Panel. I.e. for example the version for the Panel 0.11.3 release
    • Pros: The current version of Panel is available on Binder
    • Cons:
      • Will have to remember to update links across the repository.
      • Users having bookmarked the link would stay on that version of Panel on Binder
@MarcSkovMadsen
Copy link
Collaborator Author

@MarcSkovMadsen MarcSkovMadsen commented Apr 17, 2021

Status: Things are starting to work. I'm finding bugs in the Reference Examples. I have to update the gallery notebooks in order to be able to serve them as apps. I would like to configure VS Code to enable showcasing how powerful the combination of Panel and VS Code is.... Also on Binder and in a Jupyter Hub.

panel-binder.mp4

So I would really, really like Panel to work in VS Code. But it requires fixing bokeh/jupyter_bokeh#131

@stonebig stonebig mentioned this pull request Apr 18, 2021
1 of 6 tasks complete
@MarcSkovMadsen
Copy link
Collaborator Author

@MarcSkovMadsen MarcSkovMadsen commented Apr 20, 2021

Hi @philippjfr

As I see it 1) Binder is working 2) It now comes with a nice setup like panel-jupyter-proxy, panel serve of all gallery examples, vs code integrated and a new, improved index page.

In principle this could be all for this PR except adding a link to binder in different places. For example the README.

BUT all the notebooks need to be walked through and prettified in order to be useable as apps. This could be a lot of work and a lot of minor changes. And to be honest. Even without binder a test and update of the notebooks could be in place (c.f. all the bugs posted, I have just scratched the surface I believe).

Here are my questions.

  • Do you want the gallery notebooks updated in general to be responsive and end up in a nice app template?
  • Do you want the reference examples updated in general to be responsive and end up in a nice app template?`
  • If yes to some of these questions. Do you want separate PRs for each notebook, one large Notebook PR or just this PR with everything?
  • Could you answer the question about which link to provide to users posted in the first post? Thanks.
@philippjfr
Copy link
Member

@philippjfr philippjfr commented Apr 20, 2021

Do you want the gallery notebooks updated in general to be responsive and end up in a nice app template?

No, some of them sure, but definitely not all. The focus should be the feature being demonstrated not making all the examples look like.

Do you want the reference examples updated in general to be responsive and end up in a nice app template?`

Definitely not, in fact I'd argue there's no reason to make these available as apps at all.

Could you answer the question about which link to provide to users posted in the first post? Thanks.

I'll make sure to configure this once you're done here. The link will go in the interactivity warning that floats on the right side.

@philippjfr
Copy link
Member

@philippjfr philippjfr commented Apr 20, 2021

If yes to some of these questions. Do you want separate PRs for each notebook, one large Notebook PR or just this PR with everything?

Just make a single PR for any coordinated changes like this.

"pn.extension()\n",
"pn.config.sizing_mode=\"stretch_width\""
Comment on lines 18 to 19

This comment has been minimized.

@philippjfr

philippjfr Apr 26, 2021
Member

It's a matter of preference but config options can be passed to the extension:

Suggested change
"pn.extension()\n",
"pn.config.sizing_mode=\"stretch_width\""
"pn.extension(sizing_mode='stretch_width')"

This comment has been minimized.

@MarcSkovMadsen

MarcSkovMadsen Apr 26, 2021
Author Collaborator

Thanks. I like that preference :-) I will update.

This comment has been minimized.

@MarcSkovMadsen

MarcSkovMadsen May 1, 2021
Author Collaborator

@philippjfr . I have updated all Panel notebooks and test examples to use this terminology. It's nice and simple.

@MarcSkovMadsen
Copy link
Collaborator Author

@MarcSkovMadsen MarcSkovMadsen commented Apr 26, 2021

@jbednar . Some things the "default" template would have to know is a lot of configuration.

  • Which template?
  • Title?
  • What goes into sidebar?
  • What goes into main?
  • How wide should main be?

etc. I don't know how that could be done automatic and removed from the notebooks.

I would actually argue that 1) In practice it is not distracting 2) It's actually showing what the workflow to get to "production" with your dashboard or app is. For many use cases eventually you would need to wrap it into a nice template. 3) It's really valuable as now we have a to share the results of the examples as something that really looks nice and communicates.

So I don't see it as a pain. But a gain :-)

@jbednar
Copy link
Member

@jbednar jbednar commented Apr 26, 2021

Which template?
Title?
What goes into sidebar?
What goes into main?
How wide should main be?

Here I'd suggest following what existing less-configurable tools like shiny and streamlit do, to give users a gentle introduction to making a Panel app that is easy to get into and may be all they every need to do. E.g. pn.sidebar(panel_object), pn.main(panel_object), pn.title(text), etc., unless someone has a better suggestion. Defaults like how big main should be have to be configurable in a template anyway, so those don't seem like they would affect whether there is a default template.

@philippjfr
Copy link
Member

@philippjfr philippjfr commented Apr 26, 2021

Here I'd suggest following what existing less-configurable tools like shiny and streamlit do, to give users a gentle introduction to making a Panel app that is easy to get into and may be all they every need to do. E.g. pn.sidebar(panel_object), pn.main(panel_object), pn.title(text), etc., unless someone has a better suggestion

Really not excited about this, I don't want yet another API. I'd be okay with something like:

pn.extension(template='material')

a_component.servable(area='header')
another_component.servable(area='main')
yet_another_component.servable(area='sidebar')
@jbednar
Copy link
Member

@jbednar jbednar commented Apr 26, 2021

That sounds pretty clean to me!

@MarcSkovMadsen
Copy link
Collaborator Author

@MarcSkovMadsen MarcSkovMadsen commented May 1, 2021

Status:

  • All gallery examples are wrapped in a nice template and running as web apps on Binder.

The only things outstanding are

  • Enable customizing the site_url of A Template. Currently clicking the site url in an app on binder sends you to https://hub.gke2.mybinder.org instead of https://hub.gke2.mybinder.org/user/holoviz-panel-4gfpeow4/panel. The user should be able to set this as what is needed depends on the deployment scenario.

  • Getting VS Code working again such that it can easily be demonstrated that Panel works equally great in notebook and modern editor/ IDE. C.f. bokeh/jupyter_bokeh#131. I cannot do this but @philippjfr said he would do it.

  • Enable serving notebooks as "docs" with static code cells and dynamic output. For example via Voila. See #2241.

More can always be done. But that should be done in other PRs I believe.

@MarcSkovMadsen
Copy link
Collaborator Author

@MarcSkovMadsen MarcSkovMadsen commented May 2, 2021

Binder is now working as I originally intended it to and more :-).

Some things are not in scope for me

  • Adding links from every example at panel.holoviz.org to the notebook and app on Binder. I hope @philippjfr can/ will do this.

Some things are not working and I am not capable of getting it working

  • C.f. bokeh/jupyter_bokeh#131
  • Serving notebooks as live "docs" with static code cells and dynamic output. For example via Voila. See #2241.
  • And lots more that I created individual bug reports for.

Working Video

binder-gallery-works.mp4

Not Working

Watch this video on Youtube https://www.youtube.com/watch?v=gI3qQRVdIIE

@philippjfr Feel free to review and start creating value from this :-) I don't plan to do more on this before getting a review and feedback.

Thanks.

@MarcSkovMadsen MarcSkovMadsen changed the title Enable Binder - WORK IN PROGRESS Enable Binder May 2, 2021
@MarcSkovMadsen MarcSkovMadsen requested a review from philippjfr May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants