-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.schema.json
209 lines (209 loc) · 6.53 KB
/
manifest.schema.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
{
"$schema": "https://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/FLECS-Technologies/app-sdk/main/manifest.schema.json",
"title": "FLECS App Manifest",
"description": "",
"type": "object",
"properties": {
"_schemaVersion": {
"description": "Version of the implemented FLECS App Manifest schema",
"type": "string",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"examples": [
"2.0.0",
"3.0.0-beta.1"
],
"$comment": "https://regex101.com/r/y9GIZD/1"
},
"app": {
"description": "Unique App identifier in reverse domain name notation",
"type": "string",
"pattern": "^((?:[a-z])+[a-z0-9.\\-_]+[a-z0-9])$",
"examples": [
"tech.flecs.flunder",
"io.anyviz.cloudadapter",
"com.example.some-app"
],
"$comment": "https://regex101.com/r/psUZll/1"
},
"version": {
"description": "App version, naturally sortable",
"type": "string",
"examples": [
"1.0.0",
"2022-12",
"v3.14.159-alpha.2",
"version 21"
]
},
"revision": {
"description": "App manifest revision. Increment if Manifest is changed within the same App version",
"type": "string",
"examples": [
"0",
"1",
"2"
]
},
"image": {
"description": "Docker image for the App",
"type": "string",
"pattern": "^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\\[(?:[a-fA-F0-9:]+)\\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\\w][\\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$",
"examples": [
"flecs/tech.flecs.flunder",
"flecs.azurecr.io/io.anyviz.cloudadapter",
"registry.example.com/some-app",
"debian:bookworm-slim"
],
"$comment": "https://regex101.com/r/EkbfNE/1"
},
"multiInstance": {
"description": "'true' if App can be instantiated more than once (requires no editor, no ports)",
"type": "boolean",
"examples": [
true,
false
]
},
"editor": {
"description": "Port of App's web-based ui",
"type": "string",
"pattern": "^:([6][5][5][3][0-5]|[6][5][5][0-2][0-9]|[6][5][0-4][0-9]{2}|[6][0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3})$",
"examples": [
":8080",
":3001",
":18051"
],
"$comment": "https://regex101.com/r/zRLOAm/1"
},
"args": {
"description": "Command line arguments passed to App entrypoint",
"type": "array",
"items": {
"type": "string"
},
"examples": [
[
"--launch-arg1",
"--launch-arg2=value"
]
]
},
"capabilities": {
"description": "Permissions required for the App to function correctly",
"type": "array",
"items": {
"enum": [
"DOCKER",
"NET_ADMIN",
"SYS_NICE",
"IPC_LOCK",
"NET_RAW"
]
},
"uniqueItems": true
},
"conffiles": {
"description": "Configuration files used by the App",
"type": "array",
"items": {
"type": "string",
"pattern": "(^[^\/:]+):([^:]+)(?:$|:(r[ow]$))",
"examples": [
[
"default.conf:/etc/my-app/default.conf",
"default.conf:/etc/my-app/default.conf:rw",
"default.conf:/etc/my-app/default.conf:ro"
]
]
},
"$comment": "https://regex101.com/r/hLwDoP/1"
},
"devices": {
"description": "Devices passed through to the App instances",
"type": "array",
"items": {
"type": "string",
"pattern": "^(\/dev\/.+)$",
"examples": [
[
"/dev/net/tun"
]
]
},
"$comment": "https://regex101.com/r/6utwD1/1"
},
"env": {
"description": "Environment variables for the App instances",
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-zA-Z]+(?:[a-zA-Z0-9_\\-\\.])*=.+$",
"examples": [
[
"MY_ENV=value",
"tech.flecs.some-app_value=any"
]
]
},
"$comment": "https://regex101.com/r/MNDmTF/1"
},
"interactive": {
"description": "DEPRECATED: true if App requires allocation of an interactive shell",
"type": "boolean",
"deprecated": true
},
"ports": {
"description": "Port mappings for the App's instances (not allowed for multiInstance Apps)",
"type": "array",
"items": {
"type": "string",
"pattern": "(?=\\d|:)^(?:([6][5][5][3][0-5]|[6][5][5][0-2][0-9]|[6][5][0-4][0-9]{2}|[6][0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3})(?:$|[:-](?=\\d))|:)?(?:(?<=-)([6][5][5][3][0-5]|[6][5][5][0-2][0-9]|[6][5][0-4][0-9]{2}|[6][0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3})(?:$|:(?=\\d)))?(?:(?<=:)([6][5][5][3][0-5]|[6][5][5][0-2][0-9]|[6][5][0-4][0-9]{2}|[6][0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3})(?:$|-(?=\\d)))?(?:(?<=-)([6][5][5][3][0-5]|[6][5][5][0-2][0-9]|[6][5][0-4][0-9]{2}|[6][0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}))?$",
"examples": [
[
"8001:8001",
"5000",
"5001-5008:6001-6008",
"6001-6008"
]
]
},
"$comment": "https://regex101.com/r/GgJ78T/1"
},
"volumes": {
"description": "Virtual volumes and bind mounts for an App's instances",
"type": "array",
"items": {
"type": "string",
"pattern": "(?:^([a-zA-Z0-9\\-_.]+)|^\/[a-zA-Z0-9\\-_.\/]+):([a-zA-Z0-9\\-_.\/]+)$",
"examples": [
[
"my-app-etc:/etc/my-app",
"/etc/my-app:/etc/my-app"
]
],
"$comment": "https://regex101.com/r/WjJro3/1"
}
},
"labels": {
"description": "Labels for the App instances",
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z](?:(?:[\\-\\.]?[a-zA-Z0-9])*[\\-\\.]?[a-z])?(?:=.*)?$",
"examples": [
[
"tech.flecs",
"tech.flecs.some-label=Some custom label value"
]
]
},
"$comment": "https://regex101.com/r/xOiJXu/1"
}
},
"required": [
"app",
"version",
"image"
]
}