Skip to main content

Run python code on remote servers

Project description

https://badge.fury.io/py/labml_remote.svg https://pepy.tech/badge/labml_remote https://img.shields.io/badge/slack-chat-green.svg?logo=slack https://img.shields.io/badge/labml-docs-blue

Run Python on a remote computer

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.

What it doesn’t do

This won’t install things like drivers or CUDA. So if you need them you should pick an image that comes with those for your instance. For example, on AWS pick a deep learning AMI if you want to use an instance with GPUs.

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

labml_remote-0.0.4.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

labml_remote-0.0.4-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file labml_remote-0.0.4.tar.gz.

File metadata

  • Download URL: labml_remote-0.0.4.tar.gz
  • Upload date:
  • Size: 12.9 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

Hashes for labml_remote-0.0.4.tar.gz
Algorithm Hash digest
SHA256 2095537d6eee58baf0ca59423771b3ddc1676b24011a64747be197c18da7119a
MD5 d71bf57c995db31b4e2f22f8a260a705
BLAKE2b-256 54a7d93c8cc422cc36805e304cfa01d906614846e210aeb65660f659ea23d6e3

See more details on using hashes here.

File details

Details for the file labml_remote-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: labml_remote-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 15.0 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

Hashes for labml_remote-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 60c8a0bdee335417bd16724106342df65f27cf19d92f630cfd573891bf28dff3
MD5 8da7e0bcb97531ac6db7a6a2460acaf5
BLAKE2b-256 231ee42c18025bc6d2f3c96df34beb33c6f9e7578fe6dd6221ca2e41659a5bda

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page