Skip to content

Commit 44994d3

Browse files
authored
validate exports/imports (#290)
1 parent ce73b45 commit 44994d3

28 files changed

Lines changed: 5868 additions & 763 deletions

docs/element_manager/manifest.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Manifest
2+
3+
## Example manifest
4+
5+
```yaml
6+
name: "core_service_example"
7+
description: "Genesis Core Service Example"
8+
schema_version: 1
9+
version: "1.0.3"
10+
api_version: "v1"
11+
12+
requirements: # Requirements of the manifest
13+
core:
14+
from_version: "0.0.0"
15+
to_version: "1.0.0"
16+
17+
resources:
18+
$core.compute.nodes:
19+
example_node:
20+
name: "example-service-node"
21+
description: "Example service node"
22+
cores: "$core_service_example.imports.$var_default_cores:value"
23+
ram: "$core_service_example.imports.$var_default_ram:value"
24+
project_id: "12345678-c625-4fee-81d5-f691897b8142"
25+
disk_spec:
26+
kind: "root_disk"
27+
size: 10
28+
image: "{{ base_image_url | default('https://repository.genesis-core.tech/genesis-base/0.4.1/genesis-base.raw.gz') }}"
29+
30+
$core.em.services:
31+
example_service:
32+
project_id: "12345678-c625-4fee-81d5-f691897b8142"
33+
name: "example-service"
34+
path: "/usr/bin/python3 -m http.server 8080"
35+
user: "ubuntu"
36+
group: "ubuntu"
37+
target:
38+
kind: "node"
39+
node: "$core_service_example.compute.nodes.$example_node:uuid"
40+
service_type:
41+
kind: "simple"
42+
count: 1
43+
target_status: "enabled"
44+
45+
exports:
46+
my_service:
47+
link: "$core_service_example.em.services.$example_service"
48+
kind: "resource"
49+
my_node:
50+
link: "$core_service_example.em.services.$example_node"
51+
52+
imports:
53+
var_default_cores:
54+
element: "$core"
55+
kind: "resource"
56+
link: "$core.vs.variables.$default_cores"
57+
var_default_ram:
58+
element: "$core"
59+
kind: "resource"
60+
link: "$core.vs.variables.$default_ram"
61+
```
62+
63+
## name
64+
65+
The name of the manifest.
66+
67+
## description
68+
69+
The description of the manifest.
70+
71+
## schema_version
72+
73+
The schema version of the manifest, now `1`.
74+
75+
## version
76+
77+
Version of the manifest, see docs in [genesis_devtools](https://infraguys.github.io/genesis_devtools/)
78+
79+
## api_version
80+
81+
API version of the manifest, now `v1`
82+
83+
## requirements
84+
85+
```yaml
86+
core:
87+
from_version: "0.0.0"
88+
to_version: "1.0.0"
89+
```
90+
91+
Requirements are used to specify the versions of the elements that are required to run the manifest.
92+
93+
## Resources
94+
95+
Resources are used to specify the resources that are required to run the manifest.
96+
97+
## exports
98+
99+
```yaml
100+
my_service:
101+
link: "$core_service_example.em.services.$example_service"
102+
kind: "resource" # kind of the export, now only `resource` is supported, may be omitted
103+
```
104+
105+
## imports
106+
107+
```yaml
108+
var_default_cores:
109+
element: "$core" # element, from that the import is made
110+
kind: "resource" # kind of the import, now only `resource` is supported, may be omitted
111+
link: "$core.vs.variables.$default_cores" # link to the resource (element, that the import is made, maybe be another)
112+
```
113+
114+
Imports are used to specify the resources that are imported by the manifest.

0 commit comments

Comments
 (0)