Skip to content

Commit

Permalink
Extend Stack schema with runtime properties.
Browse files Browse the repository at this point in the history
Signed-off-by: Rule Timothy (VM/EMT3) <Timothy.Rule@de.bosch.com>
  • Loading branch information
timrulebosch committed Mar 5, 2024
1 parent 64b37bf commit 1232b22
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 3 deletions.
16 changes: 13 additions & 3 deletions code/go/dse/kind/Stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down
82 changes: 82 additions & 0 deletions doc/content/schemas/yaml/Stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ spec:
redis:
uri: string
timeout: 0
runtime:
env:
property1: string
property2: string
models:
- name: string
uid: 0
Expand All @@ -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
Expand Down Expand Up @@ -89,6 +100,10 @@ connection:
redis:
uri: string
timeout: 0
runtime:
env:
property1: string
property2: string
models:
- name: string
uid: 0
Expand All @@ -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
Expand Down Expand Up @@ -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.]|

<h2 id="tocS_ModelInstance">ModelInstance</h2>
Expand All @@ -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
Expand Down Expand Up @@ -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.|
Expand All @@ -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|

<h2 id="tocS_StackRuntime">StackRuntime</h2>

<a id="schemastackruntime"></a>
<a id="schema_StackRuntime"></a>
<a id="tocSstackruntime"></a>
<a id="tocsstackruntime"></a>

```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|

<h2 id="tocS_ModelInstanceRuntime">ModelInstanceRuntime</h2>

<a id="schemamodelinstanceruntime"></a>
<a id="schema_ModelInstanceRuntime"></a>
<a id="tocSmodelinstanceruntime"></a>
<a id="tocsmodelinstanceruntime"></a>

```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)|
<h2 id="tocS_RedisConnection">RedisConnection</h2>
<a id="schemaredisconnection"></a>
Expand Down
30 changes: 30 additions & 0 deletions schemas/yaml/Stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ components:
properties:
mq:
$ref: '#/components/schemas/MessageQueue'
runtime:
$ref: '#/components/schemas/StackRuntime'
models:
type: array
items:
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 1232b22

Please sign in to comment.