Skip to content

Commit bd3154e

Browse files
authored
Merge pull request #284 from code0-tech/feat/#283
Add module structure
2 parents 4d5d6c2 + 63bd0c4 commit bd3154e

17 files changed

Lines changed: 137 additions & 307 deletions

README.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,27 @@ services that Sagittarius must implement as a server.
5656
.
5757
├── aquila
5858
│ ├── action - Action service (emits events, and handles executions)
59-
│ ├── action_configuration - ActionConfiguration service
60-
│ ├── data_type - DataType service
61-
│ ├── flow_definition - FlowType service (handles flow_type updates)
62-
│ ├── runtime_function - Service for updating the runtime functions
59+
│ ├── module - Module service for Taurus to send over datatypes, functions and flow types
6360
│ ├── runtime_status - Service for runtime status (handles information about Draco and Taurus)
6461
│ └── runtime_usage - Service for runtime usage (handles execution time of a flow)
6562
├── sagittarius
66-
│ ├── action_configuration - ActionConfiguration service
67-
│ ├── data_type - DataType service
6863
│ ├── flow - Flow service (handles flow updates)
69-
│ ├── flow_type - FlowType service (handles flow_type updates)
64+
│ ├── module - Module service to receive datatypes, functions and flow types from aquila
7065
│ ├── ping - Ping service (performs life checks)
71-
│ ├── runtime_function - Service for updating the runtime functions
7266
│ ├── runtime_status - Service for runtime status (handles information about Draco and Taurus)
7367
│ ├── runtime_usage - Service for runtime usage (handles execution time of a flow)
7468
│ └── test_execution - Service and Types for the test execution
7569
└── shared
76-
├── action_configuration - Defines types for action configuration
7770
├── data_type - Defines types for data types
78-
├── flow - Defines types for flows
79-
├── flow_definition - Defines a definition for a Flow
80-
├── runtime_function - Defines types for runtime functions
81-
├── runtime_status - Defines types for runtime status (handles information about Draco and Taurus)
82-
├── runtime_usage - Defines types for runtime usage (handles execution time of a flow)
83-
├── struct - Defines types for json representations
84-
├── translation - Contains translations with country codes and translated messages
85-
└── version - Contains verion type for definitions
71+
├── errors - Defines error object
72+
├── execution_result - Defines execution result of a flow
73+
├── flow - Defines the flow to execute
74+
├── flow_type - Defines types for flows
75+
├── function - Defines a function
76+
├── module - Defines group of functions, runtime functions, flow types and data types
77+
├── runtime_function - Defines a runtime function
78+
├── runtime_status - Defines a runtime status (handles information about Draco and Taurus)
79+
├── runtime_usage - Defines a runtime usage (handles execution time of a flow)
80+
├── struct - Defines json representations
81+
└── translation - Contains translations with country codes and translated messages
8682
```

proto/aquila/aquila.action.proto

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ option ruby_package = "Tucana::Aquila";
44

55
package aquila;
66

7-
import "shared.action_configuration.proto";
7+
import "shared.module.proto";
88
import "shared.execution_result.proto";
99
import "shared.struct.proto";
1010

1111
// Event that gets admitted by an action
12-
message Event {
12+
message ActionEvent {
1313
// Id of Event type
1414
string event_type = 1;
1515
// Project Id that this event is emitted for
@@ -21,13 +21,11 @@ message Event {
2121
// Action flow/event configuration
2222
message ActionLogon {
2323
// Action identifier
24-
string action_identifier = 1;
25-
string version = 2;
26-
repeated shared.ActionConfigurationDefinition action_configurations = 3;
24+
shared.Module module = 1;
2725
}
2826

2927
// Request to execute a request a flow
30-
message ExecutionRequest {
28+
message ActionExecutionRequest {
3129
// Execution identifier of execution
3230
string execution_identifier = 1;
3331
// Function identifier of flow to execute
@@ -38,41 +36,30 @@ message ExecutionRequest {
3836
int64 project_id = 4;
3937
}
4038

41-
// Result from executed flows by an action
42-
message ExecutionResult {
43-
// Identifier of flow to execute
44-
string execution_identifier = 1;
45-
// Result of executed flow
46-
oneof result {
47-
shared.Value success = 2;
48-
shared.RuntimeError error = 3;
49-
}
50-
}
51-
52-
message TransferRequest {
39+
message ActionTransferRequest {
5340
oneof data {
5441
// Identification of the action
5542
//
5643
// Expected behavior:
5744
// Aquila will abort if the first request is not an ActionLogon
5845
ActionLogon logon = 1;
5946
// Event that got admitted
60-
Event event = 2;
47+
ActionEvent event = 2;
6148
// Result of execution that was triggered by a execution request
62-
ExecutionResult result = 3;
49+
shared.NodeExecutionResult result = 3;
6350
}
6451
}
6552

66-
message TransferResponse {
53+
message ActionTransferResponse {
6754
oneof data {
6855
// Execution request
69-
ExecutionRequest execution = 1;
70-
// ActionConfigurations that have been configured by the user
71-
shared.ActionConfigurations action_configurations = 2;
56+
ActionExecutionRequest execution = 1;
57+
// ModuleConfigurations that have been configured by the user
58+
shared.ModuleConfigurations module_configurations = 2;
7259
}
7360
}
7461

7562
service ActionTransferService {
7663
// This behavior achieves a bi-directional stream so that both services aren't required to be a server & client on their own
77-
rpc Transfer (stream TransferRequest) returns (stream TransferResponse);
64+
rpc Transfer (stream ActionTransferRequest) returns (stream ActionTransferResponse);
7865
}

proto/aquila/aquila.data_type.proto

Lines changed: 0 additions & 23 deletions
This file was deleted.

proto/aquila/aquila.flow_type.proto

Lines changed: 0 additions & 24 deletions
This file was deleted.

proto/aquila/aquila.function.proto

Lines changed: 0 additions & 24 deletions
This file was deleted.

proto/aquila/aquila.module.proto

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
syntax = "proto3";
2+
3+
option ruby_package = "Tucana::Aquila";
4+
5+
package aquila;
6+
7+
import "shared.module.proto";
8+
9+
// Request for updating a list of modules including data types, flow types and runtime function definitions
10+
message ModuleUpdateRequest {
11+
// List of modules
12+
repeated shared.Module modules = 1;
13+
}
14+
15+
// Response of updating modules including data types, flow types and runtime function definitions
16+
message ModuleUpdateResponse {
17+
// True if was successful, false if not
18+
bool success = 1;
19+
}
20+
21+
//This service will be implemented as a server by Aquila and as a client by Taurus.
22+
service ModuleService {
23+
rpc Update(ModuleUpdateRequest) returns (ModuleUpdateResponse) {}
24+
}

proto/aquila/aquila.runtime_function.proto

Lines changed: 0 additions & 24 deletions
This file was deleted.

proto/sagittarius/sagittarius.action_configuration.proto

Lines changed: 0 additions & 27 deletions
This file was deleted.

proto/sagittarius/sagittarius.data_type.proto

Lines changed: 0 additions & 25 deletions
This file was deleted.

proto/sagittarius/sagittarius.flow.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ option ruby_package = "Tucana::Sagittarius";
55
package sagittarius;
66

77
import "shared.flow.proto";
8-
import "shared.action_configuration.proto";
8+
import "shared.module.proto";
99

1010
//Aquila sends a request to initialise stream to Sagittarius
1111
message FlowLogonRequest {
@@ -20,8 +20,8 @@ message FlowResponse {
2020
int64 deleted_flow_id = 2;
2121
// Replaces all flows in Aquila (only on startup and for releases)
2222
shared.Flows flows = 3;
23-
// ActionConfigurations that have been configured by the user
24-
shared.ActionConfigurations action_configurations = 4;
23+
// ModuleConfigurations that have been configured by the user
24+
shared.ModuleConfigurations module_configurations = 4;
2525
}
2626
}
2727

0 commit comments

Comments
 (0)