-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.yaml
164 lines (141 loc) · 5.08 KB
/
template.yaml
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
tosca_definitions_version: tosca_variability_1_0_rc_3
imports:
- lib/types.yaml
topology_template:
###################################################
#
# Variability
#
###################################################
variability:
inputs:
hpc_installed:
description: Is an HPC installed?
type: boolean
default: false
remote_access:
description: Is the remote access feature enabled?
type: boolean
default: false
expressions:
has_hpc_installed: { equal: [ { variability_input: hpc_installed }, true ] }
has_remote_access: { equal: [ { variability_input: remote_access }, true ] }
###################################################
#
# Inputs
#
###################################################
inputs:
localhost_can_bus_virtual_interface:
description: The CAN interface when virtualizing the CAN bus on localhost.
type: string
default: can0
###################################################
#
# Outputs
#
###################################################
outputs:
abstraction_address:
description: The ip address under which the abstraction application is available.
value: "{{ '::abstraction_application::application_address' | eval }}"
abstraction_port:
description: The HTTP port under which the abstraction application is available.
value: "{{ '::abstraction_application::rest_port' | eval }}"
node_templates:
###################################################
#
# Frontend
#
###################################################
frontend_application:
type: tosca4cars.nodes.MCMS.Frontend
persistent: true
conditions: { logic_expression: has_remote_access }
requirements:
- host: frontend_hardware
- abstraction: abstraction_application
artifacts:
artifact:
type: tosca.artifacts.File
file: lib/frontend/artifact.zip
frontend_hardware:
type: tosca4cars.nodes.Docker.Supervisord
properties:
container_name: mcms-frontend
network_mode: host
requirements:
- host: docker_engine
###################################################
#
# Abstraction Application
#
###################################################
abstraction_application:
type: tosca4cars.nodes.MCMS.Abstraction
properties:
can_enabled: true
rest_port: 50000
rest_enabled: true
grpc_enabled: false
requirements:
- host: abstraction_hardware_virtual
- flexible: flexible_application
- can: can_bus_virtual
artifacts:
artifact:
type: tosca.artifacts.File
file: lib/abstraction/artifact.zip
abstraction_hardware_virtual:
type: tosca4cars.nodes.Docker.Supervisord
persistent: true
conditions: { logic_expression: has_hpc_installed }
properties:
container_name: mcms-hpc
network_mode: host
requirements:
- host: docker_engine
###################################################
#
# Flexible Application
#
###################################################
flexible_application:
type: tosca4cars.nodes.MCMS.Flexible
persistent: true
requirements:
- host: flexible_hardware_virtual
- can: can_bus_virtual
artifacts:
artifact:
type: tosca.artifacts.File
file: lib/flexible/virtual.zip
flexible_hardware_virtual:
type: tosca4cars.nodes.Docker.Supervisord
properties:
container_name: mcms-ecu
network_mode: host
requirements:
- host: docker_engine
###################################################
#
# CAN Bus
#
###################################################
can_bus_virtual:
type: tosca4cars.nodes.CAN.Virtual
properties:
can_interface: { get_input: localhost_can_bus_virtual_interface }
requirements:
- host: localhost
###################################################
#
# Misc
#
###################################################
docker_engine:
type: tosca4cars.nodes.Docker.Engine
requirements:
- host: localhost
localhost:
type: tosca4cars.nodes.Localhost