This is an example to use preemptible VM for machine learning.
- Google Cloud SDK
- Docker
- Use managed instance group with size one
- Managed instance group can automatically restart preemptible VM
- See the official document for details
- Make your instance to run Docker container when the instance starts
- Container-Optimized OS is used in this example
- Another choice is using startup script if you don't need Docker container
- Make instance group size zero after training finished
gcloud config set account <your.google.account@gmail.com>
gcloud config set project <Your GCP Project>
gcloud auth configure-docker
./bin/docker_build.sh
./bin/docker_push.sh
./bin/create_instance_group.sh
./bin/docker_build.sh
./bin/docker_run.sh