-
Notifications
You must be signed in to change notification settings - Fork 527
Expand file tree
/
Copy pathbenchmarkTemplate.json
More file actions
154 lines (154 loc) · 4.28 KB
/
benchmarkTemplate.json
File metadata and controls
154 lines (154 loc) · 4.28 KB
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
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"endpoint": {
"type": "string",
"metadata": {
"description": "Your account endpoint"
}
},
"key": {
"type": "securestring",
"metadata": {
"description": "Your account key"
}
},
"throughput": {
"type": "string",
"metadata": {
"description": "The throughput for the container."
}
},
"documents": {
"type": "string",
"metadata": {
"description": "The amount of items to insert."
}
},
"parallelism": {
"type": "string",
"metadata": {
"description": "The degree of parallelism."
},
"defaultValue": "-1"
},
"cleanUpOnFinish": {
"type": "string",
"metadata": {
"description": "Whether to delete the container after the benchmark is run."
},
"defaultValue": "false"
},
"containerGroupName": {
"type": "string",
"metadata": {
"description": "Name for the container group"
},
"defaultValue": "CosmosDBBenchmark"
},
"containerName": {
"type": "string",
"metadata": {
"description": "Name for the container"
},
"defaultValue": "cosmosdbsdkperf"
},
"volumeName": {
"type": "string",
"metadata": {
"description": "Name for the gitRepo volume"
},
"defaultValue": "cosmosdbsdk"
},
"port": {
"type": "string",
"metadata": {
"description": "Port to open on the container and the public IP address."
},
"defaultValue": "80"
},
"cpuCores": {
"type": "string",
"metadata": {
"description": "The number of CPU cores to allocate to the container."
},
"defaultValue": "4"
},
"memoryInGb": {
"type": "string",
"metadata": {
"description": "The amount of memory to allocate to the container in gigabytes."
},
"defaultValue": "8"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {},
"resources": [
{
"name": "[parameters('containerGroupName')]",
"type": "Microsoft.ContainerInstance/containerGroups",
"apiVersion": "2020-11-01",
"location": "[parameters('location')]",
"properties": {
"containers": [
{
"name": "[parameters('containerName')]",
"properties": {
"image": "mcr.microsoft.com/dotnet/sdk:6.0",
"ports": [
{
"port": "[parameters('port')]"
}
],
"resources": {
"requests": {
"cpu": "[parameters('cpuCores')]",
"memoryInGB": "[parameters('memoryInGb')]"
}
},
"volumeMounts": [
{
"name": "[parameters('volumeName')]",
"mountPath": "/mnt/gitrepos/",
"readOnly": false
}
],
"command": [
"/bin/bash",
"-c",
"[concat('cd /mnt/gitrepos/azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate;export ENDPOINT=\"', parameters('endpoint'),'\";export KEY=\"', parameters('key'),'\";export THROUGHPUT=\"', parameters('throughput'),'\";export DOCUMENTS=\"', parameters('documents'),'\";export PARALLELISM=\"', parameters('parallelism'),'\";export CLEANUPFINISH=\"', parameters('cleanUpOnFinish'),'\";chmod +x run.sh;./run.sh')]"
]
}
}
],
"osType": "Linux",
"restartPolicy": "Never",
"ipAddress": {
"type": "Public",
"ports": [
{
"protocol": "TCP",
"port": "[parameters('port')]"
}
]
},
"volumes": [
{
"name": "[parameters('volumeName')]",
"gitRepo": {
"repository": "https://github.com/Azure/azure-cosmos-dotnet-v3"
}
}
]
}
}
]
}