Local Testing Guide - conix-center/arts Wiki

Instructions for local testing of ARTS and the linux runtime. See runtime-benchmarks for full documentation of available benchmark options, and arena-runtime-linux for runtime options.

Setup

Required Components:

  1. Install mosquitto: sudo apt-get install mosquitto
  2. Set up ARTS
  3. Set up the Linux Runtime

Optional:

Run

  1. Terminal 1 (MQTT): run mosquitto (use default settings; can run in any directory)
mosquitto
  1. Terminal 2 (ARTS): run ARTS (in arts/arts-main)
cd arts/arts-main
make run
  1. Terminal 3 (Manager): run runtime manager script (in arena-runtime-linux/runtime-benchmarks)
cd arena-runtime-linux/runtime-benchmarks
python run.py --type PY --host localhost --port 1883 --arts --kwargs host=localhost:1883 --mode profile --script arenatest.py
  1. Terminal 4 (Runtime): run the generated runtime.sh script.
cd arena-runtime-linux/runtime-benchmarks
chmod +x runtime.sh  # first time only
./runtime.sh

Wait until you see [Runtime] Initialization complete.. If you do not see this, something has gone wrong. To get a full log, use:

python run.py --type PY --host localhost --port 1883 --arts --kwargs host=localhost:1883 verbose=5 --mode profile --script arenatest.py

Typical initialization output with default verbose levels (your UUID will be different):

[Runtime] ARENA Linux Runtime
[Runtime] UUID: a7ade6fe-9e6c-4b30-9f93-8fa8b2b71c16

[Runtime] Verbose Levels: parser=2 | wamr=2 | modules=2 | mqtt=2 | runtime=2 | profile=2 | channels=0

[Runtime] Initializing...
[Runtime] Initialized: WAMR Runtime Environment
[Runtime] Initialized: Module Manager
[MQTT] Subscribe: realm/proc/reg
[MQTT] Runtime Registered!
[MQTT] Unsubscribe: realm/proc/reg
[MQTT] Subscribe: realm/proc/control/a7ade6fe-9e6c-4b30-9f93-8fa8b2b71c16
[Runtime] Initialized: MQTT Client
[Runtime] Initialization complete.
  1. Terminal 3 (Manager): return to this terminal and press 'enter'.

Expected Output

Expected output, in order, is:

  1. Terminal 3 (Manager): should print (with different UUID):
[Runtime] Creating module on topic realm/proc/control:
{"object_id": "e27c46ea-34a8-4676-93d7-164825022674", "action": "create", "type": "arts_req", "data": {"type": "module", "parent": {"uuid": "ce9d54a2-001f-4d95-a154-bd2769bd9fe7"}, "uuid": "59011a7e-1ca5-46bf-82d9-d9a4eea2906f", "name": "arenatest.py", "filename": "rustpython.wasm", "filetype": "PY", "args": ["rustpython.wasm", "python-apps/arenatest.py"], "env": ["MQTTH=arena.andrew.cmu.edu", "REALM=realm", "SCENE=test", "NAMESPACE=test", "ARGV="]}}
  1. Terminal 2 (ARTS): should print:
Received control message [topic=realm/proc/control]:
{'object_id': 'e27c46ea-34a8-4676-93d7-164825022674', 'action': 'create', 'type': 'arts_req', 'data': {'type': 'module', 'parent': {'uuid': 'ce9d54a2-001f-4d95-a154-bd2769bd9fe7'}, 'uuid': '59011a7e-1ca5-46bf-82d9-d9a4eea2906f', 'name': 'arenatest.py', 'filename': 'rustpython.wasm', 'filetype': 'PY', 'args': ['rustpython.wasm', 'python-apps/arenatest.py'], 'env': ['MQTTH=arena.andrew.cmu.edu', 'REALM=realm', 'SCENE=test', 'NAMESPACE=test', 'ARGV=']}}
Response [topic=realm/proc/control/ce9d54a2-001f-4d95-a154-bd2769bd9fe7]:
{"object_id": "43cf1a19-0fe5-43d3-b798-083e80a6045a", "action": "create", "type": "arts_req", "data": {"type": "module", "uuid": "59011a7e-1ca5-46bf-82d9-d9a4eea2906f", "name": "arenatest.py", "parent": {"uuid": "ce9d54a2-001f-4d95-a154-bd2769bd9fe7"}, "filename": "rustpython.wasm", "filetype": "PY", "apis": ["python:python3"], "args": ["rustpython.wasm", "python-apps/arenatest.py"], "env": ["MQTTH=arena.andrew.cmu.edu", "REALM=realm", "SCENE=test", "NAMESPACE=test", "ARGV="], "channels": [], "peripherals": []}}
  1. Terminal 4 (Runtime): should launch the module:
[Module] Creating Module: arenatest.py
[Module] Launching Module: ./rustpython.wasm
[Module] Env len: 5 | Dir len: 1
[Module] sched_deadline: Utilization: 10 | Affinity: -1
[Module] Command: echo 13841 > /sys/fs/cgroup/cpuset/-1/tasks &
[Module] Running main: rustpython.wasm | argc: 2

NOTE: if sched_deadline is not working, you may also see

sh: 1: [Module] sched_setattr: Argument list too long
cannot create /sys/fs/cgroup/cpuset/-1/tasks: Directory nonexistent
  1. Terminal 2 (ARTS): After the module finishes initializing, should begin to log:
[Profile] saving data (n=10)...
[Profile] saving data (n=20)...
[Profile] saving data (n=30)...
[Profile] saving data (n=40)...
...