Handling AWS' New Spot Instance Termination Notices
luminal.com
luminal.com
If you're polling the local metadata service, the longest you're waiting for an answer is 5 seconds, and you can immediately begin closing up your work properly to be most efficient about the compute time used.
# script start, T=0s
do_something()
for n in range(0, 11):
time.sleep(5)
do_something()
# script end, T=55sIf you haven't heard of them before, this is their promotional video: https://www.youtube.com/watch?v=yuSqtwYOUvo
They are doing some very cool stuff in regards to automation of cloud based infrastructure.