Replies: 6 comments 5 replies
-
|
@dhuseby : This is fantastic, Dave. Appreciate it. CCing key contributors from py-libp2p, lean-libp2p and dotnet-libp2p who will work with you on this initiative. Organized the 3 different teams, who will collaborate to enable achieving at the earliest:
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you @dhuseby for starting this discussion. I think the move to Python makes a lot of sense, especially with Cloudlab's Python API in the picture because trying to shell out to Python from Bash for 800+ machine orchestration would get messy fast. The Bash framework is running daily and producing results. I'd suggest we start by building the Cloudlab integration layer in Python, then progressively port the shared libraries (filter engine, image building, caching, etc.) as we touch them. That way we're never blocked on a big-bang rewrite. On PyInstaller, the idea of self-contained executables is appealing, but we might not need it. Python 3.8+ is available on pretty much every target system already. A simple requirements.txt with minimal dependencies could give us the same "clone and run" experience without the packaging overhead. We could always add PyInstaller later if distribution becomes a real pain point. The |
Beta Was this translation helpful? Give feedback.
-
|
I think the bash setup is already pretty good and works really well for local development & testing as well as CI/CD testing. If we are going for Cloudlabs for scaling experiments, why don't we just create another section of scripts for executing the experiments ? To the best of my knowledge, we want to interface with the Cloudlab's python API to create profiles of experiments and run them which can be kept completely separately with respect to local development. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, @dhuseby. Switching to Python seems like the right move, especially since Cloudlab already provides a Python API. Trying to coordinate 800+ machines from Bash while constantly invoking Python scripts would become unwieldy pretty quickly. Given that the existing Bash framework is stable and running daily, I’d recommend migrating incrementally: start by implementing the Cloudlab integration layer in Python, then gradually transition shared components such as the filter engine, image builder, and caching, whenever we touch them. This approach minimizes the risk compared to a full rewrite all at once. Regarding PyInstaller, although standalone executables are attractive, they don’t feel essential at this stage. Python 3.8+ is already present on most of our target systems, and keeping dependencies light with a simple requirements.txt should provide a comparable “clone and run” workflow without adding packaging complexity. If distribution later becomes burdensome, we can revisit PyInstaller then. |
Beta Was this translation helpful? Give feedback.
-
@dhuseby from my side working on transport and misc, i can see how the bash scripts are starting to get more complex. they work well now, but adding Cloudlab and scaling logic could make them harder to maintain. agree that keeping things clone and run is important. if PyInstaller lets us ship a single executable without requiring venv or extra setup, that keeps the barrier low for contributors. an incremental approach sounds safest. maybe we can start with a small py tool for Cloudlab and see how that feels before migrating more of the framework. happy to help test or adapt transport and misc if we move in that direction. |
Beta Was this translation helpful? Give feedback.
-
true
i think this is the smartest way forward. does anybody want to take a crack at learning the cloudlab Python API/SDK (https://docs.cloudlab.us) and writing an initial cloudlab cli tool that compiles to a PyInstaller executable? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hiya everybody, I know this may cause a bit of whiplash but I thought I should bring this up in light of recent developments on multiple fronts.
The choice to use Bash to write the scripts for running the tests was primary made for three reasons:
I did a deep dive into the Cloudlab platform we're using for scaling experiments and their primary programming interface is a Python API. That made me start thinking...could we rewrite the Bash in Python while still meeting the three goals outlined above.
After doing some investigation, I think there is a path forward: PyInstaller. If we adopted PyInstaller, we could have the Python scripts in the repo for shared functions as well as test-specific functions and produce self-contained executables (e.g.
./run) in each of the test subfolders that run without any Python environment setup. If we design thetransport/run.pyapplication correctly, we can add in support for a--local-editscommand line switch that checks the hash of each file included in the PyInstaller-built executable against the hash of the source python file and then useimportlib.utilto pull in the locally edited Python script to execute instead of the .pyc bytecode included in the executable. This would allow for a developer to clone the repo, make some edits to the Python scripts (i.e. fix a bug intransport/lib/run-single-test.py) and then run the test with./run --local-edits ...and the./runexecutable would pull in the locally editedtransport/lib/run-single-test.pyand use that code instead of the checked-in version that was built into the./runexecutable. This would facilitate debugging and fixing of the framework itself without requiring a full Python development setup with virtualenv/conda/uv/etc.This doesn't eliminate the dependency maintenance hell though. We would have to work hard to minimize the dependency tree as much as possible to minimize the number of external dependencies.
What this does buy us is this:
As it stands right now, we can use Cloudlab with the existing Bash scripts since most/all interactions are over SSH with pre-authorized keys similar to how Ansible works. I'm worried that the Bash would get even more complex than it already is and that will make the debug and maintenance of it a burden. Right now it's manageable but supporting Docker Swarm and Cloudlab at the same time might get super complicated with Bash.
I am decidedly NOT married to the Bash solution and if Python can replace it while reducing maintenance overhead and lowering the barrier to entry, I think we should consider it. I wanted to articulate this Python rewrite idea and see what everybody thinks.
Cheers! 🍻
Beta Was this translation helpful? Give feedback.
All reactions