Skip to content

Security does not pass from JobQueueCluster to SpecCluster #438

@jennalc

Description

@jennalc

What happened:

Try to pass a distributed.Security object to a custom implementation of the JobQueueCluster.
Hit the following error:

/var/conductor/miniconda-4.8.2-x86_64/anaconda/envs/dask-cpu-env/lib/python3.7/site-packages/distributed/comm/tcp.py in _expect_tls_context(connection_args)
    311             "TLS expects a ssl_context argument of type "
    312             "ssl.SSLContext (perhaps check your TLS configuration?)"
--> 313             "  Instead got %s" % str(ctx)
    314         )
    315     return ctx

TypeError: TLS expects a ssl_context argument of type ssl.SSLContext (perhaps check your TLS configuration?)  Instead got None

What you expected to happen:

Expect that the cluster is able to start with the specified security settings.
Tried LocalCluster and was able to start the cluster with TLS.

Minimal Complete Verifiable Example:

sec = Security(tls_ca_file='cacert.pem', 
               tls_client_cert='public.pem', 
               tls_client_key='keyfile.key',
               tls_scheduler_cert='public.pem', 
               tls_scheduler_key='keyfile.key',
               tls_worker_cert='public.pem', 
               tls_worker_key='keyfile.key')

cluster = MyCluster(security=sec)

Anything else we need to know?:

Found that the JobQueueCluster does not appear to pass the security parameter from it's __init__ method to the SpecCluster __init__.

Locally edited JobQueueCluster to pass the security object and was able to get past this error:

super().__init__(
            scheduler=scheduler,
            worker=worker,
            loop=loop,
            silence_logs=silence_logs,
            asynchronous=asynchronous,
            name=name,
        )

Environment:

  • Dask version: distributed 2.15.0 and dask-jobqueue 0.7.1
  • Python version: 3.7
  • Operating System: Linux
  • Install method (conda, pip, source): conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions