Quickly setup SSH connection to Kaggle Kernel for Deep Learning. In order to use that sexy Tesla P100 for free (and without many restriction of Jupyter Notebook) :P
A quick script to setup SSH to Kaggle Kernel for Deep Learning. In order to use that sexy P100 for free (and without many restriction of Jupyter Notebook) :P
Kaggle had blocked any attempt of creating an SSH tunneling into a running Kaggle kernel. So unfortunately this repo is NO LONGER WORKS. Attempting to use the script presented in this repo might violate Term and Conditions of Kaggle and WILL GET YOUR KAGGLE ACCOUNT BANNED!
While we wait for Kaggle to change its policy, the best solution for a free (or relatively cheap) GPU instance with a full SSH connection is GOOGLE COLAB (As well as Colab Pro) with a Tesla V100 for up to 24 hours. I have created another package that can help you get an SSH tunnel to a running Colab notebook in this repo: https://github.com/lamhoangtung/colab_ssh. You guys should use it instead.
Thanks for checking by !
ngrok
authentication token at line 7
in 10
(just in case you need it, we will use SSH Key authentication from now on)authorized_keys
and paste your public SSH key (usually located at ~/.ssh/id_rsa.pub
) as the content of the gist. 11
Step 1: Create a new Kaggle kernel
Step 2: Go to Kernel Settings and turn on GPU
and Internet
Step 3: Copy the whole content of the modified get_ssh.py and paste to the kernel as the first block of code.
Step 4: Click Commit
on the top right conner and wait a minutes for everything to set up. You should see a pop-up windows like this:
Save the host address information tcp://0.tcp.ngrok.io:16360
to SSH. If some how you forget the host address and port, go to your Ngrok Dashboard -> Status
and you will found them again.
ssh root@0.tcp.ngrok.io -p 16360
<— port number dictated in above outputKaggle Kernel already provide many Machine Learning and Deep Learning package and library ready to use with a powerful NVIDIA Tesla P100 GPU so you might be good to go. But if you want something more that I usually use. Run this to get more:
cd ~
wget https://github.com/lamhoangtung/kaggle-kernel-setup/raw/master/install_common.sh
chmod 777 install_common.sh
./install_common.sh
And follow the instruction.
You only need to Commit
again in the same kernel to get everything up and running again after terminate the server. Host address
information will be reset each time you commit.
Kaggle
account and multiple ngrok
account to get multiple server running at the same time.Go to https://www.kaggle.com/kernels and look at the Your Recent Kernels
section and hit Stop
.
If you encounter any problem while setting up the connection. Please terminate the server as above. Then open the kernel in editor mode and go to Run > Power off
, then turn it on manually.
Power off
or Terminate
the kernel