-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* helm chart * first pipe setup * poi * magiks * ewewe * stress * cleanup * pr * QFE and readme * clang * stupid clang , waste of time * ewqwewewrqrewewrqewrqwrqr * stupid clang * cspell * PR * try try again * clang again
- Loading branch information
Showing
8 changed files
with
96 additions
and
25 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# SPDX-License-Identifier: MIT | ||
|
||
apiVersion: v2 | ||
name: libcurl-stress-test | ||
description: An example of c++ stress test | ||
version: 0.0.1 | ||
appVersion: v0.1 | ||
annotations: | ||
stressTest: 'true' # enable auto-discovery of this test via `find-all-stress-packages.ps1` | ||
namespace: 'azuresdkforcpp' | ||
|
||
dependencies: | ||
- name: stress-test-addons | ||
version: 0.1.19 | ||
repository: https://stresstestcharts.blob.core.windows.net/helm/ |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Stress test prototype | ||
This is work in progress. It's a prototype of how a stress test would look. This PR is to park the work in progress while being dealing with higher priority issues. | ||
## Components | ||
### Code (https://en.wikipedia.org/wiki/C%2B%2B) | ||
The cpp file represents the code for the test, it will generate a number of invalid URLs and then issue CURL send commands. The requests are expected to fail. The point was that it exposes memory leaks in handling the error cases, which we fixed since. | ||
|
||
### Dockerfile (https://www.docker.com/) | ||
Represents the build file for the container in which the test runs, it is based on ubuntu 22.04 , from mcr. | ||
The main change from default ubuntu is making sure we have the valgrind tool installed. Valgrind is a heap monitoring tool that helps identify potential stack traces that might leak memory. While not 100% effective is is great at reducing the surface are for investigations. | ||
|
||
### Helm chart (https://helm.sh/) | ||
Chart.yaml together with the bicep file(https://docs.microsoft.com/azure/azure-resource-manager/bicep/overview?tabs=bicep) and the deploy job file , represent the helm chart needed to deploy to the docker image built from the dockerfile to the stress cluster and execute the stress test. | ||
|
||
The helm chart creates a pod with a container based on the docker image, and executes the test under valgrind. | ||
|
||
To deploy the chart you will need to run "azure-sdk-for-cpp\eng\common\scripts\stress-testing> .\deploy-stress-tests.ps1 -Namespace azuresdkforcpp -SearchDirectory E:\src\azure-sdk-for-cpp\sdk\core\azure-core\test -PushImage" | ||
|
||
Where namaspace will be created if missing , search directory can be any folder where it will search for charts in it and all it's sub dirs, push image will call it to build the docker image. | ||
|
||
ATM the docker image is build by hand and harcoded in the chart to simplify matters. | ||
|
||
To build the image run "docker build -t stresstesttbiruti6oi24k.acr.io/azuresdkforcpp/curlstress:v8 --build-arg targetTest=azure-core-libcurl-stress-test --build-arg build=on ." | ||
|
||
To push to mcr : "docker push stresstesttbiruti6oi24k.acr.io/azuresdkforcpp/curlstress:v8" | ||
Obviously after logging in to the acr "az acr login -n stresspgs7b6dif73rup6.azurecr.io" | ||
|
||
To use another image you will need to go to line 12 in deploy job and update with your new file. | ||
|
||
Once the deploy succeeds run " kubectl logs -n azuresdkforcpp -f libcurl-stress-test" to grab the logs in real time . |
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
16 changes: 16 additions & 0 deletions
16
sdk/core/azure-core/test/libcurl-stress-test/stress-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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// Dummy parameter to handle defaults the script passes in | ||
param testApplicationOid string = '' | ||
|
||
resource config 'Microsoft.AppConfiguration/configurationStores@2020-07-01-preview' = { | ||
name: 'config-${resourceGroup().name}' | ||
location: resourceGroup().location | ||
sku: { | ||
name: 'Standard' | ||
} | ||
} | ||
|
||
output RESOURCE_GROUP string = resourceGroup().name | ||
output AZURE_CLIENT_OID string = testApplicationOid |
22 changes: 22 additions & 0 deletions
22
sdk/core/azure-core/test/libcurl-stress-test/templates/deploy-job.yaml
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# SPDX-License-Identifier: MIT | ||
{{- include "stress-test-addons.deploy-job-template.from-pod" (list . "stress.deploy-example") -}} | ||
{{- define "stress.deploy-example" -}} | ||
metadata: | ||
labels: | ||
testName: "libcurl-stress-test" | ||
name: "libcurl-stress-test" | ||
spec: | ||
containers: | ||
- name: libcurl-stress-test | ||
image: stresspgs7b6dif73rup6.azurecr.io/azuresdkforcpp/curlstress:latest | ||
imagePullPolicy: Always | ||
command: | ||
[ | ||
"valgrind", | ||
"--tool=memcheck", | ||
"-s", | ||
"./azure-core-libcurl-stress-test", | ||
] | ||
{{- include "stress-test-addons.container-env" . | nindent 6 }} | ||
{{- end -}} |