This software is consist of three main components based on the architecture that is illustrated below.
The main component is backend-service-manager
which has the features listed below.
- Handling the connection from
Executer
s - Cheking the status of the connections
- Keeping the connections alive
- Storing an incoming task and its metadata in memory
- Assigning a task to a free
Executer
- Replyig to requests from API server
As the name hints, its main feature is to provide an interface for users to interact with Service Manager. Follow this link to find more about the API endpoints.
This piece of software is the part of the node/container/machine on which you want that task to be run. It constantly communicates with Service Manager, sends its status, and waits for a task to be assigned by keeping the socket connection open to the server. By decoupling this component from the Service Manager, we can scale out or in the runners according to the requirements of the load in the system. The time to wait for a runner to be up and running is eliminated by provisioning them before scheduling any tasks. Practically, we can add up as many runners as we need, and a single instance of the Service Manager will handle the load.
For convenience, you can start the cloud containers with docker compose:
docker compose up --build -d
Build and run the API image
cd api
docker build -f Dockerfile -t k8s-manager-api .
docker run -p 5001:5001 --env HOST=0.0.0.0 -d k8s-manager-api
Build and run the service manager image
cd manager
docker build -f Dockerfile -t k8s-manager-service .
docker run -d k8s-manager-service
To run this system, follow the following instructions in order.
- Service Manager
cd manager
python service.py
- API Server
cd api
python app.py
- Runners
- It is possible to run multiple instances of this service on a same machine
cd worker
# Run on localhost
python service.py
# Connect to external host
python3 service.py -a <host address> -p <port>
This project has received funding from the Key Digital Technologies Joint Undertaking (KDT JU) under grant agreement No 877056. The JU receives support from the European Union’s Horizon 2020 research and innovation programme and Spain, Italy, Austria, Germany, Finland, Switzerland.