spotty-cloud / spotty

Training deep learning models on AWS and GCP instances
https://spotty.cloud
MIT License
493 stars 43 forks source link

Add vpcId option to the instance configuration section #28

Closed meschansky closed 5 years ago

meschansky commented 5 years ago

Allows to specify an exact VPC ID (e.g. if the default one is deleted).

Also added a command line option "spotty ssh -l" to list currently running tmux sessions, useful when a connection to "spotty run [scriptname]" is broken and one needs to reconnect to the running session by its name.

If the PR is merged please add the new option to the wiki https://github.com/apls777/spotty/wiki/Configuration-File : vpcId (optional) - AWS VPC where to run an instance. If VPC ID is not specified, the default one will be used.

apls777 commented 5 years ago

Hi @meschansky,

Thank you for your contributions! But next time, please, open an issue first to discuss the change.

At the moment I'm working on the version 1.2 in the "dev-1.2" branch, and, to be honest, didn't have plans to do any new releases for v1.1.

Can you, please, describe your use case for tmux sessions? I mean I see that you want to list created sessions, so I assume you're creating several sessions using "spotty ssh" command with the "-s" argument. Why don't you use tmux windows within the same session instead?

Do you want me to release these changes to v1.1.9, or you are happy if they will be released a little bit later with v1.2? Will you make the same changes in the "dev-1.2" branch? Or I can do it for you, the code structure is slightly different.

meschansky commented 5 years ago

Hi, Oleg @apls777 ,

I've needed the functionality ASAP, so had to fork. Didn't notice your dev-1.2 branch though. And as I see, there's already a proper implementation for getting VPC ID from the subnet specified. I'm closing the PR then.

spotty ssh -l makes sense when I use "spotty run [scriptname]" and the connection to the instance at some point is broken. So I need to know which tmux session my script is currently running in to reattach to it. Please consider adding such an option to 1.2.

Thanks!

BR, Michael

apls777 commented 5 years ago

Hi Michael,

The "spotty run" command creates 1 tmux session per script and it will reattach you to that session automatically if you will call the "spotty run" command again.

In the current version, if your script is finished, the session automatically will be killed, so a new call of "spotty run" will create the session and run the script again. Which is not very convenient if you want to see your script output (at the moment you can check logs on the instance in this case). In v1.2 the session will not be killed even if the process is finished, the command will reattach you to a dead tmux pane. Then to start a new process you will need to kill the pane with "Ctrl+b, x" or use "spotty run" with the "-r" flag for a restart.

Do you still need the functionality to list sessions if you know about this feature?

Best regards, Oleg

apls777 commented 5 years ago

@meschansky ^

meschansky commented 5 years ago

Hi Oleg,

Thanks for clarifying this. But still having an option to list active sessions could improve the runtime environment's visibility: "As an end user, I want to be able to list all the open sessions, so I should not remember all of them."

BR, Michael

apls777 commented 5 years ago

@meschansky I see. Thank you! I will add this flag to v1.2.

Best regards, Oleg