https://github.com/elbowz/pymape
Distributed and decentralized MAPE-K loops framework
https://github.com/elbowz/pymape
decentralized distributed influxdb mape mape-k python redis self-adaptive
Last synced: 2 months ago
JSON representation
Distributed and decentralized MAPE-K loops framework
- Host: GitHub
- URL: https://github.com/elbowz/pymape
- Owner: elbowz
- License: gpl-3.0
- Created: 2022-03-22T10:32:15.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-20T16:06:48.000Z (over 2 years ago)
- Last Synced: 2025-03-30T14:01:43.065Z (2 months ago)
- Topics: decentralized, distributed, influxdb, mape, mape-k, python, redis, self-adaptive
- Language: Python
- Homepage: https://elbowz.github.io/PyMAPE/
- Size: 7.02 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
Distributed and decentralized MonitorAnalyzePlanExecute-Knowledge loops framework
Framework to support the development and deployment of Autonomous (Self-Adaptive) Systems
---
* __Source Code__: [https://github.com/elbowz/PyMAPE](https://github.com/elbowz/PyMAPE)
* __Documentation__: [https://elbowz.github.io/PyMAPE](https://elbowz.github.io/PyMAPE) - _WIP_---
## Install
```bash
pip install pymape
```## Examples
Implementation of the 5 decentralized (and distributed) MAPE patterns described in the paper:
["On Patterns for Decentralized Control in Self-Adaptive Systems", Danny Weyns](https://www.ics.uci.edu/~seal/publications/2012aSefSAS.pdf)* **Ambulance-Car Emergency** (Information Sharing and Coordinated Control)
* **Average Speed Enforcement** (Master/Slave)
* **Dynamic Carriageway** (Regional Planning)
* **Cruise Control with Distance Hold** (Hierarchical Control)If you want try some examples (path `examples/`), refer to section `# CLI EXAMPLES` inside the source code of each one.
[Slide - Introduction to PyMAPE](https://github.com/elbowz/PyMAPE/raw/main/docs/slides.pdf) with examples
The examples need furthers requirements, please see [pyproject.toml](https://github.com/elbowz/PyMAPE/raw/main/pyproject.toml) or use poetry to [install them](https://github.com/elbowz/PyMAPE#install-for-developers-and-contributors).
You also need a Redis and InfluxDB instance running, for example:
```bash
docker run --name mape-redis -p 6379:6379 \
-v $(pwd)/docker/redis:/usr/local/etc/redis \
--rm redis redis-server /usr/local/etc/redis/redis.conf
``````bash
docker run --name mape-influxdb -p 8086:8086 \
-v $(pwd)/docker/influxdb/data:/var/lib/influxdb2 \
-v $(pwd)/docker/influxdb/conf:/etc/influxdb2 \
-e DOCKER_INFLUXDB_INIT_MODE=setup \
-e DOCKER_INFLUXDB_INIT_USERNAME=user \
-e DOCKER_INFLUXDB_INIT_PASSWORD=qwerty123456 \
-e DOCKER_INFLUXDB_INIT_ORG=univaq \
-e DOCKER_INFLUXDB_INIT_BUCKET=mape \
-e DOCKER_INFLUXDB_INIT_RETENTION=1w \
-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN= \
--rm influxdb:2.0
```See source for more information.