This contains the repo Dockerfiles, Kubernetes configuration YAML and instruction needed to solve a full-waveform inversion problem with Devito using Tensorflow on a dask-kubernetes cluster hosted on Google's Kubernetes Engine or Minikube.
- Open the
docker-compose.yaml' file and change the
imagevalue from
rajatr/devito-dask-kubeto
YOUR-DOCKER-IMAGE-REPOSITRY/devito-dask-kube` - Do the same in
config/worker.yaml
andkube/minikube/deployment.yaml
- Log-in to docker with
docker login
. Rundocker-compose build scheduler && docker-compose push scheduler
. In the case of http timeout, just try again. Then rundocker-compose build worker && docker-compose push worker
. - Install minikube
minikube stop && minikube delete
(just in case there is already a minikube node running)minikube start --vm-driver hyperkit --cpus 4 --memory 8000
eval $(minikube docker-env)
- Run all the configuration yaml files in
kube/minikube
withkubectl apply -f kube/minikube
. - By running
kubectl get svc
you should see that thesvc-notebooks
service has an EXTERNAL-IP which is . This is because minikube does not support the load balancer serive. You can get the kubernetes URL for thesvc-notebooks
service from your local cluster withminikube service svc-notebooks
.
For additional help with setting up minikube, refer to Hello Minikube.
You may also need to alter the resource requests and limits for the workers (config/worker.yaml) or the scheduler (kube/minikube/deployment.yaml).
- Set up a Google Cloud Platform project. Enable the Kubernetes Engine API within that project, then configure default settings for gcloud and create a GKE cluster. The code in the notebooks has been tested primarily on a cluster with 2 nodes each of type n1-highmem-4 (4 vCPUs, 26 GB memory).
gcloud container clusters update YOUR_CLUSTER_NAME --enable-legacy-authorization
to ensure there is no need for RBAC authentication by Kubernetes.- Create a data storage bucket called
fwi-data
. If you want to use another name, then thec.GoogleStorageContentManager.default_path
field inconfig/jupyter-config.py
must be changed to the name of your bucket. gsutil cp notebooks/* gs://fwi-data
to copy all the notebooks into the storage bucket.- Pushing docker images to container registries, which will eventually be deployed inside pods in the K8s cluster, is also handled by
docker-compose.yaml
. In this case, the images are being pushed to GCP's container registry. Change theimage
option underscheduler_gcloud
andworker_gcloud
your own google cloud container registry. Then rundocker-compose build gcloud_scheduler && docker-compose push gcloud_scheduler
. - Run all the configuration yaml files in
kube/gcloud
withkubectl apply -f kube/gcloud
. - Open the IP address returned by
kubectl get svc | grep svc-notebook | awk '{print $4 ":80"}
to view and run the notebooks. - Remember to disable billing afterwards to avoid being charged unnecessarily.