This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
worker.json
382 lines (382 loc) · 10.4 KB
/
worker.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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "0.0.0.0",
"parameters": {
"identifier": {
"type": "string",
"minLength": 1,
"maxLength": 16,
"defaultValue": "lgtm",
"metadata": {
"description": "A unique identifier for resources related to this LGTM Enterprise deployment. This should match the identifier used for the controller."
}
},
"groupName": {
"type": "string",
"minLength": 1,
"maxLength": 16,
"defaultValue": "workers",
"metadata": {
"description": "A unique name for this group of workers. Must contain only lower-case letters and numbers."
}
},
"virtualMachineUsername": {
"type": "string",
"defaultValue": "lgtm-admin",
"metadata": {
"description": "Username for SSH access to the virtual machine. You can leave this blank and configure SSH access to the virtual machine later through the Azure \"reset password\" feature."
}
},
"virtualMachinePublicKey": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "SSH public key for SSH access to the virtual machine. You can leave this blank and configure SSH access to the virtual machine later through the Azure \"reset password\" feature."
}
},
"virtualMachineSize": {
"type": "string",
"metadata": {
"description": "The type of virtual machine to use."
},
"defaultValue": "Standard_DS2_v2",
"allowedValues": [
"Standard_B12ms",
"Standard_B16ms",
"Standard_B20ms",
"Standard_B2ms",
"Standard_B2s",
"Standard_B4ms",
"Standard_B8ms",
"Standard_D16as_v4",
"Standard_D16ds_v4",
"Standard_D16s_v3",
"Standard_D2as_v4",
"Standard_D2ds_v4",
"Standard_D2s_v3",
"Standard_D32as_v4",
"Standard_D32ds_v4",
"Standard_D32s_v3",
"Standard_D48as_v4",
"Standard_D48ds_v4",
"Standard_D48s_v3",
"Standard_D4as_v4",
"Standard_D4ds_v4",
"Standard_D4s_v3",
"Standard_D64as_v4",
"Standard_D64ds_v4",
"Standard_D64s_v3",
"Standard_D8as_v4",
"Standard_D8ds_v4",
"Standard_D8s_v3",
"Standard_D96as_v4",
"Standard_DC1s_v2",
"Standard_DC2s_v2",
"Standard_DC4s_v2",
"Standard_DS11",
"Standard_DS11-1_v2",
"Standard_DS11_v2",
"Standard_DS12",
"Standard_DS12-1_v2",
"Standard_DS12-2_v2",
"Standard_DS12_v2",
"Standard_DS13",
"Standard_DS13-2_v2",
"Standard_DS13-4_v2",
"Standard_DS13_v2",
"Standard_DS14",
"Standard_DS14-4_v2",
"Standard_DS14-8_v2",
"Standard_DS14_v2",
"Standard_DS15_v2",
"Standard_DS2",
"Standard_DS2_v2",
"Standard_DS3",
"Standard_DS3_v2",
"Standard_DS4",
"Standard_DS4_v2",
"Standard_DS5_v2",
"Standard_E16-4ds_v4",
"Standard_E16-4s_v3",
"Standard_E16-8ds_v4",
"Standard_E16-8s_v3",
"Standard_E16as_v4",
"Standard_E16ds_v4",
"Standard_E16s_v3",
"Standard_E20as_v4",
"Standard_E20ds_v4",
"Standard_E20s_v3",
"Standard_E2as_v4",
"Standard_E2ds_v4",
"Standard_E2s_v3",
"Standard_E32-16ds_v4",
"Standard_E32-16s_v3",
"Standard_E32-8ds_v4",
"Standard_E32-8s_v3",
"Standard_E32as_v4",
"Standard_E32ds_v4",
"Standard_E32s_v3",
"Standard_E4-2ds_v4",
"Standard_E4-2s_v3",
"Standard_E48as_v4",
"Standard_E48ds_v4",
"Standard_E48s_v3",
"Standard_E4as_v4",
"Standard_E4ds_v4",
"Standard_E4s_v3",
"Standard_E64-16ds_v4",
"Standard_E64-16s_v3",
"Standard_E64-32s_v3",
"Standard_E64as_v4",
"Standard_E64ds_v4",
"Standard_E64is_v3",
"Standard_E64s_v3",
"Standard_E8-2ds_v4",
"Standard_E8-2s_v3",
"Standard_E8-4ds_v4",
"Standard_E8-4s_v3",
"Standard_E8as_v4",
"Standard_E8ds_v4",
"Standard_E8s_v3",
"Standard_E96as_v4",
"Standard_F16s",
"Standard_F16s_v2",
"Standard_F2s",
"Standard_F2s_v2",
"Standard_F32s_v2",
"Standard_F48s_v2",
"Standard_F4s",
"Standard_F4s_v2",
"Standard_F64s_v2",
"Standard_F72s_v2",
"Standard_F8s",
"Standard_F8s_v2",
"Standard_HB60rs",
"Standard_HC44rs",
"Standard_L16s_v2",
"Standard_L32s_v2",
"Standard_L48s_v2",
"Standard_L64s_v2",
"Standard_L80s_v2",
"Standard_L8s_v2",
"Standard_M128",
"Standard_M128-32ms",
"Standard_M128-64ms",
"Standard_M128m",
"Standard_M128ms",
"Standard_M128s",
"Standard_M16-4ms",
"Standard_M16-8ms",
"Standard_M16ms",
"Standard_M208ms_v2",
"Standard_M208s_v2",
"Standard_M32-16ms",
"Standard_M32-8ms",
"Standard_M32ls",
"Standard_M32ms",
"Standard_M32ts",
"Standard_M416-208ms_v2",
"Standard_M416-208s_v2",
"Standard_M416ms_v2",
"Standard_M416s_v2",
"Standard_M64",
"Standard_M64-16ms",
"Standard_M64-32ms",
"Standard_M64ls",
"Standard_M64m",
"Standard_M64ms",
"Standard_M64s",
"Standard_M8-2ms",
"Standard_M8-4ms",
"Standard_M8ms",
"Standard_NC12s_v2",
"Standard_NC12s_v3",
"Standard_NC24rs_v2",
"Standard_NC24rs_v3",
"Standard_NC24s_v2",
"Standard_NC24s_v3",
"Standard_NC6s_v2",
"Standard_NC6s_v3",
"Standard_ND40rs_v2",
"Standard_NV12s_v2",
"Standard_NV12s_v3",
"Standard_NV16as_v4",
"Standard_NV24s_v2",
"Standard_NV24s_v3",
"Standard_NV32as_v4",
"Standard_NV48s_v3",
"Standard_NV4as_v4",
"Standard_NV6s_v2",
"Standard_NV8as_v4"
]
},
"workerCredentials": {
"type": "securestring",
"metadata": {
"description": "This should be copied from the administrator interface of the LGTM Enterprise controller."
}
},
"copies": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The number of copies of this worker to create."
}
},
"generalWorkers": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The number of general workers to run on the controller."
}
},
"onDemandWorkers": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "The number of on-demand workers to run on the controller."
}
},
"queryWorkers": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "The number of query workers to run on the controller."
}
},
"workerEnvironment": {
"type": "object",
"defaultValue": {},
"metadata": {
"description": "A dictionary of environment variables to use for the workers."
}
},
"manifestPassword": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"description": "A password used to encrypt the LGTM manifest. If not specified a password will be generated and stored in `/data/lgtm-releases/.manifest-password`."
}
}
},
"variables": {
"storageAccountType": "Premium_LRS",
"networkSecurityGroupName": "[concat(parameters('identifier'), '-worker')]",
"virtualNetworkName": "[parameters('identifier')]",
"subnetName": "[parameters('identifier')]",
"virtualMachineScaleSetName": "[concat(parameters('identifier'), '-', parameters('groupName'))]",
"virtualMachineNamePrefix": "[concat(parameters('identifier'), '-', parameters('groupName'))]",
"virtualMachineImage": {
"publisher": "github",
"offer": "lgtm-enterprise",
"sku": "lgtm-enterprise",
"version": "$version"
},
"customData": {
"controller-hostname": "[concat(parameters('identifier'), '.internal.cloudapp.net')]",
"worker-credentials": "[replace(replace(parameters('workerCredentials'), 'worker-credentials: \"', ''), '\"', '')]",
"n-general": "[parameters('generalWorkers')]",
"n-on-demand": "[parameters('onDemandWorkers')]",
"n-query": "[parameters('queryWorkers')]",
"environment": "[parameters('workerEnvironment')]",
"manifest-password": "[parameters('manifestPassword')]"
}
},
"resources": [
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2019-02-01",
"name": "[variables('networkSecurityGroupName')]",
"location": "[resourceGroup().location]",
"properties": {
"securityRules": [
{
"name": "ssh",
"properties": {
"description": "Administrative SSH access to the virtual machine.",
"protocol": "*",
"sourcePortRange": "*",
"destinationPortRange": "22",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 100,
"direction": "Inbound"
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"apiVersion": "2019-07-01",
"name": "[variables('virtualMachineScaleSetName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
],
"sku": {
"name": "[parameters('virtualMachineSize')]",
"capacity": "[parameters('copies')]"
},
"properties": {
"virtualMachineProfile": {
"osProfile": {
"computerNamePrefix": "[variables('virtualMachineNamePrefix')]",
"adminUsername": "[parameters('virtualMachineUsername')]",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', parameters('virtualMachineUsername'), '/.ssh/authorized_keys')]",
"keyData": "[parameters('virtualMachinePublicKey')]"
}
]
}
},
"customData": "[base64(concat('#lgtm\n', string(variables('customData'))))]"
},
"storageProfile": {
"imageReference": "[variables('virtualMachineImage')]",
"osDisk": {
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "main",
"properties": {
"primary": true,
"ipConfigurations": [
{
"name": "ip",
"properties": {
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetName'))]"
},
"publicIpAddressConfiguration": {
"name": "public",
"properties": {
"idleTimeoutInMinutes": 15
}
}
}
}
],
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
}
}
}
]
}
},
"upgradePolicy": {
"mode": "Automatic"
}
}
}
]
}