-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update stress test template to handle Scenario name and group deployments #1866
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fc24cfa
[stress test] Support scenario name injection into job/volume properties
benbp 79b487e
Deploy for stress tests at resource group scope
benbp d856e28
Bump stress-test-addons helm version
benbp 6f4e2ab
Add built-in Values.scenario list handling for stress-test-addons
benbp 2dea045
[stress test] Fix helm repo indexing to merge with previous index
benbp 5dde4b0
[stress test] Automatically compile bicep files in stress test deploy…
benbp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: stress-test-addons | ||
repository: https://stresstestcharts.blob.core.windows.net/helm/ | ||
version: 0.1.2 | ||
digest: sha256:b38f530a7f691eb3f11d48809ba7f86ea9d7b226c3ecb311d1ae47fbb0585466 | ||
generated: "2021-07-28T22:23:31.0555163-04:00" | ||
version: 0.1.4 | ||
digest: sha256:c463bfc41e22ce2d3e6ae19279297b3727fa1d76866fbcbd93dd4744c7b768bd | ||
generated: "2021-08-10T13:03:46.0104659-04:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: stress-test-addons | ||
repository: https://stresstestcharts.blob.core.windows.net/helm/ | ||
version: 0.1.2 | ||
digest: sha256:b38f530a7f691eb3f11d48809ba7f86ea9d7b226c3ecb311d1ae47fbb0585466 | ||
generated: "2021-07-06T18:42:04.6255273-04:00" | ||
version: 0.1.4 | ||
digest: sha256:c463bfc41e22ce2d3e6ae19279297b3727fa1d76866fbcbd93dd4744c7b768bd | ||
generated: "2021-08-10T13:10:34.5201711-04:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 1 addition & 8 deletions
9
tools/stress-cluster/chaos/examples/stress-deployment-example/parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"groupName": { | ||
"value": "stress-test-deploy-example" | ||
}, | ||
"location": { | ||
"value": "westus2" | ||
} | ||
} | ||
"parameters": { } | ||
} |
22 changes: 10 additions & 12 deletions
22
tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
targetScope = 'subscription' | ||
// Dummy parameter to handle defaults the script passes in | ||
param testApplicationOid string = '' | ||
|
||
param groupName string | ||
param location string | ||
param now string = utcNow('u') | ||
|
||
resource group 'Microsoft.Resources/resourceGroups@2020-10-01' = { | ||
name: 'rg-${groupName}-${uniqueString(now)}' | ||
location: location | ||
tags: { | ||
DeleteAfter: dateTimeAdd(now, 'PT8H') | ||
} | ||
resource config 'Microsoft.AppConfiguration/configurationStores@2020-07-01-preview' = { | ||
name: 'config-${resourceGroup().name}' | ||
location: resourceGroup().location | ||
sku: { | ||
name: 'Standard' | ||
} | ||
} | ||
|
||
output RESOURCE_GROUP string = group.name | ||
output RESOURCE_GROUP string = resourceGroup().name | ||
output AZURE_CLIENT_OID string = testApplicationOid |
32 changes: 15 additions & 17 deletions
32
tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,39 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.4.63.48766", | ||
"templateHash": "658186316551815960" | ||
"templateHash": "13987799099034517242" | ||
} | ||
}, | ||
"parameters": { | ||
"groupName": { | ||
"type": "string" | ||
}, | ||
"location": { | ||
"type": "string" | ||
}, | ||
"now": { | ||
"testApplicationOid": { | ||
"type": "string", | ||
"defaultValue": "[utcNow('u')]" | ||
"defaultValue": "" | ||
} | ||
}, | ||
"functions": [], | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Resources/resourceGroups", | ||
"apiVersion": "2020-10-01", | ||
"name": "[format('rg-{0}-{1}', parameters('groupName'), uniqueString(parameters('now')))]", | ||
"location": "[parameters('location')]", | ||
"tags": { | ||
"DeleteAfter": "[dateTimeAdd(parameters('now'), 'PT8H')]" | ||
"type": "Microsoft.AppConfiguration/configurationStores", | ||
"apiVersion": "2020-07-01-preview", | ||
"name": "[format('config-{0}', resourceGroup().name)]", | ||
"location": "[resourceGroup().location]", | ||
"sku": { | ||
"name": "Standard" | ||
} | ||
} | ||
], | ||
"outputs": { | ||
"RESOURCE_GROUP": { | ||
"type": "string", | ||
"value": "[format('rg-{0}-{1}', parameters('groupName'), uniqueString(parameters('now')))]" | ||
"value": "[resourceGroup().name]" | ||
}, | ||
"AZURE_CLIENT_OID": { | ||
"type": "string", | ||
"value": "[parameters('testApplicationOid')]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
tools/stress-cluster/cluster/kubernetes/stress-test-addons/deploy.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,19 @@ | |
source /mnt/secrets/static/* && | ||
az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID && | ||
az account set -s $AZURE_SUBSCRIPTION_ID && | ||
az deployment sub create \ | ||
-n {{ .Release.Name }} \ | ||
-l westus2 \ | ||
groupName='{{ lower .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }}' | ||
az group create -l westus2 -g $groupName && | ||
group=$(az group show -g $groupName -o tsv --query "id") && | ||
az tag create --resource-id $group --tags DeleteAfter="$(date -d '+192:00:00' -Iseconds -u)" && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As this is growing in complexity, I plan to converge with our common deployment scripts for live tests: Azure/azure-sdk#3211 |
||
az deployment group create \ | ||
-g $groupName \ | ||
-n $groupName \ | ||
-f /mnt/testresources/test-resources.json \ | ||
--parameters /mnt/testresources/parameters.json && | ||
az deployment sub show \ | ||
-n {{ .Release.Name }} \ | ||
--parameters /mnt/testresources/parameters.json \ | ||
--parameters testApplicationOid=$AZURE_CLIENT_OID && | ||
az deployment group show \ | ||
-g $groupName \ | ||
-n $groupName \ | ||
-o json \ | ||
--query properties.outputs \ | ||
| jq -r 'keys[] as $k | "\($k | ascii_upcase)=\(.[$k].value)"' >> /mnt/outputs/.env | ||
|
@@ -23,7 +29,7 @@ | |
volumeMounts: | ||
- name: "{{ .Release.Name }}-test-resources" | ||
mountPath: /mnt/testresources | ||
- name: "test-env-{{ .Release.Name }}" | ||
- name: test-env-{{ lower .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }} | ||
mountPath: /mnt/outputs | ||
- name: "static-secrets-{{ .Release.Name }}" | ||
mountPath: "/mnt/secrets/static" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to make errors a no-op now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized this returned exit code isn't used anywhere. The
Run
function will handle adding the failures to a failures array which is then checked and reported after all stress tests have been deployed. I still want thereturn
statements for control flow to stop execution on a per-test basis.