/
deploy-aci.json
117 lines (117 loc) · 3.55 KB
/
deploy-aci.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
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string",
"metadata": {
"description": "Name for the container group"
},
"defaultValue": "cg-fahclient"
},
"image": {
"type": "string",
"metadata": {
"description": "Container image to deploy. Should be of the form accountName/imagename:tag for images stored in Docker Hub or a fully qualified URI for a private registry like the Azure Container Registry."
},
"defaultValue": "cmilanf/fahclient:latest"
},
"cpuCores": {
"type": "string",
"metadata": {
"description": "The number of CPU cores to allocate to the container. Must be an integer."
},
"defaultValue": "1.0"
},
"memoryInGb": {
"type": "string",
"metadata": {
"description": "The amount of memory to allocate to the container in gigabytes."
},
"defaultValue": "0.5"
},
"count": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "How many instances do you want to deploy?"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"restartPolicy": {
"type": "string",
"defaultValue": "onfailure",
"metadata": {
"description": "The behavior of Azure runtime if container has stopped."
},
"allowedValues": [
"never",
"always",
"onfailure"
]
},
"fah-user": {
"type": "string",
"defaultValue": "Anonymous",
"metadata": {
"description": "The user handle to use in the Folding@home network"
}
},
"fah-team": {
"type": "string",
"defaultValue": "0",
"metadata": {
"description": "The team number to use in the Folding@home network"
}
},
"fah-use-gpu": {
"type": "string",
"defaultValue": "false",
"metadata": {
"description": "Use ACI GPU features, if available"
}
}
},
"variables": {},
"resources": [
{
"name": "[concat(parameters('name'), '-', copyIndex())]",
"type": "Microsoft.ContainerInstance/containerGroups",
"apiVersion": "2018-10-01",
"location": "[parameters('location')]",
"copy": {
"name": "aci-copy",
"count": "[parameters('count')]",
"mode": "Parallel"
},
"properties": {
"containers": [
{
"name": "[parameters('name')]",
"properties": {
"image": "[parameters('image')]",
"command": [
"/usr/bin/FAHClient",
"[concat('--user=', parameters('fah-user'), ' --team=', parameters('fah-team'), ' --gpu=', parameters('fah-use-gpu'),' --smp=true --power=full')]"
],
"resources": {
"requests": {
"cpu": "[parameters('cpuCores')]",
"memoryInGb": "[parameters('memoryInGb')]"
}
}
}
}
],
"osType": "Linux",
"restartPolicy": "[parameters('restartPolicy')]"
}
}
]
}