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
/
controller.json
503 lines (503 loc) · 14.3 KB
/
controller.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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
{
"$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. Must contain only lower-case letters and numbers. If you are upgrading from a previous version, this should match the identifier used for the previous version."
}
},
"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_DS4_v2",
"allowedValues": [
"Standard_B12ms",
"Standard_B16ms",
"Standard_B20ms",
"Standard_B4ms",
"Standard_B8ms",
"Standard_D16as_v4",
"Standard_D16ds_v4",
"Standard_D16s_v3",
"Standard_D16s_v4",
"Standard_D32as_v4",
"Standard_D32ds_v4",
"Standard_D32s_v3",
"Standard_D32s_v4",
"Standard_D48as_v4",
"Standard_D48ds_v4",
"Standard_D48s_v3",
"Standard_D48s_v4",
"Standard_D4as_v4",
"Standard_D4ds_v4",
"Standard_D4s_v3",
"Standard_D4s_v4",
"Standard_D64as_v4",
"Standard_D64ds_v4",
"Standard_D64s_v3",
"Standard_D64s_v4",
"Standard_D8as_v4",
"Standard_D8ds_v4",
"Standard_D8s_v3",
"Standard_D8s_v4",
"Standard_D96as_v4",
"Standard_DC4s_v2",
"Standard_DS12",
"Standard_DS12-1_v2",
"Standard_DS12-2_v2",
"Standard_DS12_v2",
"Standard_DS12_v2_Promo",
"Standard_DS13",
"Standard_DS13-2_v2",
"Standard_DS13-4_v2",
"Standard_DS13_v2",
"Standard_DS13_v2_Promo",
"Standard_DS14",
"Standard_DS14-4_v2",
"Standard_DS14-8_v2",
"Standard_DS14_v2",
"Standard_DS14_v2_Promo",
"Standard_DS15_v2",
"Standard_DS4",
"Standard_DS4_v2",
"Standard_DS4_v2_Promo",
"Standard_DS5_v2",
"Standard_DS5_v2_Promo",
"Standard_E16-4ds_v4",
"Standard_E16-4s_v3",
"Standard_E16-4s_v4",
"Standard_E16-8ds_v4",
"Standard_E16-8s_v3",
"Standard_E16-8s_v4",
"Standard_E16as_v4",
"Standard_E16ds_v4",
"Standard_E16s_v3",
"Standard_E16s_v4",
"Standard_E20as_v4",
"Standard_E20ds_v4",
"Standard_E20s_v3",
"Standard_E20s_v4",
"Standard_E2as_v4",
"Standard_E2ds_v4",
"Standard_E2s_v3",
"Standard_E2s_v4",
"Standard_E32-16ds_v4",
"Standard_E32-16s_v3",
"Standard_E32-16s_v4",
"Standard_E32-8ds_v4",
"Standard_E32-8s_v3",
"Standard_E32-8s_v4",
"Standard_E32as_v4",
"Standard_E32ds_v4",
"Standard_E32s_v3",
"Standard_E32s_v4",
"Standard_E4-2ds_v4",
"Standard_E4-2s_v3",
"Standard_E4-2s_v4",
"Standard_E48as_v4",
"Standard_E48ds_v4",
"Standard_E48s_v3",
"Standard_E48s_v4",
"Standard_E4as_v4",
"Standard_E4ds_v4",
"Standard_E4s_v3",
"Standard_E4s_v4",
"Standard_E64-16ds_v4",
"Standard_E64-16s_v3",
"Standard_E64-16s_v4",
"Standard_E64-32ds_v4",
"Standard_E64-32s_v3",
"Standard_E64-32s_v4",
"Standard_E64as_v4",
"Standard_E64ds_v4",
"Standard_E64is_v3",
"Standard_E64s_v3",
"Standard_E64s_v4",
"Standard_E8-2ds_v4",
"Standard_E8-2s_v3",
"Standard_E8-2s_v4",
"Standard_E8-4ds_v4",
"Standard_E8-4s_v3",
"Standard_E8-4s_v4",
"Standard_E8as_v4",
"Standard_E8ds_v4",
"Standard_E8s_v3",
"Standard_E8s_v4",
"Standard_E96as_v4",
"Standard_F16s",
"Standard_F16s_v2",
"Standard_F32s_v2",
"Standard_F48s_v2",
"Standard_F64s_v2",
"Standard_F72s_v2",
"Standard_F8s",
"Standard_F8s_v2",
"Standard_HB120rs_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_NV6s_v2",
"Standard_NV8as_v4"
]
},
"dataDiskSizeGB": {
"type": "int",
"metadata": {
"description": "The data disk size for your LGTM Enterprise instance in gigabytes. If you are upgrading from a previous version, this should match the data disk size used for the previous version."
},
"defaultValue": 1024
},
"administratorEmail": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The email address for the initial LGTM Enterprise administrator account. If you are upgrading from a previous version and already have an account this can be left blank."
}
},
"administratorPassword": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"description": "The password for the initial LGTM Enterprise administrator account. It is recommended that you change this after the instance has booted."
}
},
"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": 1,
"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`. If you are upgrading from a previous version, this should match the manifest password used for the previous version."
}
}
},
"variables": {
"storageAccountType": "Premium_LRS",
"publicIPName": "[parameters('identifier')]",
"publicIPType": "Static",
"networkSecurityGroupName": "[parameters('identifier')]",
"virtualNetworkName": "[parameters('identifier')]",
"addressPrefix": "10.0.0.0/16",
"subnetName": "[parameters('identifier')]",
"subnetPrefix": "10.0.0.0/16",
"networkInterfaceName": "[parameters('identifier')]",
"virtualMachineName": "[parameters('identifier')]",
"virtualMachineImage": {
"publisher": "github",
"offer": "lgtm-enterprise",
"sku": "lgtm-enterprise",
"version": "$version"
},
"dataDiskName": "[concat(parameters('identifier'), '-data')]",
"osDiskName": "[concat(parameters('identifier'), '-os')]",
"sshPublicKeys": [
{
"path": "[concat('/home/', parameters('virtualMachineUsername'), '/.ssh/authorized_keys')]",
"keyData": "[parameters('virtualMachinePublicKey')]"
}
],
"sshPublicKeysIfSet": "[if(empty(parameters('virtualMachinePublicKey')), json('null'), variables('sshPublicKeys'))]",
"customData": {
"admin-email": "[parameters('administratorEmail')]",
"admin-password": "[parameters('administratorPassword')]",
"n-general": "[parameters('generalWorkers')]",
"n-on-demand": "[parameters('onDemandWorkers')]",
"n-query": "[parameters('queryWorkers')]",
"environment": "[parameters('workerEnvironment')]",
"manifest-password": "[parameters('manifestPassword')]"
}
},
"resources": [
{
"type": "Microsoft.Network/publicIpAddresses",
"apiVersion": "2019-02-01",
"name": "[variables('publicIPName')]",
"location": "[resourceGroup().location]",
"properties": {
"publicIpAllocationMethod": "[variables('publicIPType')]"
}
},
{
"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"
}
},
{
"name": "http",
"properties": {
"description": "HTTP access for LGTM Enterprise's web interface.",
"protocol": "*",
"sourcePortRange": "*",
"destinationPortRange": "80",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 101,
"direction": "Inbound"
}
},
{
"name": "https",
"properties": {
"description": "HTTPS access for LGTM Enterprise's web interface.",
"protocol": "*",
"sourcePortRange": "*",
"destinationPortRange": "443",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 102,
"direction": "Inbound"
}
},
{
"name": "setup",
"properties": {
"description": "HTTP access for LGTM Enterprise's startup log.",
"protocol": "*",
"sourcePortRange": "*",
"destinationPortRange": "8000",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 103,
"direction": "Inbound"
}
}
]
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-09-01",
"name": "[variables('virtualNetworkName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
],
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]",
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
}
}
}
]
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2019-07-01",
"name": "[variables('networkInterfaceName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/publicIpAddresses', variables('publicIPName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ip",
"properties": {
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetName'))]"
},
"privateIPAllocationMethod": "Dynamic",
"publicIpAddress": {
"id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', variables('publicIPName'))]"
}
}
}
]
}
},
{
"type": "Microsoft.Compute/disks",
"apiVersion": "2019-11-01",
"name": "[variables('dataDiskName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "[variables('storageAccountType')]"
},
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": "[parameters('dataDiskSizeGB')]"
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2019-07-01",
"name": "[variables('virtualMachineName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]",
"[resourceId('Microsoft.Compute/disks', variables('dataDiskName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('virtualMachineSize')]"
},
"osProfile": {
"computerName": "[variables('virtualMachineName')]",
"adminUsername": "[parameters('virtualMachineUsername')]",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": "[variables('sshPublicKeysIfSet')]"
}
},
"customData": "[base64(concat('#lgtm\n', string(variables('customData'))))]"
},
"storageProfile": {
"imageReference": "[variables('virtualMachineImage')]",
"osDisk": {
"name": "[variables('osDiskName')]",
"createOption": "FromImage"
},
"dataDisks": [
{
"name": "[variables('dataDiskName')]",
"createOption": "Attach",
"lun": 0,
"managedDisk": {
"id": "[resourceId('Microsoft.Compute/disks', variables('dataDiskName'))]"
}
}
]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]"
}
]
}
}
}
]
}