-
Notifications
You must be signed in to change notification settings - Fork 363
/
azuredeploy.hpa.json
206 lines (206 loc) · 5.18 KB
/
azuredeploy.hpa.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
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.OperationalInsights/workspaces",
"apiVersion": "2022-10-01",
"name": "[parameters('containerAppLogAnalyticsName')]",
"location": "[parameters('location')]",
"properties": {
"sku": {
"name": "PerGB2018"
}
}
},
{
"type": "Microsoft.App/managedEnvironments",
"apiVersion": "2023-11-02-preview",
"name": "[parameters('containerAppEnvName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Consumption"
},
"properties": {
"appLogsConfiguration": {
"destination": "log-analytics",
"logAnalyticsConfiguration": {
"customerId": "[reference(resourceId('Microsoft.OperationalInsights/workspaces', parameters('containerAppLogAnalyticsName'))).customerId]",
"sharedKey": "[listKeys(resourceId('Microsoft.OperationalInsights/workspaces', parameters('containerAppLogAnalyticsName')), '2022-10-01').primarySharedKey]"
}
}
},
"dependsOn": [
"[resourceId('Microsoft.OperationalInsights/workspaces', parameters('containerAppLogAnalyticsName'))]"
]
},
{
"type": "Microsoft.App/containerApps",
"apiVersion": "2022-06-01-preview",
"name": "[parameters('containerAppName')]",
"location": "[parameters('location')]",
"properties": {
"managedEnvironmentId": "[resourceId('Microsoft.App/managedEnvironments', parameters('containerAppEnvName'))]",
"configuration": {
"ingress": {
"external": true,
"targetPort": "[parameters('targetPort')]",
"allowInsecure": false,
"traffic": [
{
"latestRevision": true,
"weight": 100
}
]
}
},
"template": {
"containers": [
{
"name": "[parameters('containerAppName')]",
"image": "[parameters('image')]",
"resources": {
"cpu": "[json(parameters('cpuCore'))]",
"memory": "[format('{0}Gi', parameters('memorySize'))]"
},
"env": [
{
"name": "DATABASE_URL",
"value": "[parameters('databaseUrl')]"
},
{
"name": "COHERE_API_KEY",
"value": "[parameters('cohereApiKey')]"
}
]
}
],
"scale": {
"minReplicas": "[parameters('minReplicas')]",
"maxReplicas": "[parameters('maxReplicas')]",
"rules": [
{
"name": "http-scale-rule",
"http": {
"metadata": {
"concurrentRequests": "100"
}
}
}
]
}
}
},
"dependsOn": [
"[resourceId('Microsoft.App/managedEnvironments', parameters('containerAppEnvName'))]"
]
}
],
"parameters": {
"containerAppName": {
"type": "string",
"defaultValue": "[format('toolkit-app-{0}', uniqueString(resourceGroup().id))]",
"metadata": {
"description": "Specifies the name of the container app."
}
},
"containerAppEnvName": {
"type": "string",
"defaultValue": "[format('toolkit-env-{0}', uniqueString(resourceGroup().id))]",
"metadata": {
"description": "Specifies the name of the container app environment."
}
},
"containerAppLogAnalyticsName": {
"type": "string",
"defaultValue": "[format('toolkit-log-{0}', uniqueString(resourceGroup().id))]",
"metadata": {
"description": "Specifies the name of the log analytics workspace."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Specifies the location for all resources."
}
},
"targetPort": {
"type": "int",
"defaultValue": 4000,
"metadata": {
"description": "Specifies the container port."
}
},
"cpuCore": {
"type": "string",
"defaultValue": "2",
"allowedValues": [
"0.25",
"0.5",
"0.75",
"1",
"1.25",
"1.5",
"1.75",
"2"
],
"metadata": {
"description": "Number of CPU cores the container can use. Can be with a maximum of two decimals."
}
},
"memorySize": {
"type": "string",
"defaultValue": "4",
"allowedValues": [
"0.5",
"1",
"1.5",
"2",
"3",
"3.5",
"4"
],
"metadata": {
"description": "Amount of memory (in gibibytes, GiB) allocated to the container up to 4GiB. Can be with a maximum of two decimals. Ratio with CPU cores must be equal to 2."
}
},
"minReplicas": {
"type": "int",
"defaultValue": 1,
"maxValue": 2,
"minValue": 0,
"metadata": {
"description": "Minimum number of replicas that will be deployed"
}
},
"maxReplicas": {
"type": "int",
"defaultValue": 1,
"maxValue": 2,
"minValue": 0,
"metadata": {
"description": "Maximum number of replicas that will be deployed"
}
},
"image": {
"type": "string",
"defaultValue": "ghcr.io/cohere-ai/cohere-toolkit-proxy",
"metadata": {
"description": "Docker image to deploy"
}
},
"databaseUrl": {
"type": "string",
"metadata": {
"description": "Your Database connection URL"
}
},
"cohereApiKey": {
"type": "string",
"metadata": {
"description": "Your Cohere API key for the application"
}
}
}
}