Skip to main content

Repeatedly synchronize local workspace with a (slow) remote machine

Project description

LiveSync

Repeatedly synchronize local workspace with a (slow) remote machine. It is available as PyPI package and hosted on GitHub.

PyPI version PyPI - Downloads GitHub commit activity GitHub issues GitHub license

Use Case

VS Code Remote Development and similar tools are great as long as your remote machine is powerful enough. But if your target is a Raspberry Pi, Jetson Nano/Xavier/Orin, Beagle Board or similar, it feels like coding in jelly. Especially if you run powerful extensions like Pylance. LiveSync solves this by watching your code for changes and just copying the modifications to the slow remote machine. It works best if you have some kind of reload mechanism in place on the target (NiceGUI, FastAPI or Flask for example).

Usage

livesync <source> <username>@<host>

LiveSync uses rsync (SSH) to copy the files, so the <username>@<host> must be accessible via SSH (ideally by key, not password or passphrase, because it will be called over and over).

Press CTRL-C to abort the synchronization.

Positional arguments:

  • <source> local folder or VSCode workspace file
  • <username>@<host> target user and host (e.g. username@hostname)

Options:

  • --target-root TARGET_ROOT subfolder on target to synchronize to (default: "")
  • --target-port TARGET_PORT SSH port on target (default: 22)
  • --on-change ON_CHANGE command to be executed on remote host after any file change (default: None)
  • --mutex-interval MUTEX_INTERVAL interval in which mutex is updated (default: 10 seconds)

Notes

  • We suggest you have some auto-reloading in place on the (slow) target machine, like NiceGUI.
  • Only one user per target host should run LiveSync at a time. Therefore LiveSync provides a mutex mechanism.
  • You can create a .syncignore file in any source directory to skip additional files and directories from syncing.
  • If a .syncignore file doesn't exist, it is automatically created containing .git/, __pycache__/, .DS_Store, *.tmp, and .env.
  • If you pass a VSCode workspace file as source, LiveSync will synchronize each directory listed in the folders section.

Installation

python3 -m pip install livesync

Development

For development we suggest to use the following instructions instead of the normal pip installation:

git clone git@github.com:zauberzeug/livesync.git
cd livesync
python3 -m pip uninstall livesync # remove previous installed version
python3 -m pip install -e .

Now you can change the code and call the livesync command from your $PATH variable with the modified code.

Testing

We have build a small testing infrastructure with two docker containers. See tests/README.md for details.

Releases

Just create and push a new tag with the new version name (v0.2.1 for example). After a successful build a new release will be created. This should be edited to describe the changes in the release notes.

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

LiveSync-0.3.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

LiveSync-0.3.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file LiveSync-0.3.0.tar.gz.

File metadata

  • Download URL: LiveSync-0.3.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for LiveSync-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a16ec5fc4460e904beba8a07e26656ac9b59899aa53ef2dfa8b0c1f3050bd82a
MD5 b559236b8e35b701063dd279aca3f50d
BLAKE2b-256 da4caced8ca7bbbc0b478f4a486c81ce3ffb2bf016f5b8167dc77b1330fd0b20

See more details on using hashes here.

File details

Details for the file LiveSync-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: LiveSync-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for LiveSync-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8776f76a57a137f1f7d4bd50ab06f988563c63cd7b838b5911cbec4b1df952a9
MD5 7537e48ca599e6933b8be213613cec33
BLAKE2b-256 8520a24de7ebd8c49e431f174fd9cdf7d02dc2f059cc49b44a1e4552333f29e7

See more details on using hashes here.

Supported by

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