Deploy, launch, manage, and orchestrate heterogeneous robots with ease!
Before installing, you'll need python3+pip, conda, and docker. The later two only if using the runtime.
pip install mrp
Starts all defined processes, or a given subset.
# To bring up all the processes:
mrp up
# To bring up myproc:
mrp up myproc
Stops all defined processes, or a given subset.
# To bring down all the processes:
mrp down
# To bring down myproc:
mrp down myproc
All the processes default to running in the background. To see the stdout:
# Attach to the log stream of all processes:
mrp logs
# Attach to the log stream of myproc:
mrp logs myproc
# Attach to the log stream of all processes, starting from the beginning:
mrp logs --old
See the state of running processes:
mrp ps
Run a process without sandboxing:
mrp.process(
name="proc",
runtime=mrp.Host(
run_command=["python3", "proc.py"],
),
)
Run a process within a conda environment:
mrp.process(
name="proc",
runtime=mrp.Conda(
yaml="env.yml",
run_command=["python3", "proc.py"],
),
)
The environment can be provided as a yaml file, local env name, or a list of channels and dependencies.
mrp.process(
name="api",
runtime=mrp.Docker(image="ghcr.io/alephzero/api:latest"),
)
The environment can be provided as a dockerfile or image name.
Mount points can be added with
runtime=mrp.Docker(
image="ghcr.io/alephzero/log:latest",
mount=["/tmp/logs:/tmp/logs"],
),
Other kwargs passed to Docker will be passed directly to the docker engine.
Add the following snippet to your ~/.bashrc
to get tab completion:
eval "$(_MRP_COMPLETE=bash_source mrp)"
We use black and flake8 to lint our code. The formatting
test will not pass if your code does not conform.
To make this easy for yourself, you can either
- Add the formattings to your IDE
- Install the git pre-commit hooks by running
pip install pre-commit pre-commit install
To format manually, run: black .