Skip to main content

IoT Testbed Experiment Automation CLI for MergeTB / Sphere Testbed

Project description

mrg-iot

A Python CLI for automating IoT testbed experiments on the Sphere / Merge Testbed platform.

mrg-iot drives the full experiment lifecycle so you don't have to:

  • Create an experiment and its network model for the selected devices.
  • Realize and materialize the model.
  • Create an XDC (eXperimental Data Center) and attach it to the materialization.
  • Set up SSH port forwarding for RTSP streams and file downloads.
  • (Optional) De-materialize and clean up resources when you're done.

Installation

pipx install mrg-iot

(Or pip install mrg-iot inside a virtualenv.)

mrg-iot requires Python 3.9+ and a working VLC install on the host for RTSP playback — pip can't install VLC for you.

Usage

Interactive mode

mrg-iot login        # save credentials to ~/.mrg-iot/config.json
mrg-iot              # walk through the experiment flow

Non-interactive mode

mrg-iot --non-interactive \
    --project neuiot \
    --devices s-echodot-1 \
    --exp-name myexp \
    --exp-desc "my experiment" \
    --realization realiot \
    --duration 1w \
    --xdc myxdc

Cleanup subcommands

mrg-iot exp delete         --project neuiot --name myexp
mrg-iot exp dematerialize  --project neuiot --name myexp --realization realiot
mrg-iot xdc detach         --project neuiot --name myxdc --experiment myexp --realization realiot
mrg-iot xdc delete         --project neuiot --name myxdc

Run mrg-iot --help for the full flag list.

Debug logging

mrg-iot --debug      # verbose logs to stderr + debug.log

Input validation

The CLI validates inputs upfront so bad args fail fast rather than deep inside a portal call:

  • Names (exp-name, realization, xdc, network): start with a letter, lowercase letters and digits only, max 32 chars.
  • Description: letters, digits, spaces, commas, periods, hyphens; max 256 chars.
  • Duration: minimum 4 days. Accepts 1w, 4d, 1w2d, 1 week, etc.

macOS SSL note

If portal calls fail with an SSL error on macOS:

export SSL_CERT_FILE="$(python -m certifi)"
export REQUESTS_CA_BUNDLE="$SSL_CERT_FILE"

Development

git clone https://gitlab.com/sphere-neu/mrg-iot.git
cd mrg-iot
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

mypy .
pylint *.py
black *.py
isort *.py

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mrg_iot-1.1.9.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mrg_iot-1.1.9-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file mrg_iot-1.1.9.tar.gz.

File metadata

  • Download URL: mrg_iot-1.1.9.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mrg_iot-1.1.9.tar.gz
Algorithm Hash digest
SHA256 565b8d6dc891fb8edc566dfb6b2e6183c0623a2fae22ba5da4a1d298faeea1dc
MD5 2eadd8791a6315ba74f9d7a67d4e5278
BLAKE2b-256 830dbfdce1d2b0775a018ce26043d0ba2c1bf609db77eb7de4a8f3ea9bdbcc89

See more details on using hashes here.

File details

Details for the file mrg_iot-1.1.9-py3-none-any.whl.

File metadata

  • Download URL: mrg_iot-1.1.9-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mrg_iot-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4418361392a0ab5c0f01bc06e8b8e618e504f76e5a9e8a844b49194e9ab63036
MD5 5c3d5ac39ae6d4a400c938079cff48ba
BLAKE2b-256 9401d27b967f67d6c40822569db444837be652791b99af8984dbcce8ccf1cff8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page