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.8.tar.gz (33.2 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.8-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mrg_iot-1.1.8.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for mrg_iot-1.1.8.tar.gz
Algorithm Hash digest
SHA256 c57e40f3c762a6cb291385131b594b5ff8b415df1fd2d0314e42f666f451e33c
MD5 5bc0ae564d7897b91271a07b92d879a0
BLAKE2b-256 d192e33837c138736c08161e90e075f7827c2627274ea29786cb525b4fb43de6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mrg_iot-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for mrg_iot-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7e6c8ed725d76c5894c6026d793fd29701124188340646820f8731360538cf9d
MD5 363b7e5aa13ec2c0fd8b5bd8e0e29bd8
BLAKE2b-256 a8364a341057b6528a10f404de708d10db8ef257f4e7aaef9659d611caf34fe0

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