Configuration Reference

Gateway

class dask_gateway_server.app.DaskGateway(**kwargs)

A gateway for managing dask clusters across multiple users

config c.DaskGateway.authenticator_class = Type('dask_gateway_server.auth.DummyAuthenticator')

The gateway authenticator class to use

config c.DaskGateway.check_cluster_timeout = Float(10)

Timeout (in seconds) before deciding a cluster is no longer active.

When the gateway restarts, any clusters still marked as active have their status checked. This timeout sets the max time we allocate for checking a cluster’s status before deciding that the cluster is no longer active.

config c.DaskGateway.cluster_manager_class = Type('dask_gateway_server.managers.local.UnsafeLocalClusterManager')

The gateway cluster manager class to use

config c.DaskGateway.cluster_manager_options = Instance('')

User options for configuring the cluster manager.

Allows users to specify configuration overrides when creating a new cluster manager. See the documentation for more information.

config c.DaskGateway.config_file = Unicode('dask_gateway_config.py')

The config file to load

config c.DaskGateway.cookie_max_age_days = Float(7)

Number of days for a login cookie to be valid. Default is one week.

config c.DaskGateway.cookie_secret = Bytes(b'')

The cookie secret to use to encrypt cookies.

Loaded from the DASK_GATEWAY_COOKIE_SECRET environment variable by default.

config c.DaskGateway.db_cleanup_period = Float(600)

Time (in seconds) between database cleanup tasks.

This sets how frequently old records are removed from the database. This shouldn’t be too small (to keep the overhead low), but should be smaller than db_record_max_age (probably by an order of magnitude).

config c.DaskGateway.db_cluster_max_age = Float(86400)

Max time (in seconds) to keep around records of completed clusters.

Every db_cleanup_period, completed clusters older than db_cluster_max_age are removed from the database.

config c.DaskGateway.db_debug = Bool(False)

If True, all database operations will be logged

config c.DaskGateway.db_encrypt_keys = List('')

A list of keys to use to encrypt private data in the database. Can also be set by the environment variable DASK_GATEWAY_ENCRYPT_KEYS, where the value is a ; delimited string of encryption keys.

Each key should be a base64-encoded 32 byte value, and should be cryptographically random. Lacking other options, openssl can be used to generate a single key via:

$ openssl rand -base64 32

A single key is valid, multiple keys can be used to support key rotation.

config c.DaskGateway.db_url = Unicode('sqlite:///:memory:')

The URL for the database. Default is in-memory only.

If not in-memory, db_encrypt_keys must also be set.

config c.DaskGateway.gateway_url = Unicode('')

The URL that Dask clients will connect to

config c.DaskGateway.log_datefmt = Unicode('%Y-%m-%d %H:%M:%S')

The date format used by logging formatters for %(asctime)s

config c.DaskGateway.log_format = Unicode('%(color)s[%(levelname)1.1s %(asctime)s.%(msecs).03d %(name)s]%(end_color)s %(message)s')

The Logging format template

config c.DaskGateway.log_level = Enum('INFO')

Set the log level by value or name.

config c.DaskGateway.private_connect_url = Unicode('')

The address that the private URL can be connected to.

Useful if the address the gateway should listen at is different than the address it’s reachable at (by e.g. the web proxy).

Defaults to private_url.

config c.DaskGateway.private_url = Unicode('http://127.0.0.1:0')

The gateway’s private URL, used for internal communication.

This must be reachable from the web proxy, but shouldn’t be publicly accessible (if possible). Default is http://127.0.0.1:{random-port}.

config c.DaskGateway.public_connect_url = Unicode('')

The address that the public URL can be connected to.

Useful if the address the web proxy should listen at is different than the address it’s reachable at (by e.g. the scheduler/workers).

Defaults to public_url.

config c.DaskGateway.public_url = Unicode('http://:8000')

The public facing URL of the whole Dask Gateway application

config c.DaskGateway.stop_clusters_on_shutdown = Bool(True)

Whether to stop active clusters on gateway shutdown.

If true, all active clusters will be stopped before shutting down the gateway. Set to False to leave active clusters running.

config c.DaskGateway.temp_dir = Unicode('')

Path to a directory to use to store temporary runtime files.

The permissions on this directory must be restricted to 0o700. If the directory doesn’t already exist, it will be created on startup and removed on shutdown.

The default is to create a temporary directory "dask-gateway-<UUID>" in the system tmpdir default location.

config c.DaskGateway.tls_cert = Unicode('')

Path to TLS certificate file for the public url of the web proxy.

When setting this, you should also set tls_key.

config c.DaskGateway.tls_key = Unicode('')

Path to TLS key file for the public url of the web proxy.

When setting this, you should also set tls_cert.

Cluster Manager Options

class dask_gateway_server.options.Options(*fields, handler=None)

A description of cluster options.

Parameters
  • *fields (Field) – Zero or more configurable fields.

  • handler (callable, optional) – A callable with the signature handler(options), where options is the validated dict of user options. Should return a dict of configuration overrides to forward to the cluster manager. If not provided, the default will return the options unchanged.

class dask_gateway_server.options.Integer(field, default=0, min=None, max=None, label=None, target=None)

An integer option field.

Parameters
  • field (str) – The field name to use. Must be a valid Python variable name. This will be the keyword user’s use to set this field programmatically (e.g. "worker_cores").

  • default (int, optional) – The default value. Default is 0.

  • min (int, optional) – The minimum valid value (inclusive). Unbounded if not set.

  • max (int, optional) – The maximum valid value (inclusive). Unbounded if not set.

  • label (str, optional) – A human readable label that will be used in GUI representations (e.g. "Worker Cores"). If not provided, field will be used.

  • target (str, optional) – The target parameter to set in the processed options dict. Must be a valid Python variable name. If not provided, field will be used.

class dask_gateway_server.options.Float(field, default=0, min=None, max=None, label=None, target=None)

A float option field.

Parameters
  • field (str) – The field name to use. Must be a valid Python variable name. This will be the keyword user’s use to set this field programmatically (e.g. "worker_cores").

  • default (float, optional) – The default value. Default is 0.

  • min (float, optional) – The minimum valid value (inclusive). Unbounded if not set.

  • max (float, optional) – The maximum valid value (inclusive). Unbounded if not set.

  • label (str, optional) – A human readable label that will be used in GUI representations (e.g. "Worker Cores"). If not provided, field will be used.

  • target (str, optional) – The target parameter to set in the processed options dict. Must be a valid Python variable name. If not provided, field will be used.

class dask_gateway_server.options.String(field, default='', label=None, target=None)

A string option field.

Parameters
  • field (str) – The field name to use. Must be a valid Python variable name. This will be the keyword user’s use to set this field programmatically (e.g. "worker_cores").

  • default (str, optional) – The default value. Default is the empty string ("").

  • label (str, optional) – A human readable label that will be used in GUI representations (e.g. "Worker Cores"). If not provided, field will be used.

  • target (str, optional) – The target parameter to set in the processed options dict. Must be a valid Python variable name. If not provided, field will be used.

class dask_gateway_server.options.Bool(field, default=False, label=None, target=None)

A boolean option field.

Parameters
  • field (str) – The field name to use. Must be a valid Python variable name. This will be the keyword user’s use to set this field programmatically (e.g. "worker_cores").

  • default (bool, optional) – The default value. Default is False.

  • label (str, optional) – A human readable label that will be used in GUI representations (e.g. "Worker Cores"). If not provided, field will be used.

  • target (str, optional) – The target parameter to set in the processed options dict. Must be a valid Python variable name. If not provided, field will be used.

class dask_gateway_server.options.Select(field, options, default=None, label=None, target=None)

An option field asking users to select between a few choices.

Parameters
  • field (str) – The field name to use. Must be a valid Python variable name. This will be the keyword user’s use to set this field programmatically (e.g. "worker_cores").

  • options (list) – A list of valid options. Elements may be a tuple of (key, value), or just key (in which case the value is the same as the key). Values may be any Python object, keys must be strings.

  • default (str, optional) – The key for the default option. Defaults to the first listed option.

  • label (str, optional) – A human readable label that will be used in GUI representations (e.g. "Worker Cores"). If not provided, field will be used.

  • target (str, optional) – The target parameter to set in the processed options dict. Must be a valid Python variable name. If not provided, field will be used.

User Limits

class dask_gateway_server.limits.UserLimits(**kwargs)

Manages restrictions for user resource usage

config c.UserLimits.max_clusters = Int(0)

The maximum number of clusters available for each user.

Set to 0 for no limit (default).

config c.UserLimits.max_cores = Float(0)

The maximum number of cores available for each user.

Set to 0 for no limit (default).

config c.UserLimits.max_memory = MemoryLimit(0)

The maximum amount of memory (in bytes) available to each user. Can be an integer, or a string with one of the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

Set to 0 for no limit (default).

Proxies

Web Proxy

class dask_gateway_server.proxy.WebProxy(**kwargs)

A proxy for proxying out the dashboards from behind a firewall

config c.WebProxy.api_connect_url = Unicode('')

The address that the api URL can be connected to.

Useful if the address the api server should listen at is different than the address it’s reachable at (by e.g. the gateway).

Defaults to api_url.

config c.WebProxy.api_url = Unicode('http://127.0.0.1:0')

The address for configuring the Proxy.

This is the address that the Dask Gateway will connect to when adding/removing routes. This must be reachable from the Dask Gateway server, but shouldn’t be publicly accessible (if possible). Defaults to 127.0.0.1:{random-port}.

config c.WebProxy.auth_token = Unicode('')

The Proxy auth token

Loaded from the DASK_GATEWAY_PROXY_TOKEN env variable by default.

config c.WebProxy.connect_timeout = Float(10.0)

Timeout (in seconds) from init until the proxy process is connected.

config c.WebProxy.externally_managed = Bool(False)

Whether the proxy process is externally managed.

If False (default), the proxy process will be started and stopped by the gateway process. Set to True if the proxy will be started via some external manager (e.g. supervisord).

config c.WebProxy.log_level = CaselessStrEnum('warn')

The proxy log-level.

Scheduler Proxy

class dask_gateway_server.proxy.SchedulerProxy(**kwargs)

A proxy for connecting Dask clients to schedulers behind a firewall.

config c.SchedulerProxy.api_connect_url = Unicode('')

The address that the api URL can be connected to.

Useful if the address the api server should listen at is different than the address it’s reachable at (by e.g. the gateway).

Defaults to api_url.

config c.SchedulerProxy.api_url = Unicode('http://127.0.0.1:0')

The address for configuring the Proxy.

This is the address that the Dask Gateway will connect to when adding/removing routes. This must be reachable from the Dask Gateway server, but shouldn’t be publicly accessible (if possible). Defaults to 127.0.0.1:{random-port}.

config c.SchedulerProxy.auth_token = Unicode('')

The Proxy auth token

Loaded from the DASK_GATEWAY_PROXY_TOKEN env variable by default.

config c.SchedulerProxy.connect_timeout = Float(10.0)

Timeout (in seconds) from init until the proxy process is connected.

config c.SchedulerProxy.externally_managed = Bool(False)

Whether the proxy process is externally managed.

If False (default), the proxy process will be started and stopped by the gateway process. Set to True if the proxy will be started via some external manager (e.g. supervisord).

config c.SchedulerProxy.log_level = CaselessStrEnum('warn')

The proxy log-level.

Authentication

Kerberos

class dask_gateway_server.auth.KerberosAuthenticator(**kwargs)

An authenticator using kerberos

config c.KerberosAuthenticator.keytab = Unicode('dask_gateway.keytab')

The path to the keytab file

config c.KerberosAuthenticator.service_name = Unicode('HTTP')

The service’s kerberos principal name.

This is almost always “HTTP” (the default)

Basic

class dask_gateway_server.auth.DummyAuthenticator(**kwargs)

A simple authenticator that uses Basic Auth.

This is highly insecure, use only for testing!!!

config c.DummyAuthenticator.password = Unicode(None)

If set, a global password that all users must provide.

If unset (default), the password field is completely ignored.

Cluster Managers

Local Processes

LocalClusterManager

class dask_gateway_server.managers.local.LocalClusterManager(**kwargs)

A cluster manager that launches local processes.

Requires super-user permissions in order to run processes for the requesting username.

config c.LocalClusterManager.cluster_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask cluster.

config c.LocalClusterManager.cluster_status_period = Float(30)

Time (in seconds) between cluster status checks.

A smaller period will detect failed clusters sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

config c.LocalClusterManager.clusters_directory = Unicode('')

The base directory for cluster working directories.

A subdirectory will be created for each new cluster which will serve as the working directory for that cluster. On cluster shutdown the subdirectory will be removed.

config c.LocalClusterManager.environment = Dict('')

Environment variables to set for both the worker and scheduler processes.

config c.LocalClusterManager.inherited_environment = List('')

Whitelist of environment variables for the scheduler and worker processes to inherit from the Dask-Gateway process.

config c.LocalClusterManager.scheduler_cmd = Unicode('dask-gateway-scheduler')

Shell command to start a dask-gateway scheduler.

config c.LocalClusterManager.scheduler_cores = Int(1)

Number of cpu-cores available for a dask scheduler.

config c.LocalClusterManager.scheduler_memory = MemoryLimit('2 G')

Number of bytes available for a dask scheduler. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.LocalClusterManager.sigint_timeout = Int(10)

Seconds to wait for process to stop after SIGINT.

If the process has not stopped after this time, a SIGTERM is sent.

config c.LocalClusterManager.sigkill_timeout = Int(5)

Seconds to wait for process to stop after SIGKILL.

If the process has not stopped after this time, a warning is logged and the process is deemed a zombie process.

config c.LocalClusterManager.sigterm_timeout = Int(5)

Seconds to wait for process to stop after SIGTERM.

If the process has not stopped after this time, a SIGKILL is sent.

config c.LocalClusterManager.worker_cmd = Unicode('dask-gateway-worker')

Shell command to start a dask-gateway worker.

config c.LocalClusterManager.worker_cores = Int(1)

Number of cpu-cores available for a dask worker.

config c.LocalClusterManager.worker_memory = MemoryLimit('2 G')

Number of bytes available for a dask worker. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.LocalClusterManager.worker_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask worker.

config c.LocalClusterManager.worker_status_period = Float(30)

Time (in seconds) between worker status checks.

A smaller period will detect failed workers sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

UnsafeLocalClusterManager

class dask_gateway_server.managers.local.UnsafeLocalClusterManager(**kwargs)

A version of LocalClusterManager that doesn’t set permissions.

FOR TESTING ONLY! This provides no user separations - clusters run with the same level of permission as the gateway.

config c.UnsafeLocalClusterManager.cluster_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask cluster.

config c.UnsafeLocalClusterManager.cluster_status_period = Float(30)

Time (in seconds) between cluster status checks.

A smaller period will detect failed clusters sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

config c.UnsafeLocalClusterManager.clusters_directory = Unicode('')

The base directory for cluster working directories.

A subdirectory will be created for each new cluster which will serve as the working directory for that cluster. On cluster shutdown the subdirectory will be removed.

config c.UnsafeLocalClusterManager.environment = Dict('')

Environment variables to set for both the worker and scheduler processes.

config c.UnsafeLocalClusterManager.inherited_environment = List('')

Whitelist of environment variables for the scheduler and worker processes to inherit from the Dask-Gateway process.

config c.UnsafeLocalClusterManager.scheduler_cmd = Unicode('dask-gateway-scheduler')

Shell command to start a dask-gateway scheduler.

config c.UnsafeLocalClusterManager.scheduler_cores = Int(1)

Number of cpu-cores available for a dask scheduler.

config c.UnsafeLocalClusterManager.scheduler_memory = MemoryLimit('2 G')

Number of bytes available for a dask scheduler. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.UnsafeLocalClusterManager.sigint_timeout = Int(10)

Seconds to wait for process to stop after SIGINT.

If the process has not stopped after this time, a SIGTERM is sent.

config c.UnsafeLocalClusterManager.sigkill_timeout = Int(5)

Seconds to wait for process to stop after SIGKILL.

If the process has not stopped after this time, a warning is logged and the process is deemed a zombie process.

config c.UnsafeLocalClusterManager.sigterm_timeout = Int(5)

Seconds to wait for process to stop after SIGTERM.

If the process has not stopped after this time, a SIGKILL is sent.

config c.UnsafeLocalClusterManager.worker_cmd = Unicode('dask-gateway-worker')

Shell command to start a dask-gateway worker.

config c.UnsafeLocalClusterManager.worker_cores = Int(1)

Number of cpu-cores available for a dask worker.

config c.UnsafeLocalClusterManager.worker_memory = MemoryLimit('2 G')

Number of bytes available for a dask worker. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.UnsafeLocalClusterManager.worker_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask worker.

config c.UnsafeLocalClusterManager.worker_status_period = Float(30)

Time (in seconds) between worker status checks.

A smaller period will detect failed workers sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

YARN

YarnClusterManager

class dask_gateway_server.managers.yarn.YarnClusterManager(**kwargs)

A cluster manager for deploying Dask on a YARN cluster.

config c.YarnClusterManager.cluster_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask cluster.

config c.YarnClusterManager.cluster_status_period = Float(30)

Time (in seconds) between cluster status checks.

A smaller period will detect failed clusters sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

config c.YarnClusterManager.environment = Dict('')

Environment variables to set for both the worker and scheduler processes.

config c.YarnClusterManager.keytab = Unicode(None)

Path to kerberos keytab for Dask Gateway user

config c.YarnClusterManager.localize_files = Dict('')

Extra files to distribute to both the worker and scheduler containers.

This is a mapping from local-name to resource. Resource paths can be local, or in HDFS (prefix with hdfs://... if so). If an archive (.tar.gz or .zip), the resource will be unarchived as directory local-name. For finer control, resources can also be specified as skein.File objects, or their dict equivalents.

This can be used to distribute conda/virtual environments by configuring the following:

c.YarnClusterManager.localize_files = {
    'environment': {
        'source': 'hdfs:///path/to/archived/environment.tar.gz',
        'visibility': 'public'
    }
}
c.YarnClusterManager.scheduler_setup = 'source environment/bin/activate'
c.YarnClusterManager.worker_setup = 'source environment/bin/activate'

These archives are usually created using either conda-pack or venv-pack. For more information on distributing files, see https://jcrist.github.io/skein/distributing-files.html.

config c.YarnClusterManager.principal = Unicode(None)

Kerberos principal for Dask Gateway user

config c.YarnClusterManager.queue = Unicode('default')

The YARN queue to submit applications under

config c.YarnClusterManager.scheduler_cmd = Unicode('dask-gateway-scheduler')

Shell command to start a dask-gateway scheduler.

config c.YarnClusterManager.scheduler_cores = Int(1)

Number of cpu-cores available for a dask scheduler.

config c.YarnClusterManager.scheduler_memory = MemoryLimit('2 G')

Number of bytes available for a dask scheduler. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.YarnClusterManager.scheduler_setup = Unicode('')

Script to run before dask scheduler starts.

config c.YarnClusterManager.worker_cmd = Unicode('dask-gateway-worker')

Shell command to start a dask-gateway worker.

config c.YarnClusterManager.worker_cores = Int(1)

Number of cpu-cores available for a dask worker.

config c.YarnClusterManager.worker_memory = MemoryLimit('2 G')

Number of bytes available for a dask worker. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.YarnClusterManager.worker_setup = Unicode('')

Script to run before dask worker starts.

config c.YarnClusterManager.worker_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask worker.

config c.YarnClusterManager.worker_status_period = Float(30)

Time (in seconds) between worker status checks.

A smaller period will detect failed workers sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

Kubernetes

KubeClusterManager

class dask_gateway_server.managers.kubernetes.KubeClusterManager(*args, **kwargs)

A cluster manager for deploying Dask on a Kubernetes cluster.

config c.KubeClusterManager.cluster_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask cluster.

config c.KubeClusterManager.cluster_status_period = Float(30)

Time (in seconds) between cluster status checks.

A smaller period will detect failed clusters sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

config c.KubeClusterManager.common_annotations = Dict('')

Kubernetes annotations to apply to all objects created by the gateway

config c.KubeClusterManager.common_labels = Dict('')

Kubernetes labels to apply to all objects created by the gateway

config c.KubeClusterManager.environment = Dict('')

Environment variables to set for both the worker and scheduler processes.

config c.KubeClusterManager.image = Unicode('daskgateway/dask-gateway:latest')

Docker image to use for running user’s containers.

config c.KubeClusterManager.image_pull_policy = Unicode('IfNotPresent')

The image pull policy of the docker image specified in image

config c.KubeClusterManager.namespace = Unicode('default')

Kubernetes namespace to launch pods in.

If running inside a kubernetes cluster with service accounts enabled, defaults to the current namespace. If not, defaults to default

config c.KubeClusterManager.scheduler_cmd = Unicode('dask-gateway-scheduler')

Shell command to start a dask-gateway scheduler.

config c.KubeClusterManager.scheduler_cores = Float(1)

Number of cpu-cores available for a dask scheduler.

config c.KubeClusterManager.scheduler_cores_limit = Float(0.0)

Maximum number of cpu-cores available for a dask scheduler.

Defaults to scheduler_cores.

config c.KubeClusterManager.scheduler_extra_container_config = Dict('')

Any extra configuration for the scheduler container.

This dict will be deep merged with the scheduler container (a V1Container object) before submission. Keys should match those in the kubernetes spec, and should be camelCase.

See worker_extra_container_config for more information.

config c.KubeClusterManager.scheduler_extra_pod_config = Dict('')

Any extra configuration for the scheduler pods.

This dict will be deep merged with the scheduler pod spec (a V1PodSpec object) before submission. Keys should match those in the kubernetes spec, and should be camelCase.

See worker_extra_pod_config for more information.

config c.KubeClusterManager.scheduler_memory = MemoryLimit('2 G')

Number of bytes available for a dask scheduler. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.KubeClusterManager.scheduler_memory_limit = MemoryLimit(0)

Maximum number of bytes available for a dask scheduler. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

Defaults to scheduler_memory.

config c.KubeClusterManager.worker_cmd = Unicode('dask-gateway-worker')

Shell command to start a dask-gateway worker.

config c.KubeClusterManager.worker_cores = Float(1)

Number of cpu-cores available for a dask worker.

config c.KubeClusterManager.worker_cores_limit = Float(0.0)

Maximum number of cpu-cores available for a dask worker.

Defaults to worker_cores.

config c.KubeClusterManager.worker_extra_container_config = Dict('')

Any extra configuration for the worker container.

This dict will be deep merged with the worker container (a V1Container object) before submission. Keys should match those in the kubernetes spec, and should be camelCase.

For example, here we add environment variables from a secret to the worker container:

c.KubeClusterManager.worker_extra_container_config = {
    "envFrom": [
        {"secretRef": {"name": "my-env-secret"}}
    ]
}
config c.KubeClusterManager.worker_extra_pod_config = Dict('')

Any extra configuration for the worker pods.

This dict will be deep merged with the worker pod spec (a V1PodSpec object) before submission. Keys should match those in the kubernetes spec, and should be camelCase.

For example, here we add a toleration to worker pods.

c.KubeClusterManager.worker_extra_pod_config = {
    "tolerations": [
        {
            "key": "key",
            "operator": "Equal",
            "value": "value",
            "effect": "NoSchedule",
        }
    ]
}
config c.KubeClusterManager.worker_memory = MemoryLimit('2 G')

Number of bytes available for a dask worker. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.KubeClusterManager.worker_memory_limit = MemoryLimit(0)

Maximum number of bytes available for a dask worker. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

Defaults to worker_memory.

config c.KubeClusterManager.worker_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask worker.

config c.KubeClusterManager.worker_status_period = Float(30)

Time (in seconds) between worker status checks.

A smaller period will detect failed workers sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

Job Queues

PBSClusterManager

class dask_gateway_server.managers.jobqueue.pbs.PBSClusterManager(**kwargs)

A cluster manager for deploying Dask on a PBS cluster.

config c.PBSClusterManager.account = Unicode('')

Accounting string associated with each job.

config c.PBSClusterManager.cancel_command = Unicode('')

The path to the job cancel command

config c.PBSClusterManager.cluster_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask cluster.

config c.PBSClusterManager.cluster_status_period = Float(30)

Time (in seconds) between cluster status checks.

A smaller period will detect failed clusters sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

config c.PBSClusterManager.dask_gateway_jobqueue_launcher = Unicode('')

The path to the dask-gateway-jobqueue-launcher executable

config c.PBSClusterManager.environment = Dict('')

Environment variables to set for both the worker and scheduler processes.

config c.PBSClusterManager.gateway_hostname = Unicode('')

The hostname of the node running the gateway. Used for referencing the local host in PBS directives.

config c.PBSClusterManager.project = Unicode('')

Project associated with each job.

config c.PBSClusterManager.queue = Unicode('')

The queue to submit jobs to.

config c.PBSClusterManager.scheduler_cmd = Unicode('dask-gateway-scheduler')

Shell command to start a dask-gateway scheduler.

config c.PBSClusterManager.scheduler_cores = Int(1)

Number of cpu-cores available for a dask scheduler.

config c.PBSClusterManager.scheduler_memory = MemoryLimit('2 G')

Number of bytes available for a dask scheduler. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.PBSClusterManager.scheduler_resource_list = Unicode('select=1:ncpus={cores}:mem={memory}')

The resource list to use for the scheduler.

This is a template, and receives the following fields:

  • cores

  • memory

config c.PBSClusterManager.scheduler_setup = Unicode('')

Script to run before dask scheduler starts.

config c.PBSClusterManager.staging_directory = Unicode('{home}/.dask-gateway/')

The staging directory for storing files before the job starts.

A subdirectory will be created for each new cluster which will store temporary files for that cluster. On cluster shutdown the subdirectory will be removed.

This field can be a template, which recieves the following fields:

  • home (the user’s home directory)

  • username (the user’s name)

config c.PBSClusterManager.submit_command = Unicode('')

The path to the job submit command

config c.PBSClusterManager.use_stagein = Bool(True)

If true, the staging directory created above will be copied into the job working directories at runtime using the -Wstagein directive.

If the staging directory is on a networked filesystem, you can set this to False and rely on the networked filesystem for access.

config c.PBSClusterManager.worker_cmd = Unicode('dask-gateway-worker')

Shell command to start a dask-gateway worker.

config c.PBSClusterManager.worker_cores = Int(1)

Number of cpu-cores available for a dask worker.

config c.PBSClusterManager.worker_memory = MemoryLimit('2 G')

Number of bytes available for a dask worker. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.PBSClusterManager.worker_resource_list = Unicode('select=1:ncpus={cores}:mem={memory}')

The resource list to use for the workers.

This is a template, and receives the following fields:

  • cores

  • memory

config c.PBSClusterManager.worker_setup = Unicode('')

Script to run before dask worker starts.

config c.PBSClusterManager.worker_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask worker.

config c.PBSClusterManager.worker_status_period = Float(30)

Time (in seconds) between worker status checks.

A smaller period will detect failed workers sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

SlurmClusterManager

class dask_gateway_server.managers.jobqueue.slurm.SlurmClusterManager(**kwargs)

A cluster manager for deploying Dask on a Slurm cluster.

config c.SlurmClusterManager.account = Unicode('')

Account string associated with each job.

config c.SlurmClusterManager.cancel_command = Unicode('')

The path to the job cancel command

config c.SlurmClusterManager.cluster_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask cluster.

config c.SlurmClusterManager.cluster_status_period = Float(30)

Time (in seconds) between cluster status checks.

A smaller period will detect failed clusters sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.

config c.SlurmClusterManager.dask_gateway_jobqueue_launcher = Unicode('')

The path to the dask-gateway-jobqueue-launcher executable

config c.SlurmClusterManager.environment = Dict('')

Environment variables to set for both the worker and scheduler processes.

config c.SlurmClusterManager.partition = Unicode('')

The partition to submit jobs to.

config c.SlurmClusterManager.qos = Unicode('')

QOS string associated with each job.

config c.SlurmClusterManager.scheduler_cmd = Unicode('dask-gateway-scheduler')

Shell command to start a dask-gateway scheduler.

config c.SlurmClusterManager.scheduler_cores = Int(1)

Number of cpu-cores available for a dask scheduler.

config c.SlurmClusterManager.scheduler_memory = MemoryLimit('2 G')

Number of bytes available for a dask scheduler. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.SlurmClusterManager.scheduler_setup = Unicode('')

Script to run before dask scheduler starts.

config c.SlurmClusterManager.staging_directory = Unicode('{home}/.dask-gateway/')

The staging directory for storing files before the job starts.

A subdirectory will be created for each new cluster which will store temporary files for that cluster. On cluster shutdown the subdirectory will be removed.

This field can be a template, which recieves the following fields:

  • home (the user’s home directory)

  • username (the user’s name)

config c.SlurmClusterManager.submit_command = Unicode('')

The path to the job submit command

config c.SlurmClusterManager.worker_cmd = Unicode('dask-gateway-worker')

Shell command to start a dask-gateway worker.

config c.SlurmClusterManager.worker_cores = Int(1)

Number of cpu-cores available for a dask worker.

config c.SlurmClusterManager.worker_memory = MemoryLimit('2 G')

Number of bytes available for a dask worker. Allows the following suffixes:

  • K -> Kibibytes

  • M -> Mebibytes

  • G -> Gibibytes

  • T -> Tebibytes

config c.SlurmClusterManager.worker_setup = Unicode('')

Script to run before dask worker starts.

config c.SlurmClusterManager.worker_start_timeout = Float(60)

Timeout (in seconds) before giving up on a starting dask worker.

config c.SlurmClusterManager.worker_status_period = Float(30)

Time (in seconds) between worker status checks.

A smaller period will detect failed workers sooner, but will use more resources. A larger period will provide slower feedback in the presence of failures.