Google Colab Secure Shell connector that automates Ngrok tunnels creation for SSH, TPU and TensorBoard and Kaggle API installation
Project description
ssh_Colab
ssh_Colab is a Python module to facilitate remote access to Google Colaboratory (Colab) through Secure Shell (SSH) connections, secured by a third-party software, ngrok. ssh_Colab automates the tedious routine to set up ngrok tunnels needed for TPU runtime applications and services like TensorBoard. It also includes the function to automate the routine of Kaggle API installation/authentication and download competition data.
Prerequisites
- ngrok tunnel authtoken.
- Google account to access a Colab notebook.
- Local code editors such as VS Code or PyCharm to make the most of coding on Colab.
Usage
-
Launch a Colab notebook. Choose a runtime type you prefer.
-
Install ssh_Colab. Type and run the following command in a notebook cell:
!pip install ssh_Colab
-
Initiate the establishment of tunnels:
import ssh_Colab ssh_Colab.connect()
The default TensorBoard log directory is
/log/fit
. You can reset it by passing intoconnect()
the new valueLOG_DIR=/new/path/to/log
. -
Retrieve information that is used for establishing the SSH connection:
ssh_Colab.info()
If you are using non-TPU runtimes, the setup instruction of TPU resolver is ignored.
-
Function
kaggle()
to automate most of the process of Kaggle API installation/authentication and download and unzip competition dataset to folder/kaggle/input
. The default competition name is "tabular-playground-series-mar-2021."ssh_Colab.kaggle([data='name-of-competition'])
-
To disable ngrok tunnels created, run the command below:
ssh_Colab.kill()
Quickstart
A quickstart Colab notebook template is provided in the link below. Users can find a simple end-to-end application starting from SSH-Colab installation, SSH tunnel creation, to the use of TensorBoard after training a 3-layer MNIST convolutional neural network.
What's missed in this quickstart is how to may our way to Colab instances from local machines. The reference listed below can be a start point for interested users:
Feedback
Comments and suggestions are welcome and appreciated. They can be sent to lipin.juan02@gmail.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ssh_Colab-0.1.0.tar.gz
.
File metadata
- Download URL: ssh_Colab-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/54.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d840bfe17862d67c7814edafbdf88fa69c5d099c0740b7befe45b9c459326b0 |
|
MD5 | f26a98530d0c322a24fcedd6852663b3 |
|
BLAKE2b-256 | fdd3d6cb7fe416b277041c8f60b1c53a6516d97949c4f747dea43e397ac376ca |
File details
Details for the file ssh_Colab-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ssh_Colab-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/54.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1d1342563467016273aa47cff6ea8a5d51d72d00ed779afeeff91db9951a76 |
|
MD5 | 77fb353109cd29b24d70254598df2c4c |
|
BLAKE2b-256 | 22b256485c06286bc69d22b03c9b4fe64c9d44643dfa059ecc61dbb003b28eb5 |