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 theimagevalue fromrajatr/devito-dask-kubetoYOUR-DOCKER-IMAGE-REPOSITRY/devito-dask-kube` - Do the same in
config/worker.yamlandkube/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 8000eval $(minikube docker-env)- Run all the configuration yaml files in
kube/minikubewithkubectl apply -f kube/minikube. - By running
kubectl get svcyou should see that thesvc-notebooksservice 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-notebooksservice 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-authorizationto 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_pathfield inconfig/jupyter-config.pymust be changed to the name of your bucket. gsutil cp notebooks/* gs://fwi-datato 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 theimageoption underscheduler_gcloudandworker_gcloudyour own google cloud container registry. Then rundocker-compose build gcloud_scheduler && docker-compose push gcloud_scheduler. - Run all the configuration yaml files in
kube/gcloudwithkubectl 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.