Simple SSH workspace to connect to your running Gradient° job.
paperspace jobs create --machineType P100 --container Test-Container --ports 8888:22 --command 'bash run.sh' --workspace "https://github.com/Paperspace/gradient-ssh-test.git"
Alternatively, you can clone this repo locally and run it from your own machine:
git clone [email protected]:Paperspace/gradient-ssh-test.git && cd gradient-ssh-test
paperspace project init
paperspace jobs create --machineType P100 --container Test-Container --ports 8888:22 --command './run.sh'
Once this job is running it will appear to stop at processing triggers for systemd
. This is expected behavior as it waits for the SSH connection.
You can now SSH to your job by getting the public IP address from the your console (https://www.paperspace.com/console/jobs) and then typing:
ssh ssh [email protected] -p 8888
Note: we are forwarding port 8888
to the container's SSH port 22
which you can see in the --ports 8888:22
portion of the job run. This is because the host node cannot expose port 22
directly as it is reserved for internal communication. (TODO: make list of ports that cannot be used)
You will be prompted for your password. A password was generated here: https://github.com/Paperspace/gradient-ssh-test/blob/master/run.sh#L4 which defaults to mys3cr3t@PW
. We highly recommend changing this before running in your account.
Check out the accompanying HelpDesk tutorial here