Just a POC, Use google cloud Pub/Sub + Firebase Cloud function
- Create Topic on
GCP pub/sub
via google cloud console or gcloud sdkgcloud pubsub topics create <topic_name>
- Create preemptible vm on
GCP
via google cloud console or gcloud sdk
gcloud compute instances create <instance_name> --preemptible --metadata-from-file shutdown-script=revive.sh
firebase deploy
orcd functions && npm run deploy
- Stop Preempt VM and see the log on firebase cloud functions, then look on GCP Compute engine dashboard
- Preempt VM is running again