mybinder.org-deploy icon indicating copy to clipboard operation
mybinder.org-deploy copied to clipboard

Request for longer user session during a class

Open Guillaume-Garrigos opened this issue 4 years ago • 11 comments

Hello,

I do not know if you accept this kind of requests, but I would like to know if it is possible to ask for an extension of the user sessions during a class? My motivation for asking that is that, during the online training session we give, we alternate between letting the students code, and then giving explanations on what is going on, which is a time where conversation takes place with the students. And if we happen to be too talkative... The students session ends.

I feel like the session time is set to something like 10+ minutes, could it be possible to make it longer? I think 20 minutes would already relax a bit the things (given that the class is 1h30 long).

Thanks for your consideration, and my apologises if the request is innapropriate, I couldn't find documentation about what it is possible to ask or not.

1. Who you are

My name is Guillaume Garrigos, I'm an associate professor at the Univeristy of Paris.

2. A few details about the event/course/context

This course is a 3rd year undergrad Optimization class held at the University of Paris between Januray 2021 and May 2021.

3. If money is changing hands (attendees pay a fee, speaker is getting paid, free, etc)

Not really, apart from the fact that I am paid by my University for teaching, and that the students pay between 0-200€ for the year scholarship.

4. A link to the repository you are using

https://gitlab.math.univ-paris-diderot.fr/garrigos/l3optim-tp

5. What type of event it is:

  • [ ] talk
  • [ ] workshop
  • [ ] lecture course
  • [X] training session

6. How many people you expect to attend the event

Maximum 40 students per event.

7. The exact times and dates of the event(s) (with timezone information)

Wednesdays 16h00-17h30 (UTC+1) Thursdays 10h45-12h15 (UTC+1)

From February 12th to April 15th. The class will actually not be held every week, but more like 1 week every 2 weeks, on an irregular basis. I can give more details if needed.

8. How do you plan to give mybinder.org a shout out at the event

Dedicate at the beggining of the class page a space thanking the mybinder.org organization.

Guillaume-Garrigos avatar Feb 04 '21 09:02 Guillaume-Garrigos

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Feb 04 '21 09:02 welcome[bot]

Idle configuration is not something that I think is easily customizable per-repo at this point.

The maximum session time is 6 hours, if it is actively used during this time. Sessions will be shutdown after 10 minutes of inactivity, though.

If you are seeing sessions consistently end after only 10 minutes, that sounds like Binder might not be registering your activity as 'active'. Can you describe how you are using Binder?

minrk avatar Feb 04 '21 13:02 minrk

Sorry, it seems that I used the wrong terminology. I do not want to extend the "session time" (which is more than okay since my class is 1h30 long), but the time after which the session is "shutdown after inactivity".

I ask this because the way I use Binder naturally involves times at which my students won't be coding, but instead listening to me on a visioconference for around 10+ minutes.

Guillaume-Garrigos avatar Feb 04 '21 14:02 Guillaume-Garrigos

I wonder if you could provide binder links to each notebook, using the ?filepath= query in the URL and structure your course such as:

  • Some listening/dicussion time
  • Launch notebook X and work
  • Rinse and repeat...

That way it doesn't matter if the session times out during your discussions because you'll be moving onto the next notebook. Does that sound easily possible or not really? The images will still only need to be built by Binder once, the ?filepath= query just launches a specific/different notebook when launched.

sgibson91 avatar Feb 09 '21 09:02 sgibson91

Hi @sgibson91

Honestly I do not think this is viable from a pedagogical point of view :/

It is important for my students to know that at any time when working they can ping me up about a problem, and that I can make a break to explain something to everyone. In those times of online teaching, this "interactivity" is important.

On my side I tried to understand how mybinder.org evaluate when a user is active or not. It seems that running a computation in the background is not considered as being "active"? This is evaluated in terms of whether the window/tab is open?

Edit : typo

Guillaume-Garrigos avatar Feb 09 '21 10:02 Guillaume-Garrigos

@Guillaume-Garrigos you can also have a look at http://notebooks.gesis.org, which runs a deployment of "Persistent" BinderHub. But the students would have to sign up on this. They could even persist their work for the whole semester too, as all the changes they make are saved on a volume.

MridulS avatar Feb 09 '21 10:02 MridulS

Hi @Guillaume-Garrigos,

The inactivity timeout for the persistent BinderHub is 40 minutes, but you / your students may come back even after that (it's persistent :smirk:). The only downside is that a one-time registration is required.

You can also create persistent launch URLs - all you need to do is to swap the mybinder.org part in any given launch URL with notebooks.gesis.org/services/binder, e.g. the launch URL

http://mybinder.org/v2/gh/binder-examples/requirements/master

becomes

http://notebooks.gesis.org/services/binder/v2/gh/binder-examples/requirements/master

We've made a short (yet somewhat janky) demo vid -> the relevant part starts at 3:48

However, we are certainly more on the experimental side :beetle:, and I would recommend that your repository launches with mybinder as well :thumbsup:

arnim avatar Feb 09 '21 20:02 arnim

I tried to understand how mybinder.org evaluate when a user is active or not

There are two metrics for this:

  1. the 'network' activity, tracked by the proxy, is any messages back and forth between the browser and the notebook server. This means any navigation, file editing/saving, execution, output, terminal activity, etc. counts as activity. This network-level tracking does not currently have access to info like whether code is running silently while producing no output.
  2. the notebook server's internal culler, which does things like shutdown idle kernels. This internal culler does know about busy kernels, and in general can make smarter, more granular decisions about culling, but isn't always available so we cannot rely on it.

Since this isn't the first time we've heard this feedback before, perhaps we should be relying more on the internal culler for the shorter window, and relax the connectivity window to e.g. 20 minutes. We can explore how that affects average session duration.

Something we see from folks (especially those intending to abuse mybinder.org :/) to get around this is to do their own 'keepalive' running something that constantly produces output, e.g. create a terminal or console that does:

# bash
while true; do
  sleep 60
  echo .
done

or in a Python console:

while True:
     time.sleep(60)
     print('.')

I wouldn't say I recommend doing this, but it does ensure there is constant activity.

minrk avatar Feb 11 '21 09:02 minrk

@MridulS & @arnim thanks for the pointers to the gesis notebooks, I wasn't aware of it. I might consider it as an alternative for this semester if my request fails (by fall 2021 our teaching department should launch our own jupyterhub/cocalc server anyway).

@minrk there is indeed the possibility to trick mybinder.org with this kind of script. Actually running the time.sleep together in a different thread would allow the user to keep coding in parallel. That definitively solves my problem, but it is clearly cheating , and I do not want to violate any mybinder.org policy.

How would you feel if I was using such trick fairly, providing as much guarantees as I can so that it does not blow up your servers? I can think about the following:

  • whatever code will be used to run something in the background will be hidden in a separate file not directly accessible to the students (I only give them links to the notebook directly, not the folder)
  • the code maintains the kernel awake for a fixed amount of time (in my case : 1h30)
  • the code can be run only once within a session

Guillaume-Garrigos avatar Feb 11 '21 10:02 Guillaume-Garrigos

@Guillaume-Garrigos I wouldn't ever call you cheating if you are working around Binder not actually working as intended. Our goal is to delete the instance "when you leave" but we have to resort the heuristics to detect that event, especially when we have folks leaving tabs open in the background for hours or days. It doesn't capture all possible cases. There's a difference between "I'm actively using it, but Binder can't tell" and "I'm not actively using it, hold onto these resources anyway". I don't want this to become a common practice, but it's a reasonable workaround while idle-deletion is too aggressive.

BTW, are you using classic notebook or jupyterlab? I believe jupyterlab actively polls the server to keep its UI up to date as long as the tab has focus, so if you aren't using JupyterLab, switching to lab might be all you need to do. So as long as a jupyterlab tab has focus, I don't believe it will be shutdown.

minrk avatar Feb 16 '21 11:02 minrk

@minrk Thanks for your feedback, and I'm glad to see that we are on the same line.

we have to resort the heuristics to detect that event, especially when we have folks leaving tabs open in the background for hours or days

Yeah, that problem for sure is complicated as there are many kind of different usages. I think a good enough and flexible soution could be what this comment suggests.

BTW, are you using classic notebook or jupyterlab?

Classic notebooks! I actually didn't know I could us mybinder with jupyterlab... But i think i'll stick to the classic notebooks since the students are familiar with it, and that I have overriden the inactivity problem. For the sake of completeness, here is the code I'm gonna be using, that I call in my students notebooks with

import mybinder
mybinder.start_session()

Guillaume-Garrigos avatar Feb 16 '21 18:02 Guillaume-Garrigos