cloneMAP: cloud-native Multi-Agent Platform

cloneMAP: cloud-native Multi-Agent Platform

cloneMAP is a multi-agent platform (MAP) that is designed to run in a cloud environment based on Kubernetes. The aim of this project is to combine the advantages of cloud computing and a distributed computing paradigm such as multi-agent systems.

pipeline status Go Report Card License: MIT License

Overview

Architecture

cloneMAP consists of four modules. Each module is implemented in a scalable and robust way. Where possible, applications are stateless and hence horizontally scalable. State is stored in distributed storages and databases. The single modules can be deployed and used independently. They are coupled by means of REST APIs.

Core

The core components of cloneMAP are the agent management system (AMS), an etcd store and agencies. The AMS (API) is responsible for managing all MASs and the corresponding agents running in cloneMAP. Typical tasks are agent creation, monitoring and termination. To allow the AMS to be horizontally scalable, its state (configuration and status information) is stored in an etcd cluster.

Agencies (API) are the deployment unit for agents. Each agency hosts a specified number of agents. Agencies have the task to aggregate common operations in order to relieve the AMS. In Kubernetes terms an agency is a pod with one container. The agents are single go-routines executed within the agency.

DF

To provide agents with the ability to explore each other the so called directory facilitator (DF) is implemented (API). It consists of the scalable service registry and an etcd store. The same etcd cluster as for the AMS is used. The service registry provides functionalities such as registering, deregistering and searching for services. Hence, agents can us it as yellow pages service.

State and logging

As agents usually have a certain state that changes over time, that state needs to be saved in order to make the platform robust. This is done by module state and logging. A DB service provides agents with a REST API for storing state and logs. Upon restart the agents can query the last state stored in the DB and continue their work from that point. A Cassandra DB is used as backend.

IoT

In order to connect the agents running in cloneMAP to the outside world a message broker is used. Currently only MQTT is available. With the help of this message broker agents can interact with devices outside the cloud (e.g. IoT-devices). This module is called IoT-Interface.

UI

For easy user interaction it is planned to provide a WebUI that interacts with the AMS via its REST API. The WebUI is not yet available.

Getting Started

The following documentation is available for cloneMAP:

Documentation of the code follows the godoc specification.

Copyright

2020, Institute for Automation of Complex Power Systems, EONERC

License

This project is licensed under either of

at your option.

Contact

EONERC ACS Logo

Institute for Automation of Complex Power Systems (ACS)
EON Energy Research Center (EONERC)
RWTH University Aachen, Germany

Owner
RWTH Aachen University, Institute for Automation of Complex Power Systems
RWTH Aachen University, Institute for Automation of Complex Power Systems
Comments
  • curl DELETE does not delete anything

    curl DELETE does not delete anything

    While trying to terminate single agents or full MAS, I found that deleting something does not work.

    Two examples:

    1. Deleting an agent.

    Current behaviour

    I put the request requests.delete("localhost:30009/api/clonemap/mas/2/agents/4") and get a response 200. The corresponding agent received the request: 2022-01-11 07:40:01,106 - [INFO] - Agency: Received Request: DELETE /api/agency/agents/4 Afterwards, I can still access http://localhost:30009/api/clonemap/mas/2/agents/4 and get all data. Also, the docker container is not stopped.

    Expected behaviour

    The docker container is stopped and the agent with id 4 is deleted.

    2. Deleting an MAS.

    Current behaviour

    I put the request requests.delete("localhost:30009/api/clonemap/mas/0") and get a response 200. Before this request, running docker ps -a yields

    CONTAINER ID   IMAGE                                                                      COMMAND                  CREATED              STATUS              PORTS                                         NAMES
    d609977c113c   testdizwionclonemap                                                        "python -u agentlib/…"   9 seconds ago        Up 8 seconds                                                      mas-0-im-0-agency-5.mas0agencies
    1357070d0d84   testdizwionclonemap                                                        "python -u agentlib/…"   10 seconds ago       Up 9 seconds                                                      mas-0-im-0-agency-4.mas0agencies
    19410bb7b002   testdizwionclonemap                                                        "python -u agentlib/…"   10 seconds ago       Up 10 seconds                                                     mas-0-im-0-agency-3.mas0agencies
    2c8b3ebd44d9   testdizwionclonemap                                                        "python -u agentlib/…"   11 seconds ago       Up 11 seconds                                                     mas-0-im-0-agency-2.mas0agencies
    147a352a9b38   testdizwionclonemap                                                        "python -u agentlib/…"   14 seconds ago       Up 13 seconds                                                     mas-0-im-0-agency-1.mas0agencies
    d08e9659a79c   testdizwionclonemap                                                        "python -u agentlib/…"   15 seconds ago       Up 14 seconds                                                     mas-0-im-0-agency-0.mas0agencies
    3335807b57f4   eclipse-mosquitto:1.6.13                                                   "/docker-entrypoint.…"   About a minute ago   Up About a minute   0.0.0.0:30883->1883/tcp, :::30883->1883/tcp   clonemap_mqtt_1
    2d25e956e033   registry.git.rwth-aachen.de/acs/public/cloud/mas/clonemap/ams              "./ams"                  About a minute ago   Up About a minute   0.0.0.0:30009->9000/tcp, :::30009->9000/tcp   clonemap_ams_1
    9d106a3448d4   registry.git.rwth-aachen.de/acs/public/cloud/mas/clonemap/clonemap_local   "docker-entrypoint.s…"   About a minute ago   Up About a minute   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp     kubestub
    

    The MAS logs the following (I also added two GET requests):

    kubestub    | Received Request: DELETE /api/container/0
    mqtt_1      | 1641887899: Socket error on client auto-8C05EB97-C8E6-E789-1157-8A4A1424425B, disconnecting.
    mqtt_1      | 1641887902: Socket error on client auto-B97DC532-C70A-32B5-5673-5915E5B0AFBB, disconnecting.
    mqtt_1      | 1641887904: Socket error on client auto-DFE8AD9A-6AEE-7665-8904-77E3931471C9, disconnecting.
    mqtt_1      | 1641887907: Socket error on client auto-3A860F08-4444-28F1-5EF2-A13277D1F795, disconnecting.
    ams_1       | [INFO] 2022/01/11 07:59:57 Received Request:  GET   /api/clonemap/mas/1
    ams_1       | [ERROR] 2022/01/11 07:59:57 /api/clonemap/mas/1 MAS does not exist
    ams_1       | [INFO] 2022/01/11 08:00:00 Received Request:  GET   /api/clonemap/mas/0
    

    docker ps -a yields the correct statement, i.e. all agent containers are removed:

    CONTAINER ID   IMAGE                                                                      COMMAND                  CREATED         STATUS         PORTS                                         NAMES
    3335807b57f4   eclipse-mosquitto:1.6.13                                                   "/docker-entrypoint.…"   2 minutes ago   Up 2 minutes   0.0.0.0:30883->1883/tcp, :::30883->1883/tcp   clonemap_mqtt_1
    2d25e956e033   registry.git.rwth-aachen.de/acs/public/cloud/mas/clonemap/ams              "./ams"                  2 minutes ago   Up 2 minutes   0.0.0.0:30009->9000/tcp, :::30009->9000/tcp   clonemap_ams_1
    9d106a3448d4   registry.git.rwth-aachen.de/acs/public/cloud/mas/clonemap/clonemap_local   "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp     kubestub
    

    However, the GET request for MAS 0 still gives me all the data. Also, if I post a new MAS, the ID 0 is not used but instead, ID 1 is created. I think this results from the fact that GET does not return MAS does not exist.

    Expected behaviour

    The MAS is fully deleted and I can re-use ID 0

    @kwe712 @s-daehling : Could you comment on this error and tell me if it's a bug or actually a feature?

    As you can see, I am running it locally and using the following docker-compose:

    version: "3.7"
    
    services:
      kubestub:
        container_name: kubestub
        hostname: kubestub
        image: registry.git.rwth-aachen.de/acs/public/cloud/mas/clonemap/clonemap_local
        environment:
          CLONEMAP_LOG_LEVEL: ${CLONEMAP_LOG_LEVEL}
        volumes:
         - /var/run/docker.sock:/var/run/docker.sock
        ports:
         - 8000:8000
        networks:
         - clonemap-net
        stop_grace_period: 30s
    
      ams:
        image: registry.git.rwth-aachen.de/acs/public/cloud/mas/clonemap/ams
        environment:
          CLONEMAP_DEPLOYMENT_TYPE: ${CLONEMAP_DEPLOYMENT_TYPE}
          CLONEMAP_STORAGE_TYPE: ${CLONEMAP_STORAGE_TYPE}
          CLONEMAP_LOG_LEVEL: ${CLONEMAP_LOG_LEVEL}
          CLONEMAP_STUB_HOSTNAME: ${CLONEMAP_STUB_HOSTNAME}
        ports:
         - 30009:9000
        depends_on:
          - kubestub
        networks:
          - clonemap-net
    
      mqtt:
        image: eclipse-mosquitto:1.6.13
        ports:
          - 30883:1883
        depends_on:
          - kubestub
          - ams
        networks:
          - clonemap-net
    
    networks:
      clonemap-net:
        name: clonemap-net
        attachable: true
    

    with .env

    CLONEMAP_STORAGE_TYPE=local
    CLONEMAP_DEPLOYMENT_TYPE=local
    # mqtt
    
    CLONEMAP_LOG_LEVEL=info
    # fe kubestub
    
    CLONEMAP_STUB_HOSTNAME=kubestub
    
    CLONEMAP_MODULE_MQTT=true
    CLONEMAP_MODULE_FRONTEND=true
    
    
  • ID of a deleted agent is not removed from agency's list of agents

    ID of a deleted agent is not removed from agency's list of agents

    When an agent is deleted, the list of agents from the corresponding agency is not updated. This prevents new agents to be scheduled to this agency if it has already reached the maximum number of agents per agency.

  • improve error message on invalid image

    improve error message on invalid image

    if an image given in the imagegroups config is nonexistent, clonemap (on the docker version) gives an exit code 125. giving back an "Image not found" message or similar instead would be helpful here. in some cases instead of the error code, clonemap does falsely report that agencies were created, but I haven't been able to reproduce that problem so far.

  • risk of code injection when creating agencies

    risk of code injection when creating agencies

    The function LocalStub.createAgency creates an agency, using go's exec package. In building the command for starting the agency's container, the name of a configured image is used without being checked first. This could make code injection possible if an image name is chosen containing ;, followed by any command. This command will be executed on the kubestub container. Depending on how it is set, the same problem may be caused by the log level setting

  • ImagePullErr when trying to run agentlib MAS with k8s

    ImagePullErr when trying to run agentlib MAS with k8s

    Starting an agentlib MAS works fine with the docker-compose version, but (for me) fails with kubernetes.

        "config":{
            "name":"test",
            "agentsperagency":1,
            "mqtt":{
                "active":true
            },
            "df":{
                "active":false
            },
            "logger":{
                "active":true,
                "msg":true,
                "app":true,
                "status":true,
                "debug":true
            }
        },
        "imagegroups":[
            {
                "config": {
                    "image":"agentlibtest"
                },
                "agents":[...]
            }
        ],
        "graph":{
            "node":null,
            "edge":null
        }
    }
    

    running the same example with docker-compose, the image gets pulled from registry.git-ce.rwth-aachen.de/ebc/projects/ebc_acs0017_bmwi_agent/agents_python/agentlib:latest just fine. With kubernetes, it results in an ErrImagePull, even if the image is already locally pulled and regardless of whether image-pull-policy is set to "Never" or "Always".

TurtleDex is a decentralized cloud storage platform that radically alters the landscape of cloud storage.

TurtleDex is a decentralized cloud storage platform that radically alters the landscape of cloud storage. By leveraging smart contracts, client-side e

Feb 17, 2021
Cloud-native way to provide elastic Jupyter Notebook services on Kubernetes
Cloud-native way to provide elastic Jupyter Notebook services on Kubernetes

elastic-jupyter-operator: Elastic Jupyter on Kubernetes Kubernetes 原生的弹性 Jupyter 即服务 介绍 为用户按需提供弹性的 Jupyter Notebook 服务。elastic-jupyter-operator 提供以下特性

Dec 29, 2022
A Cloud Native Buildpack for Go

The Go Paketo Buildpack provides a set of collaborating buildpacks that enable the building of a Go-based application.

Dec 14, 2022
cloud-native local storage management system
cloud-native local storage management system

Open-Local是由多个组件构成的本地磁盘管理系统,目标是解决当前 Kubernetes 本地存储能力缺失问题。通过Open-Local,使用本地存储会像集中式存储一样简单。

Dec 30, 2022
Elkeid is a Cloud-Native Host-Based Intrusion Detection solution project to provide next-generation Threat Detection and Behavior Audition with modern architecture.
Elkeid is a Cloud-Native Host-Based Intrusion Detection solution project to provide next-generation Threat Detection and Behavior Audition with modern architecture.

Elkeid is a Cloud-Native Host-Based Intrusion Detection solution project to provide next-generation Threat Detection and Behavior Audition with modern architecture.

Dec 30, 2022
Nocalhost is Cloud Native Dev Environment.
Nocalhost is Cloud Native Dev Environment.

Most productive way to build cloud-native applications. Nocalhost The term Nocalhost originates from No Local, which is a cloud-native development too

Dec 29, 2022
A Cloud Native Buildpack that contributes SDKMAN and uses it to install dependencies like the Java Virtual Machine

gcr.io/paketo-buildpacks/sdkman A Cloud Native Buildpack that contributes SDKMAN and uses it to install dependencies like the Java Virtual Machine. Be

Jan 8, 2022
A Cloud Native Buildpack that provides the Open Liberty runtime

gcr.io/paketo-buildpacks/open-liberty The Paketo Open Liberty Buildpack is a Cloud Native Buildpack that contributes Open Liberty for Java EE support.

Dec 21, 2022
A Cloud Native Buildpack that contributes the Syft CLI which can be used to generate SBoM information

gcr.io/paketo-buildpacks/syft The Paketo Syft Buildpack is a Cloud Native Buildpack that contributes the Syft CLI which can be used to generate SBoM i

Dec 14, 2022
Contentrouter - Protect static content via Firebase Hosting with Cloud Run and Google Cloud Storage

contentrouter A Cloud Run service to gate static content stored in Google Cloud

Jan 2, 2022
Terraform provider for HashiCorp Cloud Platform.

HashiCorp Cloud Platform (HCP) Terraform Provider Requirements Terraform >= 0.12.x Go >= 1.14 Building The Provider Clone the repository Enter the rep

Dec 25, 2022
An edge-native container management system for edge computing
An edge-native container management system for edge computing

SuperEdge is an open source container management system for edge computing to manage compute resources and container applications in multiple edge regions. These resources and applications, in the current approach, are managed as one single Kubernetes cluster. A native Kubernetes cluster can be easily converted to a SuperEdge cluster.

Dec 29, 2022
Lightweight Cloud Instance Contextualizer
Lightweight Cloud Instance Contextualizer

Flamingo Flamingo is a lightweight contextualization tool that aims to handle initialization of cloud instances. It is meant to be a replacement for c

Jun 18, 2022
Go language interface to Swift / Openstack Object Storage / Rackspace cloud files (golang)

Swift This package provides an easy to use library for interfacing with Swift / Openstack Object Storage / Rackspace cloud files from the Go Language

Nov 9, 2022
The extensible SQL interface to your favorite cloud APIs.
The extensible SQL interface to your favorite cloud APIs.

The extensible SQL interface to your favorite cloud APIs.

Jan 4, 2023
The Cloud Posse Terraform Provider for various utilities (E.g. deep merging)
The Cloud Posse Terraform Provider for various utilities (E.g. deep merging)

terraform-provider-utils Terraform provider to add additional missing functionality to Terraform This project is part of our comprehensive "SweetOps"

Jan 7, 2023
Cloud cost estimates for Terraform in your CLI and pull requests 💰📉
Cloud cost estimates for Terraform in your CLI and pull requests 💰📉

Infracost shows cloud cost estimates for Terraform projects. It helps developers, devops and others to quickly see the cost breakdown and compare different options upfront.

Jan 2, 2023
Google Cloud Client Libraries for Go.
Google Cloud Client Libraries for Go.

Google Cloud Client Libraries for Go.

Jan 8, 2023
Fleex allows you to create multiple VPS on cloud providers and use them to distribute your workload.
Fleex allows you to create multiple VPS on cloud providers and use them to distribute your workload.

Fleex allows you to create multiple VPS on cloud providers and use them to distribute your workload. Run tools like masscan, puredns, ffuf, httpx or anything you need and get results quickly!

Jan 6, 2023