I'm training a model on AWS, and my workflow is:
- Connect to the EC2 instance via
ssh - Start the Docker container if not running already
docker exec -it <container_name> bashpython train.py
I can use Ctrl+Z to put the Python process in the background. However, I cannot exit the container shell, because the training process is attached to it. I assume it will also exit if I disconnect from ssh entirely (laptop shuts down, I close the terminal, etc.)
I thought that running python train.py & would fix it, but the training process is still stopped.
What's the best/most common way of accomplishing this?