forked from YaredDejene/wf-dsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataCloudDSL.xtext
305 lines (237 loc) · 10.1 KB
/
DataCloudDSL.xtext
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
// automatically generated by Xtext
grammar se.kth.datacloud.dsl.xtext.DataCloudDSL with org.eclipse.xtext.common.Terminals
import "http://datacloud.kth.se/dcdsl/ExecutionRequirements" as ExecutionRequirements
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://datacloud.kth.se/dcdsl" as dsl
import "http://datacloud.kth.se/dcdsl/EnvironmentVariables" as EnvironmentVariables
import "http://datacloud.kth.se/dcdsl/Triggers" as Trigger
import "http://datacloud.kth.se/dcdsl/ControlParameters" as ControlParameters
import "http://datacloud.kth.se/dcdsl/ResourceProvider" as ResourceProvider
import "http://datacloud.kth.se/dcdsl/DataSourceParameters" as DataSourceParameters
Pipeline returns dsl::Pipeline:
'Pipeline'
name = ID
'{'
('communicationMedium:' communicationMedium = CommunicationMedium)
('parameters:' '{' (environmentVariables += EnvironmentParameters (',' environmentVariables += EnvironmentParameters)*) '}' )?
('steps:'
(steps += AbstractStep (steps += AbstractStep)*)
)
'}'
;
CommunicationMedium returns dsl::CommunicationMedium:
'medium' type = CommunicationMediumTypes;
enum CommunicationMediumTypes returns dsl::CommunicationMediumTypes:
MESSAGE_QUEUE | DISTRIBUTED_FILE_SYSTEM | WEB_SERVICE;
EnvironmentParameters returns EnvironmentVariables::EnvironmentVariable:
(name=ID ( ':' value = STRING)?);
AbstractStep returns dsl::AbstractStep:
DataSink | DataSource | DataProcessingStep | CompositeStep
;
DataSink returns dsl::DataSink:
'-' 'data-sink' 'step' name=ID
('parameters:' '{' (environmentVariables += EnvironmentParameters (',' environmentVariables += EnvironmentParameters)*) '}')?
('execution-parameters:' '{' executionRequirementSet = StepRequirementSet '}' )?
('resource-provider:' '{' (resourceProvider += ResourceProvider (',' resourceProvider += ResourceProvider)*) '}')?
('data-source:' '{' dataTarget = InputDataSource '}')?
('trigger:' '{' (triggers += Trigger (',' triggers += Trigger)*) '}')?
;
DataSource returns dsl::DataSource:
'-' 'data-source' 'step' name=ID
('parameters:' '{' (environmentVariables += EnvironmentParameters (',' environmentVariables += EnvironmentParameters)*) '}')?
('execution-parameters:' '{' executionRequirementSet = StepRequirementSet '}' )?
('resource-provider:' '{' (resourceProvider += ResourceProvider (',' resourceProvider += ResourceProvider)*))? '}'
('data-source' '{' dataSource = InputDataSource '}')?
('trigger:' '{' (triggers += Trigger (',' triggers += Trigger)*) '}')?
;
DataProcessingStep returns dsl::DataProcesssing:
'-' 'data-processing' 'step' name=ID
('parameters:' '{' (environmentVariables += EnvironmentParameters (',' environmentVariables += EnvironmentParameters)*) '}')?
// ('execution-parameters:' '{' executionRequirements = StepRequirementSet '}' )?
('execution-parameters:' '{' executionRequirementSet = StepRequirementSet '}' )?
('resource-provider:' '{' (resourceProvider += ResourceProvider (',' resourceProvider += ResourceProvider)*) '}')?
('trigger:' '{' (triggers += Trigger (',' triggers += Trigger)*) '}')?
;
CompositeStep returns dsl::CompositeStep:
'-' 'subpipeline' name=ID
('environment-parameters:' '{' (environmentVariables += EnvironmentParameters (',' environmentVariables += EnvironmentParameters)*) '}')?
('execution-parameters:' '{' executionRequirementSet = StepRequirementSet '}' )?
('resource-provider:' '{' (resourceProvider += ResourceProvider (',' resourceProvider += ResourceProvider)*) '}')?
('trigger:' '{' (triggers += Trigger (',' triggers += Trigger)*) '}')?
;
// Triggers
Trigger returns Trigger::Trigger:
OneTimeTrigger | ScheduleTrigger | ExternalEventTrigger;
OneTimeTrigger returns Trigger::OneTimeTrigger:
{Trigger::OneTimeTrigger}
'one-time'
(startTime = STRING)?;
ScheduleTrigger returns Trigger::ScheduleTrigger:
IntervalSchedule | CronSchedule;
ExternalEventTrigger returns Trigger::ExternalEventTrigger:
{Trigger::ExternalEventTrigger}
'external-event';
IntervalSchedule returns Trigger::IntervalScheduleTrigger:
{Trigger::IntervalScheduleTrigger}
'interval-schedule'
('frequency:' frequency = TimeUnits)?
('interval:' interval = INT)?
('start-time:' startTime = STRING)?;
CronSchedule returns Trigger::CronScheduleTrigger:
{Trigger::CronScheduleTrigger}
'cron-schedule'
('start-time:' startTime = STRING)?
('cron:' cronExpression = STRING)?;
// Input Datasource
InputDataSource returns DataSourceParameters::InputDataSource:
InputDataSourceFTP |
InputDataSourceSFTP|
InputDataSourceDatabase |
InputDataSourceMessageQueue |
InputDataSourceWebApi
;
InputDataSourceFTP returns DataSourceParameters::FTP:
'InputDataSourceftp' name = ID '{' 'credential:' datasourcecredentials=BlockStorageCredentials '}'
;
InputDataSourceSFTP returns DataSourceParameters::SFTP:
'InputDataSourceSftp' name = ID '{' 'credential:' datasourcecredentials=BlockStorageCredentials '}'
;
InputDataSourceDatabase returns DataSourceParameters::Database:
'InputDataSourceDatabase' name = ID '{' 'credential:' datasourcecredentials=DatabaseCredentials '}'
;
InputDataSourceMessageQueue returns DataSourceParameters::MessageQueue:
'InputDataSourceMessageQueue' name = ID '{' 'credential:' datasourcecredentials=MessageQueueCredentials '}'
;
InputDataSourceWebApi returns DataSourceParameters::WebApi:
'InputDataSourceWebApi' name = ID '{' 'credential:' datasourcecredentials=WebApiCredentials '}'
;
DatabaseCredentials returns DataSourceParameters::DatabaseCredentials:
'database' '{' '}';
BlockStorageCredentials returns DataSourceParameters::BlockStorageCredentials:
'block-storage' '{' '}';
WebApiCredentials returns DataSourceParameters::WebApiCredentials:
'web-api' '{' '}';
MessageQueueCredentials returns DataSourceParameters::MessageQueueCredentials:
'message-queue' '{' '}';
// Resource Providers
ResourceProvider returns ResourceProvider::ResourceProvider:
(CloudProvider | EdgeProvider | FogProvider)
// '{'
// ('providerName:' providerName = STRING)
// ('mappingLocation:' mappingLocation=STRING)
// '}'
;
CloudProvider returns ResourceProvider::CloudProvider : 'CloudProvider'
providerName=ID
;
EdgeProvider returns ResourceProvider::EdgeProvider : 'EdgeProvider'
providerName=ID
;
FogProvider returns ResourceProvider::FogProvider: 'FogProvider'
providerName=ID
;
// Execution Requirements
StepRequirementSet returns ExecutionRequirements::ExecutionRequirementSet:
('hardRequirements:'
(imageRequirement = ImageRequirement)?
(osRequirement = OSRequirement)?
(verticalScaleRequirement = VerticalScaleRequirement)?
(horizontalScaleRequirement= HorizontalScaleRequirement)?
(networkRequirement = NetworkRequirement)?
(qualitativeHardwareRequirement = QualitativeHardwareRequirements)?
(quantitativeHardwareRequirement = QuantitativeHardwareRequirements)?
(securityRequirement = SecurityRequirements)?
(serviceLevelObjective = ServiceLevelObjective)?
)?
('softRequirements:' 'empty')?
;
NetworkRequirement returns ExecutionRequirements::NetworkRequirement:
'networkRequirement:'
('min-bandwidth:' minBandwidth=EDouble)?
('max-bandwidth:' maxBandwidth=EDouble)?
('min-latency:' minLatency=INT)?
('max-latency:' maxLatency=INT)?
;
QualitativeHardwareRequirements returns ExecutionRequirements::QualitativeHardwareRequirement:
'qualitativeRequirement:'
('min-benchmark:' minBenchmark=EDouble)?
('max-benchmark:' maxBenchmark=EDouble)?
('cpu-architecture:' cpuArchitecture = STRING)?
('gpu-architecture:' gpuArchitecture = STRING)?
;
QuantitativeHardwareRequirements returns ExecutionRequirements::QuantitativeHardwareRequirement:
'quantitativeRequirement:'
( 'min-cpu:' minCpu = EDouble)?
( 'max-cpu:' maxCpu = EDouble)?
( 'min-ram-mb:' minRamMiB = INT)?
( 'max-ram-mb:' maxRamMiB = INT)?
( 'min-storage-mb:' minStorageMB = INT)?
( 'max-storage-mb:' maxStorageMB = INT)?
( 'cpu-frequency:' cpuFrequency = EDouble)?
( 'cpu-no-core:' cpuNumberOfCores = INT)?
( 'gpu-availability:' gpuAvailability = BOOL_LITERAL)?
;
ImageRequirement returns ExecutionRequirements::ImageRequirement:
'imageRequirement:'
'image-id:' imageId = STRING
;
OSRequirement returns ExecutionRequirements::OSRequirement:
'osRequirement:'
('os-type:' osType=STRING)?
('is-64:' is64os=BOOL_LITERAL)?
;
VerticalScaleRequirement returns ExecutionRequirements::VerticalScaleRequirement :
'verticalScale:'
('min-cpu:' minCpu=EDouble)?
('max-cpu:' maxCpu=EDouble)?
('min-ram-mb:' minRamMiB=INT)?
('max-ram-mb:' maxRamMiB=INT)?
('min-cores:' minCores=INT)?
('max-cores:' maxCores=INT)?
('min-storage-mb:' minStorageMB=INT)?
('max-storage-mb:' maxStorageMB=INT)?
;
HorizontalScaleRequirement returns ExecutionRequirements::HorizontalScaleRequirement:
'horizontalScale:'
('min-instance:' minInstance=INT)?
('max-instance:' maxInstance=INT)?
;
SecurityRequirements returns ExecutionRequirements::SecurityRequirement:
'{'
('parameters:' securityParameters+=SecurityControl (',' securityParameters += SecurityControl)*)
'}'
;
SecurityControl returns ExecutionRequirements::SecurityControl:
'security-control' name = ID
'{'
('specification' specification = STRING)?
'}'
;
ServiceLevelObjective returns ExecutionRequirements::ServiceLevelObjective:
'service-objective'
customServiceLevel = ServiceLevelCondition
;
ServiceLevelCondition returns ExecutionRequirements::ServiceLevelCondition:
name=ID '{'
// ('service-condition:' conditionName = STRING)
( 'operator:' comparisonOperator = ComparisonOperatorType) //TODO must change to ComparisonOperator
( 'threshold:' threshold = EDouble)
( 'validity:' validity = EDate) ?
'}'
;
EDate returns ecore::EDate:
INT '.' INT '.' INT
;
enum ComparisonOperatorType returns dsl::ComparisonOperatorType:
EQUAL | LESS_THAN | GREATER_THAN | NOT_EQUAL | EQUAL_LESS_THAN | EQUAL_GREATER_THAN
;
//ParameterValueTypes returns datasourceParameters::ParameterValueTypes:
// value = STRING;
enum TimeUnits returns dsl::TimeUnits:
SECOND | MINUTE | HOUR | DAY | WEEK | MONTH;
terminal BOOL_LITERAL returns ecore::EBoolean:
'true' | 'false';
EDouble returns ecore::EDouble:
'-'? INT? '.' INT (('E'|'e') '-'? INT)?;
EBoolean returns ecore::EBoolean:
'true' | 'false';