I’m starting with Amazon EC2 usage for some ML training on a GPU.
What I want to do after I launch and ssh to my EC2 (Spot) instance:
- clone my GitHub repository (first setup access)
- download dataset
- prepare dataset (unzip, copy to aproprate directories, etc.)
- prepare python environment
- run the training
My question is: once I stop the Amazon EC2 instance, will I be able to reuse my setup work, or it will all be lost, so once I want to do training again, I would have to do the whole setup again?
3
Answers
Yes, you will be able to reuse everything you have configured and will not need to set it up again.
You can see in https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instances-and-amis.html#instance-stopping-starting-terminating
Yes, you can stop and restart EC2 instances but only those that are EBS-backed. This applies to persistent spot instances as well as on-demand instances. Note that ‘persistent’ is not the default option for spot instances, but you can request a persistent spot instance under Advanced options > Request type.
See Stop and start your instance.
Use these steps to check that the root device type of your EC2 instance is EBS or use these steps to check that the root device type of an AMI is EBS.
You will not be able to physically stop the instance yourself, however you can choose to have the instance stopped when a spot instance interruption occurs.
And in that case, yes, you will be able to reuse the setup. From this article: