ClimateMARGO / ClimateWidgets

ClimateMARGO.jl widgets
http://climatemargo.github.io/ClimateWidgets/
1 stars 1 forks source link

Broken Pluto binder #1

Closed hdrake closed 4 years ago

hdrake commented 4 years ago

@fonsp Just letting you know that this exists! No rush!

I tried to get it working via your https://pluto-on-binder.glitch.me/ and by trying to configure my own pluto-jupyterlab but couldn't get either to work and frankly I have no idea what I'm doing :)

fonsp commented 4 years ago

Awesome! Let's call soon? It's late today but I'm free the rest of the week

fonsp commented 4 years ago

I'm getting an "internal server error" from binder - was it the same for you?

image

fonsp commented 4 years ago

The next problem is that Flux does not precompile. This is because the precompiation step needs between 4-6GB of RAM (according to my experiments), and binder only has 2GB. The solution is the precompile Flux during the binder build step, which luckily is the default if it's included in the Manifest.toml. I'll look into it!

image

fonsp commented 4 years ago

I'm working on this right now, and while I wait for binder to load I can explain what's going on 😊

Normally, with Jupyter, every binder corresponds to a GitHub repository, with some extra files (like Manifest.toml) to tell binder how to set up the environment.

But for pluto-on-binder.glitch.me, I did something hacky to make it faster to "create a new binder" for your notebook: all links that it generates are actually going to the same binder - all links open the same app, which is just Pluto, with nothing extra. The URL that you provide is included in the URL, which gets passed around and eventually read by Pluto, which uses it to download that notebook live.

image

This works well for notebooks with few dependencies, but in this case this hack will be too slow, and even breaks because of the RAM limit. So instead, we'll do something closer to the classical binder setup (like you are doing already).

This is the first repository that I'm doing this on. 🙂 The repository https://github.com/fonsp/pluto-on-binder wasn't meant to be forked, it's only designed to launch Pluto as quickly as possible, and to capture and run a notebook passed in through the URL.

hdrake commented 4 years ago

Thanks @fonsp – I figured this was the case but didn't really know what would be needed for the classic binder set-up to get it to run a Pluto notebook.

Anyways, I just did a live demo of the for 25 students in a Geoengineering class at MIT and it went great! I'm really excited about using MARGO as an education tool, whether it's a Pluto-binder, your Observable notebooks, or Carbon Plan's javascript web-app. I was hoping to have the students play around with it themselves in a binder but I think we would have run out of time anyhow.

fonsp commented 4 years ago

Very cool! Happy that it went well

fonsp commented 4 years ago

I got it running, but now I am getting errors that ClimateMARGO can't precompile. I will investigate further!

hdrake commented 4 years ago

Hopefully this did it https://github.com/hdrake/ClimateWidgets/commit/4355cb0b2d847b181ca7ec9f2e99dec4e9f4d078, but I still need to test the binder link on the master branch– it's building now while I got out to dinner to celebrate :)

hdrake commented 4 years ago

Binder working beautifully in https://github.com/hdrake/ClimateWidgets/commit/08d0d9d8930429160c7cd7137ae36a43e77e2ecd!

fonsp commented 4 years ago

Glad it works! I have seen connection issues with firefox a couple of times, but hopefully that can be smoothed out over the next couple of weeks :)

hdrake commented 4 years ago

Someone on twitter also mentioned issues with Safari, but they got it working on Chrome later!