The titan Grid Manager
The titan Grid Manager is in charge of starting flows and managing control peers. It can be reached via a REST API that serves under HOST:8080.
Building/ running
To run the service simply use go run ./cmd/gridmanager
or to create an executable file go build ./cmd/gridmanager
It features the following command line arguments:
Name | Options (default) | Purpose |
---|---|---|
port | (8080) | Port on which the grid manager serves |
log-level | info/debug/warning/error | Log level |
(info) | ||
log-to-kafka | (false) | Flag: use kafka hook for logging |
kafka | (10.14.0.23:9092) | host:port of kafka broker |
service-topic | (titan.servicelogs) | kafka topic for logs |
config-file | (internal/app/gridmanager/config.yaml) | Configuration file |
The default configuration file contains the following items:
Name | Type | Doc (default value) | Constraints |
---|---|---|---|
repo-service | string | URL of the Repository Service (http://127.0.0.1:8085) | [not null] |
user-manager | string | URL of the User Service (http://127.0.0.1:9000) | |
allowed-origins | list | List of allowed origins for CORS request | [not null] |
Generally all settings listed above can be done also via environment variables, whereby the variables are composed of a prefix (TITAN_GM) and the argument using snake case:
TITAN_GM_ARGUMENT
, e.g. TITAN_GM_ALLOWED_ORIGINS
Usage
List ControlPeers
API function:
/gridmanager/controlpeers
Type: GET
Request data: No data needs to be sent.
Response data: List of controlPeer objects
Register a ControlPeer
API function:
/gridmanager/controlpeers/
Type: POST
Request data: ControlPeer Address string.
Response data: No data is returned.
Deregister a ControlPeer
API function:
/gridmanager/controlpeers/
Type: DELETE
Request data: ControlPeer Address string.
Response data: No data is returned.
Start/stop a flow
API function:
/gridmanager/flows/start/{flowId:string}
Type: PUT
/gridmanager/flows/stop/{flowId:string}
Type: PUT
Request data: A flowConfig object with bricks and connections.
Response data: A boolean of the flows run state.
Get run state of a flow
API function:
/gridmanager/flows/state/{flowId:string}
Type: GET
Request data: No data
Response data: A flow object.
Get running flows
API function:
/gridmanager/flows
Type: GET
Request data: No data
Response data: A list of flow objects.
Register a BrickRunner
API function:
/gridmanager/brickrunners/
Type: POST
Request data: in json:
Description of the registration message of a BrickRunner
Items:
Name | Type | Doc | Constraints |
---|---|---|---|
runnerId | string | Brick Runner ID | [not null] |
address | string | Brick Runner address | |
brickId | string | Instance ID of the brick run by the BRs |
Response data: json marshalled list of input sources: Input source sent to a brick runner
Items:
Name | Type | Doc | Constraints |
---|---|---|---|
name | string | brick instance id | [not null] |
port | string | port to connect to | |
autoscale_queue_level | int | queue level for autoscaling | |
address | string | addres of the brick runner |
Scale a brick consumer
API function:
/gridmanager/brickrunners/scaling
Type: POST
Request data: in json:
Description of the scaling message of a BrickRunner
Items:
Name | Type | Doc | Constraints |
---|---|---|---|
brickId | string | instance id of the brick | [not null] |
consumerId | string | instance id of the consuming brick | [not null] |
Response data: none
Deregister a BrickRunner
API function:
/gridmanager/brickrunners/deregister
Type: POST
Request data: in json:
Description of the deregistration message of a BrickRunner
Items:
Name | Type | Doc | Constraints |
---|---|---|---|
runnerId | string | Brick Runner ID | [not null] |
brickId | string | Instance ID of the brick run by the BRs |
Response data: none