Hosting interactive pluto notebook on web/Github

@roualdes I think you just need to add Pluto to the Project.toml and Manifest.toml files.

How silly of me. Doh. This works great. Thanks so much for sharing (and fixing)!

Spent a little bit of time trying to reduce latency with this set up and had some pretty good success. Possible strategies are to use

  • Julia 1.6, just released!
  • jupyter/base-notebook instead of jupyter/scipy-notebook, the base-notebook is a significantly smaller Docker image, but you lose most Python packages
  • GitHub Actions to reduce mybinder.org startup time, possibly at the expense of longer build times (depending on the strategy you choose)
  • PackageCompiler to build a sysimage to reduce Julia startup latency.

Exact details of my setup are in my plutonotebooks repository.

Thanks again to @Paul_Schrimpf for this great setup.

6 Likes

I followed these steps, including adding Pluto and PlutoUI to the Project.toml file, but the Jupyter notebok browser shows up for me as well, not Pluto.

I then tried feeding your Github repo URL to binder (as well as that of @roualdes from the last post), but those don’t work either - I simply see the Jupyter notebooks. Can someone confirm if @Paul_Schrimpf’s method still works?

I think it still works. From the jupyter file browser, there should be a Pluto.jl option under the New menu near the top right.

An alternative would be static html export plus a Pluto SliderServer, like for the MIT course: Introduction to Computational Thinking

2 Likes

So it does, thank you for pointing it out! After starting Pluto.jl, the notebook URL inside the container (in this case /home/jovyan/notebooks/test.jl) has to be entered manually. Is there a way to start Pluto automatically? I thought the “runpluto.sh” file in the repo would do this.

Is it possible to export a static HTML version with all slider combinations precomputed?
I know that this could lead to very big state space if one is not careful, but it would be a very nice way to host a static interactive notebook. Especially if the computations are more on the expensive side.

I would image it as adding a results cache in javascript for the slider state space.

I manually create and share links like

https://mybinder.org/v2/gh/roualdes/plutonotebooks/main?urlpath=pluto/open?path=/home/jovyan/notebooks/beta.jl

and they open directly into Pluto. For instance, this notebook.

1 Like

This is perfect, thank you.

May I ask how you found the URL scheme (?urlpath=pluto/open) to open Pluto directly?

Borrowed it from @Paul_Schrimpf’s instructions above, but I haven’t yet seen it documented anywhere.

1 Like

Hi,
Also worked for me.
Thank you @Paul_Schrimpf

Hello!! This is something we’re still working on!


@roualdes have you seen if the PlutoSliderServer also helps you? GitHub - JuliaPluto/PlutoSliderServer.jl: Web server to run just the @bind parts of a Pluto.jl notebook !! (-- see fon’s talk about it → PlutoSliderServer.jl -- notebooks as interactive websites | Fons van der Plas | PlutoCon 2021 - YouTube)

With that piece of software you can have 3 levels of interactivity:

  • static html exports
  • static exports, but sliders work
  • static export, but sliders work and also binder button

That way, your users will be looking at a static preview while waiting binder to startup!
as lungben said, that’s already used in the computational thinking course :slight_smile:

Let us know if you use it and have feedback or if you need help/instructions, because we really want to create something simple for people to use!!

Thanks,
Panagiotis

4 Likes

Hi @pankgeorg, thanks for the comment. I have seen PlutoSliderServer and even attended Fons’ talk live! It looks really nice, but I’m still not sure how to set it all up. Instructions to come, as far as I can tell; the readme instructions section say TBA. Happy to help test some instructions, once you have a rough draft :slight_smile: Just let me know.

In general, I’m pretty happy with my current set up. There’s a one time build cost of about 15 minutes (a GitHub Action), and then I think the load time is about 3 minutes whether or not Binder can find a built image. Though I haven’t double checked the times when no built image can be found since Binder has so politely cached my notebooks now for a few days. It would be nice if this custom setup could be coupled with PlutoSliderServer.

2 Likes

Cool. You’re right, I figured you’re pretty advanced from your config, indeed though we need to align some stuff before ‘launching’. Can I ping you when we have a more streamlined approach, so you can help with testing/suggesting how we make it even bettter for all? :smiley:

Thank you!!

2 Likes

Please do!

What would be really awesome is getting full Julia interactivity on a static page using a web assembly version of Julia, like Starboard does with Python using Pyodide

4 Likes

Thank you for putting this guide together, I’ve gotten as far as getting my own Pluto notebook uploaded and running, but I get an exception when some of the code starts to run. Hopefully this link works but if anyone has any idea why it’s not working I’d be grateful for the help. In particular the first error that shows up is Distributed.ProcessExitedException(2)

I think this is related to Pluto not working with the Distributed package, nothing to do with interactivity.

I tried using pluto-on-binder.glitch.me but I currently get a 503 error - is this just me, or is anyone else having issues? Or are there are now easier ways of deploying an interactive Pluto notebook? @fonsp