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.2.1.tar.gz (43.6 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.2.1-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mrg_iot-1.2.1.tar.gz
  • Upload date:
  • Size: 43.6 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.2.1.tar.gz
Algorithm Hash digest
SHA256 6d185e71e55c0fa350ad7ad09aeab120a2c537675194a897eacb71ca11cff2b3
MD5 9e94630c53a0b4af57bd98e03f743663
BLAKE2b-256 b8b25bcfde0c6522ab89e932a5ec2ab424f661a009dd68fab04e91589187fa18

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mrg_iot-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 31.9 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19f4705903ef6abf9319c123859cc127a7965a7a24e8a28cbafad40ab05d5e27
MD5 40d8ff3d69ec4baa7272f24c55168f9a
BLAKE2b-256 af371cda6d034d755b07553603f5b41e3fdade5124579fefbd57e0c1823d916e

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