Skip to content

Cosmo Tech Legacy Run Template

Description

This example represents a full legacy run template requiring a lot of environment variables and making use of csm-orc commands.

Most environment variables are defined in the "Brewery+Docker" tutorial.

Template

run.json
  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
{
  "commandTemplates": [
    {
      "id": "csm_orc_run_step",
      "command": "csm-orc",
      "arguments": [
        "run-step"
      ],
      "environment": {
        "CSM_ORGANIZATION_ID": {
          "optional": true,
          "description": "The id of an organization in the cosmotech api"
        },
        "CSM_WORKSPACE_ID": {
          "optional": true,
          "description": "The id of a workspace in the cosmotech api"
        },
        "CSM_RUN_TEMPLATE_ID": {
          "description": "The name of the run template defined in the cosmotech api and available in the project"
        },
        "CSM_CONTAINER_MODE": {
          "description": "The steps run during a run-step"
        },
        "CSM_API_URL": {
          "optional": true,
          "description": "The url to a Cosmotech API"
        },
        "CSM_API_SCOPE": {
          "optional": true,
          "description": "The identification scope of a Cosmotech API"
        },
        "AZURE_TENANT_ID": {
          "optional": true,
          "description": "An Azure Tenant ID"
        },
        "AZURE_CLIENT_ID": {
          "optional": true,
          "description": "An Azure Client ID having access to the Cosmotech API"
        },
        "AZURE_CLIENT_SECRET": {
          "optional": true,
          "description": "The secret for the Azure Client"
        },
        "LOG_LEVEL": {
          "defaultValue": "INFO",
          "description": "Either CRITICAL, ERROR, WARNING, INFO or DEBUG"
        },
        "PYTHONPATH": {
          "description": "A list of folder to add to the python path"
        },
        "CSM_DATASET_ABSOLUTE_PATH": {
          "description": "A local folder to store the main dataset content"
        },
        "CSM_PARAMETERS_ABSOLUTE_PATH": {
          "description": "A local folder to store the parameters content"
        },
        "CSM_SIMULATION_ID": {
          "description": "The id of the simulation run"
        },
        "CSM_SIMULATION": {
          "defaultValue": "MySimulation",
          "description": "The name of the Simulation file to use"
        },
        "AZURE_DATA_EXPLORER_RESOURCE_URI": {
          "optional": true,
          "description": "the ADX cluster path (URI info can be found into ADX cluster page)"
        },
        "AZURE_DATA_EXPLORER_RESOURCE_INGEST_URI": {
          "optional": true,
          "description": "The ADX cluster ingest path (URI info can be found into ADX cluster page)"
        },
        "AZURE_DATA_EXPLORER_DATABASE_NAME": {
          "optional": true,
          "description": "The targeted database name"
        }
      }
    }
  ],
  "steps": [
    {
      "id": "fetch_scenario_parameters",
      "command": "csm-orc",
      "arguments": [
        "fetch-scenariorun-data"
      ],
      "environment": {
        "CSM_ORGANIZATION_ID": {
          "description": "The id of an organization in the cosmotech api"
        },
        "CSM_WORKSPACE_ID": {
          "description": "The id of a workspace in the cosmotech api"
        },
        "CSM_SCENARIO_ID": {
          "description": "The id of a scenario in the cosmotech api"
        },
        "CSM_API_URL": {
          "description": "The url to a Cosmotech API"
        },
        "CSM_API_SCOPE": {
          "description": "The identification scope of a Cosmotech API"
        },
        "CSM_DATASET_ABSOLUTE_PATH": {
          "description": "A local folder to store the main dataset content"
        },
        "CSM_PARAMETERS_ABSOLUTE_PATH": {
          "description": "A local folder to store the parameters content"
        },
        "WRITE_JSON": {
          "defaultValue": "true",
          "description": "Toggle writing of parameters in json format"
        },
        "WRITE_CSV": {
          "defaultValue": "false",
          "description": "Toggle writing of parameters in csv format"
        },
        "FETCH_DATASET": {
          "defaultValue": "true",
          "description": "Toggle fetching datasets"
        },
        "LOG_LEVEL": {
          "defaultValue": "INFO",
          "description": "Either CRITICAL, ERROR, WARNING, INFO or DEBUG"
        }
      },
      "useSystemEnvironment": true
    },
    {
      "id": "parameters_handler",
      "commandId": "csm_orc_run_step",
      "environment": {
        "CSM_CONTAINER_MODE": {
          "value": "parameters_handler"
        }
      },
      "precedents": [
        "fetch_scenario_parameters"
      ],
      "useSystemEnvironment": true
    },
    {
      "id": "validator",
      "commandId": "csm_orc_run_step",
      "environment": {
        "CSM_CONTAINER_MODE": {
          "value": "validator"
        }
      },
      "precedents": [
        "parameters_handler"
      ],
      "useSystemEnvironment": true
    },
    {
      "id": "send_to_adx",
      "command": "csm-orc",
      "arguments": [
        "send-to-adx"
      ],
      "environment": {
        "AZURE_TENANT_ID": {
          "description": "An Azure Tenant ID"
        },
        "AZURE_CLIENT_ID": {
          "description": "An Azure Client ID having access to the Cosmotech API"
        },
        "AZURE_CLIENT_SECRET": {
          "description": "The secret for the Azure Client"
        },
        "LOG_LEVEL": {
          "defaultValue": "INFO",
          "description": "Either CRITICAL, ERROR, WARNING, INFO or DEBUG"
        },
        "CSM_DATASET_ABSOLUTE_PATH": {
          "description": "A local folder to store the main dataset content"
        },
        "CSM_PARAMETERS_ABSOLUTE_PATH": {
          "description": "A local folder to store the parameters content"
        },
        "CSM_SIMULATION_ID": {
          "description": "The id of the simulation run"
        },
        "AZURE_DATA_EXPLORER_RESOURCE_URI": {
          "description": "the ADX cluster path (URI info can be found into ADX cluster page)"
        },
        "AZURE_DATA_EXPLORER_RESOURCE_INGEST_URI": {
          "description": "The ADX cluster ingest path (URI info can be found into ADX cluster page)"
        },
        "AZURE_DATA_EXPLORER_DATABASE_NAME": {
          "description": "The targeted database name"
        },
        "CSM_SEND_DATAWAREHOUSE_PARAMETERS": {
          "defaultValue": "true",
          "description": "whether or not to send parameters (parameters path is mandatory then)"
        },
        "CSM_SEND_DATAWAREHOUSE_DATASETS": {
          "defaultValue": "true",
          "description": "whether or not to send datasets (parameters path is mandatory then)"
        },
        "WAIT_FOR_INGESTION": {
          "defaultValue": "false",
          "description": "Toggle waiting for the ingestion results"
        }
      },
      "precedents": [
        "validator"
      ],
      "useSystemEnvironment": true
    },
    {
      "id": "prerun",
      "commandId": "csm_orc_run_step",
      "environment": {
        "CSM_CONTAINER_MODE": {
          "value": "prerun"
        }
      },
      "precedents": [
        "send_to_adx"
      ],
      "useSystemEnvironment": true
    },
    {
      "id": "engine",
      "commandId": "csm_orc_run_step",
      "environment": {
        "CSM_CONTAINER_MODE": {
          "value": "engine"
        }
      },
      "precedents": [
        "prerun"
      ],
      "useSystemEnvironment": true
    },
    {
      "id": "postrun",
      "commandId": "csm_orc_run_step",
      "environment": {
        "CSM_CONTAINER_MODE": {
          "value": "postrun"
        }
      },
      "precedents": [
        "engine"
      ],
      "useSystemEnvironment": true
    }
  ]
}