Copyright (c) 2023 Antmicro
A Python library for interacting with Renode programmatically.
Use pip to install pyrenode3:
pip install 'pyrenode3[all] @ git+https://github.com/antmicro/pyrenode3.git'
If you have Renode installed, then pyrenode3
will interact with it.
Otherwise, if you don't want to install Renode, you can download a Arch package from here and set PYRENODE_PKG
to its's location.
To quickly run a sample demo, download the package and run:
wget https://builds.renode.io/renode-latest.pkg.tar.xz
wget https://raw.githubusercontent.com/antmicro/pyrenode3/main/examples/unleashed-fomu.py
export PYRENODE_PKG=`pwd`/renode-latest.pkg.tar.xz
bpython -i unleashed-fomu.py
This will spawn a two-machine demo scenario and, when the Linux boots to shell, you will be able to interact with the simulation via bpython interface.
pyrenode3
can be configured using environment variables:
PYRENODE_PKG
- Specifies the location of Renode package that will be used bypyrenode3
.PYRENODE_BUILD_DIR
- Specifies the location of Renode source directory.pyrenode3
will use Renode which was built in that directory. To modify the output directory used as a source of Renode binaries (location ofRenode.exe
), you must set thePYRENODE_BUILD_OUTPUT
variable, with a path relative toPYRENODE_BUILD_DIR
.PYRENODE_RUNTIME
-- Specifies runtime which is used to run Renode. Supported runtimes:mono
(default),coreclr
(.NET).PYRENODE_BIN
-- Specifies the location of Renode portable binary that will be used bypyrenode3
.
PYRENODE_PKG
and PYRENODE_BUILD_DIR
are mutually exclusive.
Exactly one of them must be specified to use pyrenode3
successfully.
If no variable is specified pyrenode3
will look for the Renode installed in your operating system.
Mono | .NET | |
---|---|---|
Installed | ✅ | ❌ |
Package | ✅ | ✅ |
Built from sources | ✅ | ✅ |
Portable binary | ❌ | ✅ |