{"id":26334362,"url":"https://github.com/ericzones/distributedrobotic","last_synced_at":"2025-09-10T06:35:29.678Z","repository":{"id":281378763,"uuid":"945098413","full_name":"EricZones/DistributedRobotic","owner":"EricZones","description":"Simulated distributed system of controller and robots using RPC and Message Oriented Middleware for communication","archived":false,"fork":false,"pushed_at":"2025-03-16T16:15:59.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-09T10:49:15.778Z","etag":null,"topics":["distributed-systems","grpc","mqtt","restapi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EricZones.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T16:51:58.000Z","updated_at":"2025-03-16T16:16:02.000Z","dependencies_parsed_at":"2025-03-08T17:41:53.559Z","dependency_job_id":null,"html_url":"https://github.com/EricZones/DistributedRobotic","commit_stats":null,"previous_names":["ericzones/distributedrobotic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EricZones/DistributedRobotic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricZones%2FDistributedRobotic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricZones%2FDistributedRobotic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricZones%2FDistributedRobotic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricZones%2FDistributedRobotic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EricZones","download_url":"https://codeload.github.com/EricZones/DistributedRobotic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricZones%2FDistributedRobotic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274422322,"owners_count":25282124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distributed-systems","grpc","mqtt","restapi"],"created_at":"2025-03-16T00:18:28.058Z","updated_at":"2025-09-10T06:35:29.658Z","avatar_url":"https://github.com/EricZones.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DistributedRobotic\n\nDistributedRobotic is a simulated distributed system with controller and robots. It uses RPC for the communication with a controller and Message Oriented Middleware between robots.\n\n## Features\n- **Controller:**\n    - Provides REST API with native sockets\n    - Provides gRPC interface for communication with robots\n    - Stores data and manages active robots\n    - Connection checks for active robots\n- **Robots:**\n    - Uses gRPC to communicate with controller\n    - Uses MQTT for communication between robots\n    - Handles captain failure by automated election of new captain with bully algorithm\n    - Multiple robots can be run\n    - Automated connection with controller and MQTT broker after entering a robot name\n- **Tests:**\n    - Testing REST API endpoints and round trip time\n    - Testing gRPC by communicating with controller and round trip time\n    - Testing MQTT by running robots and starting captain election including a stress test\n- **Others:**\n    - Use Docker-Compose to run controller, robot, tests and MQTT broker in containers\n    - Run Python scripts manually on your local system\n\n## Installation \u0026 Execution\n### 1. Containerized using Docker\n#### Requirements\n- Docker\n\n#### Execution\n```bash\n  docker-compose build\n  docker-compose up broker\n  docker-compose up controller\n  docker-compose up robot\n  ```\n\n### 2. On local system\n#### Requirements\n- Python 3.13\n- Grpcio/Grpcio-tools 1.71.0rc2\n- Paho-mqtt 2.1.0\n- Eclipse mosquitto\n\n#### Execution\n```bash\n  python ./src/controller/controller.py\n  \n  python ./src/robots/robot.py\n  ```\n\n## Runtime information\n### REST API endpoints\n| **Method** | **Endpoint**       | **Description**                    |\n|------------|--------------------|------------------------------------|\n| GET        | `/status`          | Get amount of active robots        |\n| GET        | `/captain`         | Get the current captain            |\n| GET        | `/health`          | Get the controller's health status |\n| POST       | `/electCaptain`    | Start a new captain election       |\n\n### Testing\nThis project includes both functional and non-functional tests:\n\n1. **Functional test**: Validates the correct operation of the REST endpoints, gRPC methods and MQTT topics.\n2. **Non-functional test**: Measures the round-trip time (RTT) of HTTP requests and gRPC method calls.\n\n- Non-functional test results locally available in tests_grpc_rtt.txt and tests_http_rtt.txt\n\n**(!) If testing without Docker HOST-variables in controller.py, robot.py, tests_http.py, tests_grpc.py and tests_mqtt.py need to be changed like described in the comments**\n\n### Running tests\n\u003cu\u003eUsing Docker\u003c/u\u003e\n```bash\n  docker-compose up tests\n  ```\n\u003cu\u003eRunning locally\u003c/u\u003e\n```bash\n  python ./tests/tests_http.py\n\n  python ./tests/tests_grpc.py\n  \n  python ./tests/tests_mqtt.py\n  ```\n\n## Purpose\nThe project simulates remote communication between services with RPC and Message Oriented Middleware.\nIt was originally created for an evaluation at the university in 2025.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericzones%2Fdistributedrobotic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericzones%2Fdistributedrobotic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericzones%2Fdistributedrobotic/lists"}