Settings

Theme

Show HN: Swap between local and cloud execution with a Python decorator

github.com

4 points by lebovic 3 years ago · 1 comment

Reader

lebovicOP 3 years ago

Hey HN! I wanted a way to quickly switch between local and cloud execution for prototyping, so we built Lug. Notably, Lug doesn't require you to define your dependencies; it tries to extract and rebuild the same environment automatically. That means the decorator can literally just start as "@lug.hybrid(cloud=True)".

In the background, a new instance is spun up for every request. That means this has a high cold-start time, so is best for longer functions. I use it for computational biology (which contains some ML) batch processing.

You can also switch between cloud environments with the "provider" argument, but it's limited to just a couple options right now. We use it to cycle between AWS and our on-prem servers depending on capacity.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection