Run python code on remote servers
Project description
pip install labml_remote
cd [PATH TO YOUR PROJECT FOLDER]
labml_remote --init
# Give it SSH credentials
labml_remote python [PATH TO YOU PYTHON CODE] [ARGUMENTS TO YOUR PYTHON CODE]
That’s it!
Configurations
labml_remote --init asks for your SSH credentials and creates two files .remote/configs.yaml and .remote/exclude.txt. .remote/configs.yaml keeps the remote configurations for the project. Here’s a sample .remote/configs.yaml:
hostname: ec2-18-219-46-175.us-east-2.compute.amazonaws.com
name: labml_samples
private_key: .remote/private_key
username: ubuntu
.remote/exclude.txt is like .gitignore - it specifies the files and folders that you dont need to sync up with the remote server. The excludes generated by labml_remote --init excludes things like .git, .remote, logs and __pycache__. You should edit this if you have things that you don’t want to be synced with your remote computer.
How it works
labml_remote python ... will run your code in the remote computer.
It does a bunch of things and you should be able to see the progress in the console. It sets up miniconda if it’s not already installed and create a new environment for the project. Then it creates a folder by the name of the project inside home folder and syncs up the contents of your local folder. It syncs using rsync so subsequent sysncs should only need to send the changes. Then it installs packages from requirements.txt or from pipenv if a Pipfile is found. Then it runs your python file. It will use pipenv if a Pipfile is present. The outputs of your program will be streamed to the console.
Hope this helps!
Project details
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 labml_remote-0.0.3.tar.gz
.
File metadata
- Download URL: labml_remote-0.0.3.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92259ec1f433ba29a8670d86fc8513f5284a62f3e2b5e0a8d1924c77640e2118 |
|
MD5 | 16ae98915595c88a5ec378bd8b4f99be |
|
BLAKE2b-256 | a42082cbd73cb32f42416ee7a613ac009848624a027018e78d2d2a84b6e72ce2 |
File details
Details for the file labml_remote-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: labml_remote-0.0.3-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b92d3c2d3ffaf7cb8231651f3d37113b38de0f2310f7efa590eb542ba04d10a |
|
MD5 | 988edbd8ea7679f3f753453a07259c2b |
|
BLAKE2b-256 | 7b567a08daf1d2100624b2761bed900557be316fb950a7dc92df929663c3d21e |