使用Helm,我创建了一个 Dask 集群。
NAME READY STATUS RESTARTS AGE
dask01-jupyter-aaa-aaaa 1/1 Running 0 3d19h
dask01-scheduler-bbb-bbbb 1/1 Running 0 3d19h
dask01-worker-ccc-cccc 1/1 Running 0 3d19h
dask01-worker-ddd-dddd 1/1 Running 0 3d19h
dask01-worker-eee-eeee 1/1 Running 0 3d19h
我可以运行基本的 Dask 工作负载。
import dask.array as da
array = da.ones((1000, 1000, 1000), chunks=(100, 100, 10))
现在,我想以某种方式将它连接到客户端:
from dask import distributed
cluster = None # TODO: configure KubeCluster somehow https://kubernetes.dask.org/en/latest/
client = distributed.Client(cluster)
如果我想启动一个集群,这很有效:
from dask_kubernetes import KubeCluster
cluster = KubeCluster.from_yaml('worker-spec.yml')
但是如何连接到现有集群?