The OEO provides a method for user scripts running in an experiment node to pass messages to the OEO Console that will be displayed for an Operator (or Experimenter in development mode while wearing the Operator hat) to see. This service is accessible at http://192.168.32.25:12435/oeo_msg/....
To post a message from a bash scrip to the OEO Console, use an HTTP POST:
curl -X POST http://${AP_EXPENV_OEOCVM_XM:-192.168.32.25}:12435/oeo_msg/PUT_SEVERITY_HERE/PUT_URL_SAFE_BASE64_ENCODED_MESSAGE_HERE
The severity can be one of:
INFO
WARNING
ERROR
CRITICAL
The message to be posted to the OEO Console should be a utf-8 message that has been converted to URL-safe base64 (+ becomes -, / becomes _, =s are truncated). This method of encoding was chosen to avoid limitations provided by URL encoding, while also allowing for easy conversion (natively supported by most scripting languages).
Some tools for converting to base64:
NOTE: the OEO Console is used by operators to monitor the state of experiments. Many messages of various priorities are sent to the console with the expectation that an operator has a reasonable amount of time to read all of them. Please do not post a large number of messages to the console in a short period of time, and make sure to use a reasonable severity to aid in message filtering during debugging.
An example of posting a message to the OEO Console from a Python user script is below:
import requests
import base64
import os
def post_message(severity: str, message: str):
if severity not in ["INFO", "WARNING", "ERROR", "CRITICAL"]:
raise Exception("severity provided not supported")
message_encoded = base64.urlsafe_b64encode(message.encode('utf-8'))
oeo_ip = os.getenv("AP_EXPENV_OEOCVM_XM", "192.168.32.25")
requests.post(f"http://{oeo_ip}:12435/oeo_msg/{severity}/{message_encoded.decode('utf-8')}")
post_message("INFO", "hi from an experimenter script!")