Preston Marshall
02/06/2020, 2:47 PMjosh
02/06/2020, 3:01 PMPreston Marshall
02/06/2020, 3:04 PMPreston Marshall
02/06/2020, 3:04 PMPreston Marshall
02/06/2020, 3:06 PMPreston Marshall
02/06/2020, 3:07 PMjosh
02/06/2020, 3:09 PMPreston Marshall
02/06/2020, 3:17 PMPreston Marshall
02/06/2020, 3:17 PMjosh
02/06/2020, 3:20 PMPreston Marshall
02/06/2020, 3:22 PMjosh
02/06/2020, 3:23 PMflow.run(executor=…)
and then the Flow Runner will start and submit work using the Dask Executor to the Dask cluster running in your k8s cluster. Once the flow finishes the job will completejosh
02/06/2020, 3:23 PMPreston Marshall
02/06/2020, 3:24 PMjosh
02/06/2020, 3:25 PMPreston Marshall
02/06/2020, 3:25 PMjosh
02/06/2020, 3:26 PMPreston Marshall
02/06/2020, 3:28 PMjosh
02/06/2020, 3:29 PMPreston Marshall
02/06/2020, 3:30 PMjosh
02/06/2020, 3:30 PMJoe Schmid
02/06/2020, 6:01 PMenv = RemoteEnvironment(
executor="prefect.engine.executors.DaskExecutor",
executor_kwargs={"address": "<tcp://dask-scheduler:8786>"}
)
And our k8s Service for the dask scheduler is spec'ed as:
apiVersion: v1
kind: Service
...
spec:
ports:
- name: dask-scheduler
port: 8786
targetPort: 8786
- name: dask-webui
port: 80
targetPort: 8787
...
Preston Marshall
02/06/2020, 6:02 PMJoe Schmid
02/06/2020, 6:05 PMkind: Deployment
k8s keeps how ever many pods you specify in replicas
running for you. (If a pod dies, k8s will restart it, etc.)Preston Marshall
02/06/2020, 6:57 PMPreston Marshall
02/06/2020, 6:58 PMJoe Schmid
02/06/2020, 7:03 PMapiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: dask
component: scheduler
release: dask
name: dask-scheduler
spec:
replicas: 1
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: dask
component: scheduler
release: dask
spec:
containers:
- args:
- python
- /home/jovyan/srm-data-science/bin/srm_dask_apaptive_scheduler.py
env:
- name: DASK_DISTRIBUTED__SCHEDULER__WORK_STEALING
value: "False"
image: <Docker Image that includes srm_dask_apaptive_scheduler.py>
imagePullPolicy: IfNotPresent
name: dask-scheduler
ports:
- containerPort: 8786
- containerPort: 8787
Preston Marshall
02/06/2020, 7:04 PMPreston Marshall
02/06/2020, 7:04 PMJoe Schmid
02/06/2020, 7:13 PM