-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrigo.schema.json
300 lines (299 loc) · 8.87 KB
/
strigo.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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://zenika.com/strigo.schema.json",
"title": "Strigo",
"description": "A Zenika Strigo Class configuration",
"type": "object",
"properties": {
"$schema": {
"type": "string"
},
"id": {
"description": "The Strigo ID of the class, shouldn't be changed",
"type": "string"
},
"name": {
"description": "The name of the class",
"type": "string"
},
"description": {
"description": "The list of lines of description of the class (can be empty list `[]`)",
"type": "array",
"items": {
"type": "string"
}
},
"labels": {
"description": "The list of labels of the class (can be empty list `[]`)",
"type": "array",
"items": {
"type": "string"
}
},
"presentations": {
"description": "The list of presentation materials (1 and only 1 element)",
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"properties": {
"file": {
"description": "The path to presentation file (typically `pdf/Zenika-Formation-xxx-Slides.pdf` or `pdf/Zenika-training-material-Slides.pdf`)",
"type": "string"
},
"notes_source": {
"description": "The path to the listing of slides for notes extraction (should be `Slides/slides.json`)",
"type": "string",
"default": "Slides/slides.json"
}
},
"additionalProperties": false,
"required": [
"file"
]
}
},
"resources": {
"description": "The list of lab machines",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"name": {
"description": "The display name of the machine",
"type": "string"
},
"instance_type": {
"description": "The size of the machine (one of `t3.medium`, `t3.large` or `t3.xlarge`",
"type": "string",
"enum": [
"t3.medium",
"t3.large",
"t3.xlarge",
"t3a.micro",
"t3a.small",
"t3a.medium",
"t3a.large",
"t3a.xlarge"
]
},
"image": {
"description": "The machine image, can be the normalized name of the preconfigured Strigo images (lower case, space replaced by simple hyphen `-`), or a custom image",
"oneOf": [
{
"description": "A predefined image (deprecated in favor of '{\"image_name\": this_value}'",
"$ref": "#/$defs/strigo_image_name",
"deprecated": true
},
{
"description": "A predefined image",
"type": "object",
"properties": {
"image_name": {
"$ref": "#/$defs/strigo_image_name"
}
},
"additionalProperties": false,
"required": [
"image_name"
]
},
{
"description": "A custom image",
"type": "object",
"properties": {
"image_id": {
"description": "The AMI ID",
"$ref": "#/$defs/ec2_ami"
},
"image_user": {
"description": "The default user of the AMI",
"type": "string"
},
"ec2_region": {
"description": "The region of the AMI",
"$ref": "#/$defs/ec2_region"
},
"image_region_mapping": {
"description": "A list of alternative AMIs for other regions",
"type": "object",
"propertyNames": {
"description": "The region of the AMI",
"$ref": "#/$defs/ec2_region"
},
"patternProperties": {
"": {
"description": "The AMI ID",
"$ref": "#/$defs/ec2_ami"
}
}
}
},
"additionalProperties": false,
"required": [
"image_id",
"image_user"
]
}
]
},
"is_windows": {
"description": "Flag the machine as a Windows machine to interpret 'init_scripts' as powershell",
"type": "boolean",
"default": false
},
"init_scripts": {
"description": "The list of init scripts to use for the machine, content of all the scripts will be concatenated into 1 init script in Strigo",
"type": "array",
"items": {
"$ref": "#/$defs/script"
}
},
"post_launch_scripts": {
"description": "The list of post launch batch scripts (Windows only) to use for the machine, content of all the scripts will be concatenated into 1 init script in Strigo",
"type": "array",
"items": {
"$ref": "#/$defs/script"
}
},
"view_interface": {
"description": "The default interface of the machine",
"oneOf": [
{
"type": "null"
},
{
"type": "string",
"enum": [
"terminal",
"desktop"
]
}
]
},
"webview_links": {
"description": "The list of web interfaces of the machine",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "The name of the interface",
"type": "string"
},
"url": {
"description": "The URL of the interface (something of the form `http://instance.autolab.strigo.io:<port>`)",
"type": "string",
"pattern": "https?://(instance.autolab.strigo.io:[0-9]+|.*)/?.*"
}
},
"additionalProperties": false,
"required": [
"name",
"url"
]
}
}
},
"additionalProperties": false,
"required": [
"name",
"instance_type"
]
}
}
},
"additionalProperties": false,
"required": [
"id",
"name",
"presentations",
"resources"
],
"$defs": {
"strigo_image_name": {
"type": "string",
"enum": [
"debian-8.7",
"debian-11",
"ubuntu-16.04.2",
"ubuntu-20.04",
"ubuntu-22.04",
"ubuntu-22.04-desktop",
"amazon-linux-v2.0.20221210.1",
"docker-17.09.0-ce",
"windows-server-2016",
"windows-server-2019",
"centos-7.9"
]
},
"ec2_ami": {
"type": "string",
"pattern": "^ami-[0-9a-f]{8,}$"
},
"ec2_region": {
"type": "string",
"enum": [
"eu-west-1",
"eu-west-2",
"eu-west-3",
"us-west-1",
"us-west-2",
"us-east-1",
"us-east-2",
"ca-central-1",
"ap-southeast-1",
"ap-southeast-2",
"ap-northeast-1"
]
},
"script": {
"oneOf": [
{
"description": "A local script (deprecated in favor of '{\"path\": this_value}'",
"type": "string",
"deprecated": true
},
{
"description": "A local script",
"type": "object",
"properties": {
"path": {
"description": "The path of the local script",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"path"
]
},
{
"description": "A remote script from https://github.com/Zenika-Training/strigo-init-script-libs",
"type": "object",
"properties": {
"script": {
"description": "The filename of the script",
"type": "string"
},
"version": {
"description": "The git version of the script to get",
"type": "string",
"default": "main"
},
"env": {
"description": "The mapping of environment variables for the script",
"type": "object"
}
},
"additionalProperties": false,
"required": [
"script"
]
}
]
}
}
}