Launch files
Launch files let you start multiple nodes simultaneously, including those with dependencies on each other. With a single launch file, you or your team can recreate an entire node environment using just one command.
Running the Example
Section titled “Running the Example”Start by cloning this repository:
-
Clone the repository:
Terminal window git clone https://github.com/Peppy-bot/launch_example -
Navigate into the directory:
Terminal window cd launch_example
In the root directory, you’ll find a peppy_launcher.json5 file. Opening it reveals the following structure:
- All deployments are defined in the
deploymentsarray - Each deployment requires a
sourceandinstancesattribute
The source attribute supports four formats:
- URL: A link to a
.tar.zstarchive, requiring bothurlandsha256attributes - Git repository: Requires
repo,path(location within the repo), andrefattributes - Local path: Specified via the
localkey, pointing to a directory on your filesystem. The path can be either absolute or relative to thepeppy_launcher.json5file - Repository: Reference a node that is already registered in your user repositories. Specify
nameandtag, or use the combinedname: "<name>:<tag>"shorthand. The node is resolved against your local packages cache at~/.peppy/cache/packages.json5.
Variants
Section titled “Variants”Each deployment source can optionally include a variant field to select a specific variant of the node (e.g., a mock implementation or an architecture-specific build). The variant object supports three formats:
- Name: Reference a variant by name —
{ name: "mock-rust" } - Git repository: Fetch a variant from a git repo — requires
repo, with optionalpathandref - URL: Fetch a variant from an HTTP(S) URL — requires
url, with optionalsha256
Examples:
// Named variant{ source: { repo: "https://github.com/Peppy-bot/nodes_hub.git", path: "rust/fake_openarm01_controller", ref: "main", variant: { name: "mock-rust" } }, instances: [ { instance_id: "the_nervous_system" } ]}// Git variant{ source: { local: "./my_node", variant: { repo: "https://github.com/Peppy-bot/node_variants.git", path: "mock", ref: "v1.0.0" } }, instances: [ { instance_id: "my_node_1" } ]}// URL variant{ source: { local: "./my_node", variant: { url: "https://example.com/my_node_variant.tar.zst", sha256: "33e83da60a54e3bb487a9a3b67705918602143b30f158143b6909acaf017a36a" } }, instances: [ { instance_id: "my_node_1" } ]}// Repository source (long form){ source: { name: "openarm01_controller", tag: "0.1.0", variant: { name: "mock-python" } }, instances: [ { instance_id: "the_nervous_system" } ]}// Repository source (combined shorthand — equivalent to the example above){ source: { name: "openarm01_controller:0.1.0", variant: { name: "mock-python" } }, instances: [ { instance_id: "the_nervous_system" } ]}From within the cloned repository, execute the launcher:
peppy stack launch ./python/peppy_launcher.json5peppy stack launch ./rust/peppy_launcher.json5PeppyOS automatically inspects the name and tag of each node, verifies that all dependencies are met, and constructs the node stack in the correct order.
Verify that the node stack was configured correctly:
$ peppy stack listNode stack
┌─────────────────────────────────────────┬───────┬─────────┬────────────┬──────────────────────────────────────────────────────────────────────────┐│ NODE │ STAGE │ VARIANT │ INSTANCES │ PATH │├─────────────────────────────────────────┼───────┼─────────┼────────────┼──────────────────────────────────────────────────────────────────────────┤│ core-node-adoring-wiles-7286:v0.8.0 │ Root │ default │ 1 running │ /Users/tuatini/workspace/peppy ││ fake_openarm01_controller:0.1.0 │ Ready │ default │ 1 running │ /Users/tuatini/.peppy/built_nodes/fake_openarm01_controller_0.1.0.tar.zst ││ fake_robot_brain:0.1.0 │ Ready │ default │ 1 running │ /Users/tuatini/.peppy/built_nodes/fake_robot_brain_0.1.0.tar.zst ││ fake_uvc_camera:0.1.0 │ Ready │ default │ 2 running │ /Users/tuatini/.peppy/built_nodes/fake_uvc_camera_0.1.0.tar.zst ││ fake_video_reconstruction:0.1.0 │ Ready │ default │ 1 running │ /Users/tuatini/.peppy/built_nodes/fake_video_reconstruction_0.1.0.tar.zst │└─────────────────────────────────────────┴───────┴─────────┴────────────┴──────────────────────────────────────────────────────────────────────────┘
Dependencies - fake_robot_brain:0.1.0 -> fake_openarm01_controller:0.1.0 - fake_robot_brain:0.1.0 -> fake_uvc_camera:0.1.0 - fake_video_reconstruction:0.1.0 -> fake_uvc_camera:0.1.0The output confirms that all nodes have been added to the stack along with their dependency relationships.