Configuration

Specifying all parameters to the Gateway or GatewayCluster constructors every time may be error prone, especially when sharing this workflow with new users. To simplify things you can provide defaults in a configuration file, traditionally held in ~/.config/dask/gateway.yaml or /etc/dask/gateway.yaml. Note that this configuration is optional, and only changes the defaults when not specified in the constructors. You only need to set the fields you care about, unset fields will fall back to the default configuration.

We recommend administrators create a configuration file to share with their users, specifying the addresses and authentication necessary to connect to their dask-gateway-server. For example:

Example:

# ~/.config/dask/gateway.yaml
gateway:
  # The full address to the dask-gateway server.
  address: http://146.148.58.187

  # The full address to the dask-gateway scheduler proxy
  proxy-address: tls://35.202.68.87:8786

 auth:
   # Use kerberos for authentication
   type: kerberos

Users can now create Gateway or GatewayCluster objects without specifying any additional information.

from dask_gateway import GatewayCluster

cluster = GatewayCluster()
cluster.scale(20)

For more information on Dask configuration see the Dask configuration documentation.

Default Configuration

The default configuration file is as follows

gateway:
  address: null         # The full address to the dask-gateway server.
                        # May also be a template string, which will be formatted
                        # with any environment variables before usage.

  public-address: null  # The address to the dask-gateway server, as accessible
                        # from a web browser. This will be used as the root of
                        # all browser-facing links (e.g. the dask dashboard).
                        # If `None` (default), `gateway.address` will be used.
                        # May be a template string.

  proxy-address: 8786   # The full address or port to the dask-gateway
                        # scheduler proxy. If a port, the host/ip is taken from
                        # ``address``. May also be a template string.

  auth:
    type: basic         # The authentication type to use. Options are basic,
                        # kerberos, jupyterhub, or a full class path to a
                        # custom class.

    kwargs: {}          # Keyword arguments to use when instantiating the
                        # authentication class above. Values may be template
                        # strings.

  cluster:
    options: {}         # Default options to use when calling ``new_cluster`` or
                        # ``cluster_options``. Values may be template strings.