def test_tls(self): with dask_testing_cluster(worker_kwargs={ 'security': tls_security(), "protocol": "tls" }, scheduler_kwargs={ 'security': tls_security(), "protocol": "tls" }) as (cluster, _): # These use test certs that ship with dask/distributed and should not be # used in production conf.set('dask', 'tls_ca', get_cert('tls-ca-cert.pem')) conf.set('dask', 'tls_cert', get_cert('tls-key-cert.pem')) conf.set('dask', 'tls_key', get_cert('tls-key.pem')) try: executor = DaskExecutor(cluster_address=cluster['address']) self.assert_tasks_on_executor(executor) executor.end() # close the executor, the cluster context manager expects all listeners # and tasks to have completed. executor.client.close() finally: conf.set('dask', 'tls_ca', '') conf.set('dask', 'tls_key', '') conf.set('dask', 'tls_cert', '')
def test_tls(self): # These use test certs that ship with dask/distributed and should not be # used in production with dask_testing_cluster( worker_kwargs={'security': tls_security(), "protocol": "tls"}, scheduler_kwargs={'security': tls_security(), "protocol": "tls"}, ) as (cluster, _): executor = DaskExecutor(cluster_address=cluster['address']) self.assert_tasks_on_executor(executor) executor.end() # close the executor, the cluster context manager expects all listeners # and tasks to have completed. executor.client.close()
def test_tls(self): with dask_testing_cluster( worker_kwargs={'security': tls_security()}, scheduler_kwargs={'security': tls_security()}) as (s, workers): # These use test certs that ship with dask/distributed and should not be # used in production configuration.set('dask', 'tls_ca', get_cert('tls-ca-cert.pem')) configuration.set('dask', 'tls_cert', get_cert('tls-key-cert.pem')) configuration.set('dask', 'tls_key', get_cert('tls-key.pem')) try: executor = DaskExecutor(cluster_address=s['address']) self.assert_tasks_on_executor(executor) executor.end() # close the executor, the cluster context manager expects all listeners # and tasks to have completed. executor.client.close() finally: configuration.set('dask', 'tls_ca', '') configuration.set('dask', 'tls_key', '') configuration.set('dask', 'tls_cert', '')