A quick idea: sometimes we have users that want Binder sessions to persist for longer periods of time. In my experience, this is usually people that want students to take a break (e.g. go for lunch), then return to their work. It usually happens on the order of ~an hour or two.
Currently, their session will be culled for inactivity relatively quickly. However, what if we added a "keep my session alive" option somewhere in BinderHub that would prevent the culler from killing the session for inactivity. We could still enforce the 7hr rule, but at least people's sessions wouldn't be killed after 15-20 minutes if they explicitly asked for it...
This is probably more complicated, but a way to make it so that only people who need it do it, would be to activate it via the original binder, like if I make the binder, I could maybe specify that I need the extended time and activate it for those who then access mybinder within a period of say the 7hrs. Then anyone who access my binder within those 7hrs gets the extended time, but only for that time. That could be useful so that the expiration comes from the source not each individual copy. I hope that makes sense.
@gacafe I agree this would be better from a user's perspective, though we need to balance this against our constraint of running a giant public webservice for free that is entirely funded from grants :-)
I am in two minds about this. Adding such a feature would make mybinder.org better and more expensive to operate. However we can highlight better how to configure the timeouts if you are hosting your own binderhub or add a feature that will apply different timeouts based on what organisation the source repository is hosted in. So I can configure timsbinder.com to give extra long timeouts to all repositories hosted on github.com/tims-excellent-workshops/
Maybe we should discuss activating or not activating such a feature on https://github.com/jupyterhub/mybinder.org-deploy/ as it is a decision about the public demo?
I very much like this idea! I would be happy to register my org with mybinder.org as a show that we use it, support it and find it useful. I would also be willing to pay some fee to extend the time (for a limited period of time like 7hrs) as I would consider it a useful tool for the workshop!
If we have some kind of mechanism set up where people could pay in order to have more resources / longer timeout / etc, then I think this wouldn't be as big of a deal.
@betatim definitely agree we should expose this in binderhub one way or another 馃憤
In a tutorial we held this week, we experienced the timeouts鈥擨 think that's what it was, as notebooks seemed to freeze, with [*] forever on executing a cell. This happened when the students were working with two notebooks at the same time. One was a new notebook to try things out, the other was the "official" lesson notebook.
We just had the students do "Restart and run all" and that seemed to bring the notebook back to life, so no work was lost.
Do you have a link to the materials? This will make it easier to give concrete feedback/ideas.
If you could press "restart&run all" then it was not the timeout because when that happens your whole server is stopped and removed.
Depending on what is in the notebooks you might have hit the memory limit or all your users were on the same node so when they were all running a CPU intensive cell at the same time there was not enough CPU available.
It was a tutorial for total beginners (high-school students!)... no CPU-intensive stuff!
https://github.com/barbagroup/Caminos
Interesting. It seemed like time-out issue because it happened after a side discussion and leaving a notebook alone for a long(ish) time.
I think I managed to reproduce this by opening your repo, running the first few cells (till after youtube video) of 3--Earth_temperature_over_time.ipynb and then leaving the tab open in my browser for a while and doing something else.
When I return the next cell indeed "hangs" with a [*] prompt but the kernel busy indicator at the top right doesn't change. I can reload the tree view and reopen the notebook.
So I think this is a timeout but different from what I originally thought! I think we started configuring the notebook server so that kernels get shutdown if they were inactive and then at a later point the notebook server shuts down (at which point the pod vanishes).
To investigate this further and fix it we should probably move to a new issue as this one is about extending timeouts by sending us money (coughcough) and the new issue would be debugging current behaviour.
Sounds good. When teaching with notebooks, I commonly have students open an empty notebook to try things out, while having the prepared-lesson notebook in another tab. So it's common for a notebook to stay open for a while with no activity.
This issue wasn't _originally_ about charging for extended time outs ...
It sounds like we want to loosen the "kernel culling" behavior a little bit either way, right @betatim ? As in, a notebook kernel shouldn't be shut down unless it's seen quite a long time without activity.
re: money etc being a different issue, the challenge here that giving people more CPU/RAM/time/etc will require more $$$ which only comes from us at this point, so conversations about how to technically make this possible need to happen alongside conversations about how to socially/organizationally make this possible.
I think this was added specifically because people leave their tabs open which keeps generating "activity" even though they've long ago forgotten about this session. I think (but someone should measure it with a stop watch) the current behaviour is inline with our policy that "if you don't use it for 10minutes your binder will timeout".
As such I would put extending this time out on the list of things to enable once we have additional funding to pay for the cost. As an alternative I would suggest setting up your own JupyterHub for a workshop. This doesn't cost a lot as everyone only has to pay for the resources for their workshop and has the added benefit that you know you have enough resources/no outages.
A timeout that allows one to restart the kernel to 'come back to life' in the same tab is good enough for the one-off workshop situation, like we experienced. I just didn't know and discovered by chance the behavior. (What would be a drag is to have to re-lauch from the Binder button.)
We do have a Jupyter Hub at GW that was set up for my class, working with university SSO. Since these were outside visitors (high-school students), I didn't plan ahead enough to get them an account set up.
@labarba have you heard of "The Littlest JupyterHub"? (http://tljh.jupyter.org/) it's a single-VM deployment of a JupyterHub that is meant for small classes or workshops, and is much more lightweight to deploy. Just an FYI in case you didn't hear about it, since it is quite new :-)
just a thought here, but would a command like "watch -n5 echo hello" do the trick for keeping binders open for like... an hour or two? Since the timeout is 7 hours for active sessions? Or is it monitoring kernels instead? In which case, maybe run through a notebook by prepending with !?
On that point - I think I'm a fan of keeping this a "hacky workaround" kind of option rather than encouraging it with a button. Perhaps somebody can write up a little how-to point in the commmunity forum? Otherwise I kinda feel like we should just close this one, since I doubt we'll officially add a button any time soon
@mathematicalmichael For keeping a notebook used for a presentation alive, maybe a simple package (binderhacks?!) that can be used to run a periodic asyncio call loaded in at the start of the notebook (binderhacks.keepalive()?!)?
Most helpful comment
I am in two minds about this. Adding such a feature would make mybinder.org better and more expensive to operate. However we can highlight better how to configure the timeouts if you are hosting your own binderhub or add a feature that will apply different timeouts based on what organisation the source repository is hosted in. So I can configure timsbinder.com to give extra long timeouts to all repositories hosted on github.com/tims-excellent-workshops/
Maybe we should discuss activating or not activating such a feature on https://github.com/jupyterhub/mybinder.org-deploy/ as it is a decision about the public demo?