Closed ggorman closed 4 years ago
Reproducing here all the steps required to do this:
az
client, login. az group create --name Nav_DAKS --location uksouth
az acr create --resource-group Nav_DAKS --name devitoaks --sku Basic
az acr login --name devitoaks
az acr list --resource-group Nav_DAKS --query "[].{acrLoginServer:loginServer}" --output table
docker build -t devito_base . -f docker/Dockerfile
in the Devito home directory. docker tag devito-base devitoaks.azurecr.io/devito-base:v1
docker push devitoaks.azurecr.io/devito-base
az acr repository list --name devitoaks --output table
az aks create \
--resource-group Nav_DAKS \
--name devitocluster1 \
--node-count 2 \
--generate-ssh-keys \
--attach-acr devitoaks
az aks install-cli
az aks get-credentials --resource-group Nav_DAKS --name devitocluster1
Dask-cluster.yaml
as follows:
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: devito-server
spec:
replicas: 1
template:
metadata:
labels:
app: devito-server
spec:
nodeSelector:
"beta.kubernetes.io/os": linux
containers:
- name: devito-server
image: devitoaks.azurecr.io/devito-base:v2
command: ['/venv/bin/dask-scheduler']
ports:
- containerPort: 8786
name: devito-server
---
apiVersion: v1
kind: Service
metadata:
name: devito-server
spec:
type: LoadBalancer
ports:
- port: 8786
selector:
app: devito-server
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: devito-worker
spec:
replicas: 10
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
minReadySeconds: 5
template:
metadata:
labels:
app: devito-worker
spec:
nodeSelector:
"beta.kubernetes.io/os": linux
containers:
- name: devito-worker
env:
- name: PYTHONPATH
value: /app
- name: DEVITO_OPENMP
value: "1"
- name: OMP_PROC_BIND
value: "TRUE"
image: devitoaks.azurecr.io/devito-base:v2
command: ['/venv/bin/dask-worker', 'tcp://devito-server:8786']
ports:
- containerPort: 80
This will setup a kubernetes cluster with one Dask scheduler node with an open port 8786 to the world, and 10 workers that will connect to this scheduler automatically.
kubectl apply -f dask-cluster.yaml
kubectl get services
(the one we are interested in is the public IP of the LoadBalancer)Devito-base
image we created earlier (I use docker-compose up devito
but this container could be fired in Azure or anywhere).cluster = LocalCluster(n_workers=nsources, death_timeout=600)
with client = Client('51.11.43.137:8786')
, where 51.11.43.137
is the IP of the scheduler we found in step 8. Closing as this is now long complete. The instructions have been moved to the wiki.