-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yml
132 lines (123 loc) · 4.03 KB
/
Taskfile.yml
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
---
version: '3'
vars:
# When running from E2E tests (i.e. Docker in Docker), the ENTRYDIR (for
# Docker commands) must be set to the host relative path.
ENTRYDIR: '{{if .SIM}}{{.ENTRYWORKDIR}}/{{.SIM}}{{else}}{{.PWD}}{{end}}'
# Container image specification.
FMI_IMAGE: '{{.FMI_IMAGE | default "ghcr.io/boschglobal/dse-fmi"}}'
FMI_TAG: '{{.FMI_TAG | default "latest"}}'
tasks:
generate-fmimcl:
desc: Generate an FMI MCL from an existing FMU.
run: always
dir: '{{.USER_WORKING_DIR}}'
label: dse:fmi:generate-fmimcl
vars:
FMU_DIR: '{{.FMU_DIR | default "FMU_DIR_NOT_SPECIFIED"}}'
OUT_DIR: '{{.OUT_DIR | default "out/model"}}'
MCL_PATH: '{{.MCL_PATH | default "MCL_PATH_NOT_SPECIFIED"}}'
FMU_MODELDESC: '{{.FMU_DIR}}/modelDescription.xml'
SIGNAL_GROUP: "{{if .SIGNAL_GROUP}}'{{.SIGNAL_GROUP}}'{{else}}'{{.OUT_DIR}}/signalgroup.yaml'{{end}}"
cmds:
- task: gen-mcl
vars:
FMU_DIR: '{{.FMU_DIR}}'
OUT_DIR: '{{.OUT_DIR}}'
MCL_PATH: '{{.MCL_PATH}}'
- task: gen-signalgroup
vars:
INPUT: '{{.FMU_MODELDESC}}'
OUTPUT: '{{.SIGNAL_GROUP}}'
requires:
vars: [FMU_DIR, MCL_PATH]
generate-fmimodelc:
desc: Generate a FMI ModelC FMU from an existing (DSE/ModelC) Simer simulation.
run: always
dir: '{{.USER_WORKING_DIR}}'
label: dse:fmi:generate-fmimodelc
cmds:
- task: gen-fmu
gen-mcl:
internal: true
run: always
dir: '{{.USER_WORKING_DIR}}'
label: dse:fmi:gen-mcl
vars:
FMU_DIR: '{{.FMU_DIR | default "FMU_DIR_NOT_SPECIFIED"}}'
OUT_DIR: '{{.OUT_DIR | default "out/model"}}'
MCL_PATH: '{{.MCL_PATH | default "MCL_PATH_NOT_SPECIFIED"}}'
PLATFORM: "{{if .PLATFORM}}--platform '{{.PLATFORM}}'{{else}}{{end}}"
cmds:
- docker run --rm
-v {{.ENTRYDIR}}:/sim
{{.FMI_IMAGE}}:{{.FMI_TAG}}
gen-mcl
--fmu {{.FMU_DIR}}
--outdir {{.OUT_DIR}}
--mcl {{.MCL_PATH}}
{{.PLATFORM}}
requires:
vars: [FMU_DIR, MCL_PATH]
gen-signalgroup:
internal: true
run: always
dir: '{{.USER_WORKING_DIR}}'
label: dse:fmi:gen-signalgroup
vars:
INPUT: '{{.INPUT | default "INPUT_NOT_SPECIFIED"}}'
OUTPUT: '{{.OUTPUT | default "OUTPUT_NOT_SPECIFIED"}}'
cmds:
- docker run --rm
-v {{.ENTRYDIR}}:/sim
{{.FMI_IMAGE}}:{{.FMI_TAG}}
gen-signalgroup
--input {{.INPUT}}
--output {{.OUTPUT}}
requires:
vars: [INPUT, OUTPUT]
gen-fmu:
internal: true
run: always
dir: '{{.USER_WORKING_DIR}}'
label: dse:fmi:gen-fmu
vars:
SIM: '{{.SIM | default "SIM_NOT_SPECIFIED"}}'
FMU_NAME: '{{.FMU_NAME | default "FMU_NAME_NOT_SPECIFIED"}}'
PLATFORM: "{{if .PLATFORM}}--platform '{{.PLATFORM}}'{{else}}{{end}}"
SIGNAL_GROUPS: "{{if .SIGNAL_GROUPS}}--signalgroups '{{.SIGNAL_GROUPS}}'{{else}}{{end}}"
VERSION: "{{if .VERSION}}--version '{{.VERSION}}'{{else}}{{end}}"
UUID: "{{if .UUID}}--uuid '{{.UUID}}'{{else}}{{end}}"
OUT_DIR: '{{.OUT_DIR | default "out"}}'
cmds:
- docker run --rm
-v {{.ENTRYDIR}}:/sim
{{.FMI_IMAGE}}:{{.FMI_TAG}}
gen-fmu
--sim {{.SIM}}
--name {{.FMU_NAME}}
--outdir {{.OUT_DIR}}
{{.PLATFORM}}
{{.SIGNAL_GROUPS}}
{{.VERSION}}
{{.UUID}}
requires:
vars: [SIM, FMU_NAME]
patch-signalgroup:
run: always
dir: '{{.USER_WORKING_DIR}}'
label: dse:fmi:patch-signalgroup
vars:
INPUT: '{{.INPUT | default "INPUT_NOT_SPECIFIED"}}'
PATCH: '{{.PATCH | default "PATCH_NOT_SPECIFIED"}}'
REMOVE_UNKNOWN: '{{if .REMOVE_UNKNOWN}}--remove-unknown{{else}}{{end}}'
cmds:
- docker run --rm
-v {{.ENTRYDIR}}:/sim
{{.FMI_IMAGE}}:{{.FMI_TAG}}
patch-signalgroup
--input {{.INPUT}}
--patch {{.PATCH}}
{{.REMOVE_UNKNOWN}}
requires:
vars: [INPUT, PATCH]