summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-ssh-colab.spec420
-rw-r--r--sources1
3 files changed, 422 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..7f0b60a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ssh-Colab-0.4.17.tar.gz
diff --git a/python-ssh-colab.spec b/python-ssh-colab.spec
new file mode 100644
index 0000000..6abc207
--- /dev/null
+++ b/python-ssh-colab.spec
@@ -0,0 +1,420 @@
+%global _empty_manifest_terminate_build 0
+Name: python-ssh-Colab
+Version: 0.4.17
+Release: 1
+Summary: Google Colab secure shell connection helper that automates ngrok tunnels creation (for SSH, TPU, and TensorBoard) and facilitates the use of Google Cloud Storage, Google Drive, and Kaggle Data API.
+License: MIT License
+URL: https://github.com/libinruan/ssh_Colab
+Source0: https://mirrors.aliyun.com/pypi/web/packages/86/9c/ffe4e237cd97cbf3a3ddc85b6fec6da61d5eda96bf8714294cec4686c912/ssh-Colab-0.4.17.tar.gz
+BuildArch: noarch
+
+
+%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. The module automates the tedious routine to set up ngrok tunnels needed for TPU runtime applications and services like TensorBoard. It also provides subroutines for (1) Kaggle Data API installation, (2) Kaggle competition data downloads, (3) data transfers between Colab and Google Cloud Storage (GCS), and (4) Google Drive mounting.
+
+[![license](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
+![python version](https://img.shields.io/badge/python-3.6%2C3.7%2C3.8-blue?logo=python)
+
+# Prerequisites
+- [ngrok](https://ngrok.com/) tunnel authtoken.
+- Google account to access a [Colab](https://colab.research.google.com/notebooks/intro.ipynb) notebook.
+- Local code editors such as VS Code or PyCharm to make the most of coding on Colab.
+
+# Usage
+1. Launch a Colab notebook. Choose a runtime type you prefer.
+
+2. Install ssh-Colab. Type and run the following command in a new notebook cell:
+ ```shell
+ !pip install ssh-Colab
+ ```
+
+ Or you can use this command:
+
+ ```shell
+ !pip install git+https://github.com/libinruan/ssh_Colab.git#egg=ssh_Colab
+ ```
+
+ Another way to install this package is to Git clone its repository to Colab. Run in a new notebook cell:
+
+ ```shell
+ !git clone https://github.com/libinruan/ssh_Colab.git
+ %cd ssh_Colab
+ !sudo python setup.py install
+ ```
+
+
+
+3. Initiate the establishment of tunnels:
+ ```python
+ import sshColab
+ sshColab.connect([LOG_DIR='/path/to/log/'])
+ ```
+ The default TensorBoard log directory is `/log/fit`.
+
+4. Retrieve information that is used for establishing the SSH connection:
+ ```python
+ sshColab.info()
+ ```
+ If you are running a non-TPU-enabled notebook, the setup instruction of TPU resolver is skipped.
+
+5. To activate Kaggle API installation/authentication and download competition data, run:
+
+ ```python
+ sshColab.kaggle([data=<name-of-competition>, output=<output-directory>])
+ ```
+ Note that the default competition name is `tabular-playground-series-mar-2021`. The data is unzipped to the destination folder `/kaggle/input` by default.
+
+6. To mount a google drive, run:
+
+7. To connect with GCS, initiate the connection:
+ ```python
+ sshColab.GCSconnect()
+ ```
+ To create a GCS Bucket, run:
+ ```python
+ sshColab.create_bucket(<project_id>, <bucket_name>)
+ ```
+ To list blobs in a GCS bucket, run:
+ ```python
+ sshColab.list_blobs(<project_id>, <bucket_name>)
+ ```
+ To upload files from Colab to a GCS Bucket, run:
+ ```python
+ sshColab.upload_to_gcs(<project_id>, <bucket_name>, [file=<local_file> ,ext=<file_extension>])
+ ```
+ To download files from a GCS Bucket to Colab, run:
+ ```python
+ sshColab.download_to_colab(<project_id>, <bucket_name>, [file=<local_file>])
+ ```
+
+8. To disable ngrok tunnels created, run the command below:
+ ```python
+ sshColab.kill()
+ ```
+
+# Quickstart
+A short Colab notebook 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.
+
+[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1uvLXA5hC8tyMjsA09H3Y5IPi_N54aXbw?usp=sharing)
+
+What's missed in this quick start guide is how to may our way to Colab instances from
+local machines. The reference listed below can be a start point for interested
+users:
+
+1. [Remote development over SSH on local VS Code](https://code.visualstudio.com/docs/remote/ssh-tutorial)
+2. [Run SSH terminal on local PyCharm](https://www.jetbrains.com/help/pycharm/running-ssh-terminal.html)
+
+# Releases
+
+version 0.3.3: Addition of the output argument for function kaggle().
+
+version 0.3.0: Addition of functions for communicating with Google Cloud Storage.
+
+version 0.2.0: Addition of Google Drive mounting function.
+
+version 0.1.3: Addition of Kaggle API installation/authentication and competition data downloading function.
+
+
+# Feedback
+Comments and suggestions are welcome and appreciated. They can be sent to
+lipin.juan02@gmail.com.
+
+
+
+
+
+%package -n python3-ssh-Colab
+Summary: Google Colab secure shell connection helper that automates ngrok tunnels creation (for SSH, TPU, and TensorBoard) and facilitates the use of Google Cloud Storage, Google Drive, and Kaggle Data API.
+Provides: python-ssh-Colab
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-ssh-Colab
+
+# 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. The module automates the tedious routine to set up ngrok tunnels needed for TPU runtime applications and services like TensorBoard. It also provides subroutines for (1) Kaggle Data API installation, (2) Kaggle competition data downloads, (3) data transfers between Colab and Google Cloud Storage (GCS), and (4) Google Drive mounting.
+
+[![license](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
+![python version](https://img.shields.io/badge/python-3.6%2C3.7%2C3.8-blue?logo=python)
+
+# Prerequisites
+- [ngrok](https://ngrok.com/) tunnel authtoken.
+- Google account to access a [Colab](https://colab.research.google.com/notebooks/intro.ipynb) notebook.
+- Local code editors such as VS Code or PyCharm to make the most of coding on Colab.
+
+# Usage
+1. Launch a Colab notebook. Choose a runtime type you prefer.
+
+2. Install ssh-Colab. Type and run the following command in a new notebook cell:
+ ```shell
+ !pip install ssh-Colab
+ ```
+
+ Or you can use this command:
+
+ ```shell
+ !pip install git+https://github.com/libinruan/ssh_Colab.git#egg=ssh_Colab
+ ```
+
+ Another way to install this package is to Git clone its repository to Colab. Run in a new notebook cell:
+
+ ```shell
+ !git clone https://github.com/libinruan/ssh_Colab.git
+ %cd ssh_Colab
+ !sudo python setup.py install
+ ```
+
+
+
+3. Initiate the establishment of tunnels:
+ ```python
+ import sshColab
+ sshColab.connect([LOG_DIR='/path/to/log/'])
+ ```
+ The default TensorBoard log directory is `/log/fit`.
+
+4. Retrieve information that is used for establishing the SSH connection:
+ ```python
+ sshColab.info()
+ ```
+ If you are running a non-TPU-enabled notebook, the setup instruction of TPU resolver is skipped.
+
+5. To activate Kaggle API installation/authentication and download competition data, run:
+
+ ```python
+ sshColab.kaggle([data=<name-of-competition>, output=<output-directory>])
+ ```
+ Note that the default competition name is `tabular-playground-series-mar-2021`. The data is unzipped to the destination folder `/kaggle/input` by default.
+
+6. To mount a google drive, run:
+
+7. To connect with GCS, initiate the connection:
+ ```python
+ sshColab.GCSconnect()
+ ```
+ To create a GCS Bucket, run:
+ ```python
+ sshColab.create_bucket(<project_id>, <bucket_name>)
+ ```
+ To list blobs in a GCS bucket, run:
+ ```python
+ sshColab.list_blobs(<project_id>, <bucket_name>)
+ ```
+ To upload files from Colab to a GCS Bucket, run:
+ ```python
+ sshColab.upload_to_gcs(<project_id>, <bucket_name>, [file=<local_file> ,ext=<file_extension>])
+ ```
+ To download files from a GCS Bucket to Colab, run:
+ ```python
+ sshColab.download_to_colab(<project_id>, <bucket_name>, [file=<local_file>])
+ ```
+
+8. To disable ngrok tunnels created, run the command below:
+ ```python
+ sshColab.kill()
+ ```
+
+# Quickstart
+A short Colab notebook 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.
+
+[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1uvLXA5hC8tyMjsA09H3Y5IPi_N54aXbw?usp=sharing)
+
+What's missed in this quick start guide is how to may our way to Colab instances from
+local machines. The reference listed below can be a start point for interested
+users:
+
+1. [Remote development over SSH on local VS Code](https://code.visualstudio.com/docs/remote/ssh-tutorial)
+2. [Run SSH terminal on local PyCharm](https://www.jetbrains.com/help/pycharm/running-ssh-terminal.html)
+
+# Releases
+
+version 0.3.3: Addition of the output argument for function kaggle().
+
+version 0.3.0: Addition of functions for communicating with Google Cloud Storage.
+
+version 0.2.0: Addition of Google Drive mounting function.
+
+version 0.1.3: Addition of Kaggle API installation/authentication and competition data downloading function.
+
+
+# Feedback
+Comments and suggestions are welcome and appreciated. They can be sent to
+lipin.juan02@gmail.com.
+
+
+
+
+
+%package help
+Summary: Development documents and examples for ssh-Colab
+Provides: python3-ssh-Colab-doc
+%description help
+
+# 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. The module automates the tedious routine to set up ngrok tunnels needed for TPU runtime applications and services like TensorBoard. It also provides subroutines for (1) Kaggle Data API installation, (2) Kaggle competition data downloads, (3) data transfers between Colab and Google Cloud Storage (GCS), and (4) Google Drive mounting.
+
+[![license](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
+![python version](https://img.shields.io/badge/python-3.6%2C3.7%2C3.8-blue?logo=python)
+
+# Prerequisites
+- [ngrok](https://ngrok.com/) tunnel authtoken.
+- Google account to access a [Colab](https://colab.research.google.com/notebooks/intro.ipynb) notebook.
+- Local code editors such as VS Code or PyCharm to make the most of coding on Colab.
+
+# Usage
+1. Launch a Colab notebook. Choose a runtime type you prefer.
+
+2. Install ssh-Colab. Type and run the following command in a new notebook cell:
+ ```shell
+ !pip install ssh-Colab
+ ```
+
+ Or you can use this command:
+
+ ```shell
+ !pip install git+https://github.com/libinruan/ssh_Colab.git#egg=ssh_Colab
+ ```
+
+ Another way to install this package is to Git clone its repository to Colab. Run in a new notebook cell:
+
+ ```shell
+ !git clone https://github.com/libinruan/ssh_Colab.git
+ %cd ssh_Colab
+ !sudo python setup.py install
+ ```
+
+
+
+3. Initiate the establishment of tunnels:
+ ```python
+ import sshColab
+ sshColab.connect([LOG_DIR='/path/to/log/'])
+ ```
+ The default TensorBoard log directory is `/log/fit`.
+
+4. Retrieve information that is used for establishing the SSH connection:
+ ```python
+ sshColab.info()
+ ```
+ If you are running a non-TPU-enabled notebook, the setup instruction of TPU resolver is skipped.
+
+5. To activate Kaggle API installation/authentication and download competition data, run:
+
+ ```python
+ sshColab.kaggle([data=<name-of-competition>, output=<output-directory>])
+ ```
+ Note that the default competition name is `tabular-playground-series-mar-2021`. The data is unzipped to the destination folder `/kaggle/input` by default.
+
+6. To mount a google drive, run:
+
+7. To connect with GCS, initiate the connection:
+ ```python
+ sshColab.GCSconnect()
+ ```
+ To create a GCS Bucket, run:
+ ```python
+ sshColab.create_bucket(<project_id>, <bucket_name>)
+ ```
+ To list blobs in a GCS bucket, run:
+ ```python
+ sshColab.list_blobs(<project_id>, <bucket_name>)
+ ```
+ To upload files from Colab to a GCS Bucket, run:
+ ```python
+ sshColab.upload_to_gcs(<project_id>, <bucket_name>, [file=<local_file> ,ext=<file_extension>])
+ ```
+ To download files from a GCS Bucket to Colab, run:
+ ```python
+ sshColab.download_to_colab(<project_id>, <bucket_name>, [file=<local_file>])
+ ```
+
+8. To disable ngrok tunnels created, run the command below:
+ ```python
+ sshColab.kill()
+ ```
+
+# Quickstart
+A short Colab notebook 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.
+
+[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1uvLXA5hC8tyMjsA09H3Y5IPi_N54aXbw?usp=sharing)
+
+What's missed in this quick start guide is how to may our way to Colab instances from
+local machines. The reference listed below can be a start point for interested
+users:
+
+1. [Remote development over SSH on local VS Code](https://code.visualstudio.com/docs/remote/ssh-tutorial)
+2. [Run SSH terminal on local PyCharm](https://www.jetbrains.com/help/pycharm/running-ssh-terminal.html)
+
+# Releases
+
+version 0.3.3: Addition of the output argument for function kaggle().
+
+version 0.3.0: Addition of functions for communicating with Google Cloud Storage.
+
+version 0.2.0: Addition of Google Drive mounting function.
+
+version 0.1.3: Addition of Kaggle API installation/authentication and competition data downloading function.
+
+
+# Feedback
+Comments and suggestions are welcome and appreciated. They can be sent to
+lipin.juan02@gmail.com.
+
+
+
+
+
+%prep
+%autosetup -n ssh-Colab-0.4.17
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-ssh-Colab -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.4.17-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..de63e5c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+68f9d0bc8c43e652938019acc9c04c66 ssh-Colab-0.4.17.tar.gz