binderhub icon indicating copy to clipboard operation
binderhub copied to clipboard

Select pod resources from binder UI

Open jhamman opened this issue 7 years ago • 8 comments

In the last few weeks, a number of folks have asked for specific resources for specific binders. Examples of these requests are:

  • can I have a pod with a GPU in it?
  • can I have a pod with extra memory or CPU?

Kubespawner currently has this functionality through the use of a profile_list.

I'm curious if this is in scope for BinderHub and, if so, what the API would be. I'm imagining a dropdown in the UI that provides the equivalent of the Kubespawner profile list.

jhamman avatar Nov 14 '18 23:11 jhamman

There have been previous discussion on this and one of the questions that keeps coming up is: should the launcher or the creator of a repo control the resource request? What should happen if the request can't be satisfied ("recommended resources" vs "required resources")?

From a technical point of view having the repository (the creator) specify it is tricky because it means BinderHub needs to clone the repository in order to find out.

Part of the reason for #712 is that I want to be able to specify resource requests as part of the launch link.

It would be great if you could drive this discussion forwards so that it gets to a point where we have a concrete suggestion to implement that does what people would like it to do.

betatim avatar Nov 15 '18 08:11 betatim

Yes, I was also thinking about this problem in these terms. Not to make this more complicated but I think there are three options here.

  1. Creator of binder repository prescribes resources. This would look something like the singleuser section in the jupyterhub chart:
  singleuser:
    # start jupyter notebook
    cmd: jupyter-lab
    cloudMetadata:
      enabled: true
    cpu:
      limit: 4
      guarantee: 1
    memory:
      limit: 26G
      guarantee: 4G
    nodeSelector:
      cloud.google.com/gke-nodepool: user-pool

Of course, this is more complicated than most users would like to see but it would allow for significant customization. 2. User selects from a set of preordained resource packages. This would look like the functionality that kubespawner profile_list provides. You might imagine allowing something like what I have below in the binderhub chart:

  {
      'display_name': 'Base Env',
      'default': True,
      'spawner_override': {
          'cpu_limit': 1,
          'mem_limit': '512M',
      }
      'display_name': 'Big Memory Env',
      'spawner_override': {
          'cpu_limit': 48,
          'mem_limit': '96G',
      }
  }, {
      'display_name': 'GPU 2  Env',
      'spawner_override': {
          'cpu_limit': 48,
          'mem_limit': '96G',
          'extra_resource_guarantees': {"nvidia.com/gpu": "2"},
      }
  }
  1. Finally, a more flexible REST-like API could expose these options to the user and the Binder UI could provide options for a bunch of options. This follows #712.

My personal thought, without having gone through the step of truly scoping the work, is that (2) is going to be fairly easy and accomplish most of what we will ever need. I agree that (1) will be hard because the binder would need to be inspected before deploying. (3) also seems like a reasonable option but may expose much more flexibility than is really needed.

jhamman avatar Nov 16 '18 07:11 jhamman

Is there an update on this? Both 1. and 2. would be useful, but 2. would be enough for what we need.

rochaporto avatar Nov 05 '19 23:11 rochaporto

@rochaporto - I don't think anyone has immediate plans to work on this. Without speaking for the binder team, I assume contributions would be welcome.

jhamman avatar Nov 07 '19 00:11 jhamman

We could give this a go if noone has picked it up. If there's ongoing work already please let us know.

rochaporto avatar Apr 30 '20 11:04 rochaporto

@betatim can we go ahead and pick this up?

rochaporto avatar May 04 '20 18:05 rochaporto

This would be very useful

ctr26 avatar Aug 06 '21 05:08 ctr26

Can someone please update the status of this issue?

VladimirVisnovsky avatar Mar 29 '22 12:03 VladimirVisnovsky