From 1232b2213361a302217262fd0f4f2f2987b778cb Mon Sep 17 00:00:00 2001 From: "Rule Timothy (VM/EMT3)" Date: Tue, 5 Mar 2024 15:37:21 +0100 Subject: [PATCH] Extend Stack schema with runtime properties. Signed-off-by: Rule Timothy (VM/EMT3) --- code/go/dse/kind/Stack.go | 16 ++++-- doc/content/schemas/yaml/Stack.md | 82 +++++++++++++++++++++++++++++++ schemas/yaml/Stack.yaml | 30 +++++++++++ 3 files changed, 125 insertions(+), 3 deletions(-) diff --git a/code/go/dse/kind/Stack.go b/code/go/dse/kind/Stack.go index a0708a7..e403d69 100644 --- a/code/go/dse/kind/Stack.go +++ b/code/go/dse/kind/Stack.go @@ -24,8 +24,14 @@ type ModelInstance struct { } `yaml:"mcl,omitempty"` Name string `yaml:"name"` } `yaml:"model"` - Name string `yaml:"name"` - Uid int `yaml:"uid"` + Name string `yaml:"name"` + Runtime *ModelInstanceRuntime `yaml:"runtime,omitempty"` + Uid int `yaml:"uid"` +} +type ModelInstanceRuntime struct { + Env *map[string]string `yaml:"env,omitempty"` + Files *[]string `yaml:"files,omitempty"` + X32 *bool `yaml:"x32,omitempty"` } type RedisConnection struct { Timeout *int `yaml:"timeout,omitempty"` @@ -37,12 +43,16 @@ type Stack struct { Spec StackSpec `yaml:"spec"` } type StackKind string +type StackRuntime struct { + Env *map[string]string `yaml:"env,omitempty"` +} type StackSpec struct { Connection *struct { Timeout *string `yaml:"timeout,omitempty"` Transport *StackSpec_Connection_Transport `yaml:"transport,omitempty"` } `yaml:"connection,omitempty"` - Models *[]ModelInstance `yaml:"models,omitempty"` + Models *[]ModelInstance `yaml:"models,omitempty"` + Runtime *StackRuntime `yaml:"runtime,omitempty"` } type StackSpecConnectionTransport0 struct { Redis RedisConnection `yaml:"redis"` diff --git a/doc/content/schemas/yaml/Stack.md b/doc/content/schemas/yaml/Stack.md index 1191a80..06c8d23 100644 --- a/doc/content/schemas/yaml/Stack.md +++ b/doc/content/schemas/yaml/Stack.md @@ -29,6 +29,10 @@ spec: redis: uri: string timeout: 0 + runtime: + env: + property1: string + property2: string models: - name: string uid: 0 @@ -41,6 +45,13 @@ spec: strategy: string models: - name: string + runtime: + env: + property1: string + property2: string + files: + - string + x32: true channels: - name: string alias: string @@ -89,6 +100,10 @@ connection: redis: uri: string timeout: 0 +runtime: + env: + property1: string + property2: string models: - name: string uid: 0 @@ -101,6 +116,13 @@ models: strategy: string models: - name: string + runtime: + env: + property1: string + property2: string + files: + - string + x32: true channels: - name: string alias: string @@ -147,6 +169,7 @@ continued |Name|Type|Required|Description| |---|---|---|---| +|runtime|[StackRuntime](#schemastackruntime)|false|Runtime properties of a Stack.| |models|[[ModelInstance](#schemamodelinstance)]|false|[A model instance object.]|

ModelInstance

@@ -168,6 +191,13 @@ model: strategy: string models: - name: string +runtime: + env: + property1: string + property2: string + files: + - string + x32: true channels: - name: string alias: string @@ -197,6 +227,7 @@ A model instance object. |»» strategy|string|true|none| |»» models|[object]|true|A list of models belonging to this MCL.| |»»» name|string|true|The name of the MCL model.| +|runtime|[ModelInstanceRuntime](#schemamodelinstanceruntime)|false|Runtime properties of a Model Instance.| |channels|[object]|false|none| |» name|string|false|The name of the channel, used when connecting this channel to the SimBus.| |» alias|string|false|The alias of the channel, used when the channel name will be determined elsewhere.| @@ -206,6 +237,57 @@ A model instance object. |» annotations|object|false|Non identifying information (i.e. information specific to the object itself).| |»» **additionalProperties**|string|false|none| +

StackRuntime

+ + + + + + +```yaml +env: + property1: string + property2: string + +``` + +Runtime properties of a Stack. + +### Properties + +|Name|Type|Required|Description| +|---|---|---|---| +|env|object|false|Environment variables.| +|» **additionalProperties**|string|false|none| + +

ModelInstanceRuntime

+ + + + + + +```yaml +env: + property1: string + property2: string +files: + - string +x32: true + +``` + +Runtime properties of a Model Instance. + +### Properties + +|Name|Type|Required|Description| +|---|---|---|---| +|env|object|false|Environment variables.| +|» **additionalProperties**|string|false|none| +|files|[string]|false|Additional file arguments passed to ModelC.| +|x32|boolean|false|Run Model with 32bit ModelC executable (x32 abi)| +

RedisConnection

diff --git a/schemas/yaml/Stack.yaml b/schemas/yaml/Stack.yaml index a15fee1..994b874 100644 --- a/schemas/yaml/Stack.yaml +++ b/schemas/yaml/Stack.yaml @@ -68,6 +68,8 @@ components: properties: mq: $ref: '#/components/schemas/MessageQueue' + runtime: + $ref: '#/components/schemas/StackRuntime' models: type: array items: @@ -113,10 +115,38 @@ components: name: type: string description: The name of the MCL model. + runtime: + $ref: '#/components/schemas/ModelInstanceRuntime' channels: type: array items: $ref: 'channel.yaml#/components/schemas/Channel' + StackRuntime: + type: object + description: Runtime properties of a Stack. + properties: + env: + type: object + description: Environment variables. + additionalProperties: + type: string + ModelInstanceRuntime: + type: object + description: Runtime properties of a Model Instance. + properties: + env: + type: object + description: Environment variables. + additionalProperties: + type: string + files: + type: array + description: Additional file arguments passed to ModelC. + items: + type: string + x32: + type: boolean + description: Run Model with 32bit ModelC executable (x32 abi) RedisConnection: type: object description: Redis connection.