MLSysOps Framework
XMPP Service Configuration
This project uses the XMPP (Extensible Messaging and Presence Protocol) service for communication between agents. The XMPP service is powered by an ejabberd container, which we have set up for easy deployment and automatic configuration.
kubectl create configmap ejaberd-config --from-file=ejabberd.yml -n mlsysops-framework
Prerequisites
Before running the XMPP service, ensure you have the following installed on your system:
How It Works
The XMPP service is managed through a Docker container running ejabberd. We've provided an automatic configuration process that simplifies setup on any host machine.
Setup Instructions
To set up and run the XMPP service, follow these steps:
-
Ensures that you have all the necessary packages installed
Install the libraries of the requirements.txt file
pip install -r requirements.txt -
Set the IP Address of the Host
- Open the .env file in the root directory.
- Set the
IP_SELenvironment variable to the IP address of the host machine where the service will run.
Example
.envfile:IP_SEL=10.96.82.195
-
Configure ejabberd
- After setting the IP address in the
.envfile, run the configuration script to update the ejabberd.yml file with the IP address provided in the.envfile. - This script will automatically configure the XMPP service for you.
Command to run the script:
python config_script.py - After setting the IP address in the
-
Run the XMPP Service
Once the configuration is complete, you can start the XMPP service using Docker Compose.
Run the following command to start up the service:
docker-compose up -dDuring the setup process, an admin user will be automatically registered with a default password. If the process completes successfully, the console output should show the following confirmation message:
User admin@10.96.82.195 successfully registeredThis confirms that the admin user has been correctly registered in the XMPP service.
-
Agent connection test
This repository contains a simple example to test the connection between an agent and an XMPP service using a DummyAgent. The goal is to ensure that the agent can successfully authenticate and communicate with the XMPP server.
-
Ensure that the host machine running the test script has network connectivity to the XMPP server. You can check this by pinging the server:
-
Configure the agent using the following Python code snippet. Please double check that you are using the admin user and the IP address previously configured.
dummy = DummyAgent("admin@10.96.82.195", "1234") -
Run the script, If the connection succeeds, you will see the following message printed in the console:
Hello World! I'm agent admin@10.96.82.195
-
-
Agent registration
To register the agents that will be supported by the XMPP service, you can use the user_reg.py script. This script reads usernames and passwords from the users.txt file and registers the users on the XMPP service.
Once the XMPP service is up and running, simply execute the script to create and register the JIDs (Jabber IDs) that the agents will use for communication.
The format of the users.txt needs to be as follows:
agentid1,password1 agentid2,password2
Following the previous steps, an agent can be instantiated to communicate with any other agent in the framework through the XMPP service
Node Agent
In this use case, the node agent is responsible for gathering telemetry data from the application running on the node. This includes monitoring the application's behavior as well as collecting CPU and memory metrics from the node itself. Using this information, the agent performs a machine learning (ML) model inference to predict the application's future behavior. The prediction results are then sent to the cluster agent, which uses this data to make decisions.
The node agent uses OpenTelemetry (OTEL) to collect performance data from both the node and the application. Additionally, the agent uses OTEL to share the inference results with the cluster agent for further processing.
Configuring the Node Agent Install OpenTelemetry: First, install the OTEL library, which is required for telemetry collection and data exchange.
pip install -r requirements.txt
Set Up OTEL Variables: You need to configure the necessary OTEL environment variables as follows:
TELEMETRY_ENDPOINT="172.25.27.228:4317" to push
LOCAL_OTEL_ENDPOINT="http://172.25.27.228:9999/metrics"
Configure Agent Information, providing the following information in the environment configuration:
NODE_NAME=node
NODE_PASSWORD=1234
CLUSTER_NAME=cluster
EJABBERD_DOMAIN=10.96.82.195
- Node agent name: The name of the agent running on the node.
- Agent password: The password of the node agent.
- Cluster agent name: The cluster agent to which the node agent will be subscribed.
- XMPP domain: The domain of the XMPP service used for communication.
- Note: is worth to say that the jids need to be previously registered as in the previous steps.
Once the environment is set up, you can run the node agent to start collecting telemetry and performing ML inferences.
N_agent.service file is also provide to run the agent script as a daemon in linux systems.
Project status
Testing phase.
Metadata
Release files for mlsysops 0.0.0.post16078471394
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mlsysops-0.0.0.post16078471394.tar.gz | 53.7 kB | Without provenance | Details for mlsysops-0.0.0.post16078471394.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mlsysops-0.0.0.post16078471394-py3-none-any.whl | Python 3 | none | any | Details for mlsysops-0.0.0.post16078471394-py3-none-any.whl |
Total release size: 137.8 kB
Release files / mlsysops-0.0.0.post16078471394.tar.gz
| Download URL | mlsysops-0.0.0.post16078471394.tar.gz |
|---|---|
| Size | 53.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84c7142a3af02073e6124adaeefeb69778faff8d8f73ee2e3988121273ebd451
|
|
BLAKE2b-256 checksum How to use checksums |
a1ba9269eddeec50f2f8a7e7f5c9d2e9267c23f70e6fb4da637ccf1675e72e7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / mlsysops-0.0.0.post16078471394-py3-none-any.whl
| Download URL | mlsysops-0.0.0.post16078471394-py3-none-any.whl |
|---|---|
| Size | 84.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a0e5afab55154759e4f137b412ca6812acb27fa2418d585829933a09380e804
|
|
BLAKE2b-256 checksum How to use checksums |
e14b1dd21555692a41a56c694a3a2957c28fe0a3556f5fa0eec002a5b6146818
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for mlsysops 0.0.0.post16078471394
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.