Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin-mandated adaptive scaling #462

Open
cslovell opened this issue Nov 29, 2021 · 0 comments
Open

Admin-mandated adaptive scaling #462

cslovell opened this issue Nov 29, 2021 · 0 comments

Comments

@cslovell
Copy link

For those of us in public sector research groups where costs are always an issue, having the ability to run a cluster that mandates adaptive scaling for key user groups would be a fantastic feature that would enable more unrestricted usage. Something like this comes to mind. The idea would be that this would "disable" the ability to "fix" the size of a cluster, and it would always run in adaptive mode.

dask-gateway:
  gateway:
    extraConfig:
      optionHandler: |
        from dask_gateway_server.options import Options, Integer, Float, String
        import logging
        def cluster_options(user):  
            def option_handler(options):
                if ":" not in options.image:
                    raise ValueError("When specifying an image you must also provide a tag")
                extra_labels = {
                    "hub.jupyter.org/username": user.name,
                    "dask/username": user.name,
                }
                if "dask-high-compute-users" in user.groups:
                  return {
                      "worker_cores": options.worker_cores,
                      "worker_memory": int(options.worker_memory * 2 ** 30),
                      "image": options.image,
                      "scheduler_extra_pod_labels": extra_labels,
                      "worker_extra_pod_labels": extra_labels,
                      "cluster_max_workers": 32,
                  }
                else: 
                  return {
                    "worker_cores": options.worker_cores,
                      "worker_memory": int(options.worker_memory * 2 ** 30),
                      "image": options.image,
                      "scheduler_extra_pod_labels": extra_labels,
                      "worker_extra_pod_labels": extra_labels,
                      "cluster_max_workers": 32,
                      "apative":  true, 
                      "adaptive_min_workers": 0,
                    }
            return Options(
                Float("worker_cores", default=0.8, min=0.8, max=0.8, label="Worker Cores"),
                Float("worker_memory", default=3.3, min=3.3, max=3.3, label="Worker Memory (GiB)"),
                String("image", default="pangeo/base-notebook:2021.05.04", label="Image"),
                handler=option_handler,
            )
        c.Backend.cluster_options = cluster_options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant