When the cloud compute core library receives a compute manifest, it converts it into a payload and stores the payload in the compute store. The cloud compute core library adds an environment variable of the path to the payload to the container at runtime.
When the cloud compute language specific software development kit reads the payload, it performs parameter substitution for environment variables and payload attributes.
Substitutions can occur in DataSource Names, Paths, and DataPaths, and they can occur in Attributes????.
To specify an environment variable substitution use `{ENV::<variable name>}`. Environment variables are set by cloud compute core, the most common environment variable subsitution is EVENT_ID which is the current event id that the container should run. This is useful as a substitution parameter in the output DataSources to segregate outputs from multiple events or forecasts. A custom manifestor plugin (event generator) can set additional environment variables to support more substitution patterns based on environment variables.
EXAMPLE Output Datasource using the CWMS-FORECAST Store and placing the output RAS HDF file in an EVENT_ID specific output location:
cc.DataSource{
Name: "RasModel.p01.hdf",
Paths: []string{"{ENV::EVENT_ID}/ras/RasModel.p01.hdf"},
StoreName: "CWMS-FORECAST",
}
CODE
To specify an attribute substitution use `{ATTR::<variable name>}`. Attributes are set in the manifest using the payload attributes or the attributes of a specific action. Common attribute substitutions are things like alternative names, simulation names, plan names or other important file path attributes like the current scenario being computed and depend largely on the overall data storage strategy of the controlling application and the flexibility built into the manifest schema that the plugin was registered with.
PayloadAttributes: map[string]interface{}{
"plan_name": "01",
"model_name": "RasModel",
},
cc.DataSource{
Name: "{ATTR::model_name}.{ATTR::plan_name}.hdf",
Paths: []string{"{ENV::EVENT_ID}/ras/{ATTR::model_name}.{ATTR::plan_name}.hdf"},
StoreName: "CWMS-FORECAST",
}
CODE