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.10.tar.gz (33.8 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.10-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mrg_iot-1.1.10.tar.gz
  • Upload date:
  • Size: 33.8 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.10.tar.gz
Algorithm Hash digest
SHA256 189a69252107daa90694727cd36be53e71e7c1137695ace718403f1bae607f88
MD5 3878599c2b190c869f2198b2e833bc6e
BLAKE2b-256 b77189b419583c1c0beca25bca96bcd10ca93833c489a73a7b488f60d630c5c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mrg_iot-1.1.10-py3-none-any.whl
  • Upload date:
  • Size: 29.2 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c7691facc94418677b7785ac15418508385cab5cacd4c783cb67da9095c1627d
MD5 b2e3e8e1095bc73aa4be584fccf1731f
BLAKE2b-256 5dbaf4c87ae58833704e9e572ef458af8d0ba543f32e7e56dcb70c9674b8e8de

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