Skip to content
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 the feature/websockets branch with changes from main #3903

Merged
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e0706ba
Stress test (#3820)
gearama Jul 13, 2022
a3926d6
Fixed the metadata for better handling (#3824)
azure-sdk Jul 13, 2022
593437b
Update attestation core vcpkg dependency to latest GA version that is…
ahsonkhan Jul 15, 2022
7bf6735
Remove winhttp (#3832)
gearama Jul 15, 2022
73bb61d
Move perf.yml to eng/common (#3833)
azure-sdk Jul 15, 2022
cff96f8
Sync eng/common directory with azure-sdk-tools for PR 3656 (#3834)
azure-sdk Jul 15, 2022
c3ecbcd
Update casing for 'verison' (#3821)
azure-sdk Jul 19, 2022
b95cdcf
Print additional result summary formats to pipelines UI (#3842)
azure-sdk Jul 19, 2022
584f83c
Sync eng/common directory with azure-sdk-tools for PR 3702 (#3843)
azure-sdk Jul 20, 2022
6c74e57
Fix incorrect failure notification in vcpkg publishing (#3838)
danieljurek Jul 21, 2022
992a3a9
Helm charts (#3841)
gearama Jul 25, 2022
8cb8a43
Sync eng/common directory with azure-sdk-tools for PR 3661 (#3846)
azure-sdk Jul 25, 2022
ea2d3ad
Sync eng/common directory with azure-sdk-tools for PR 3735 (#3845)
azure-sdk Jul 25, 2022
a75c95b
Increment version for keyvault releases (#3809)
azure-sdk Jul 25, 2022
c437f5a
Removed hard dependency on opentelemetry version (#3844)
LarryOsterman Jul 26, 2022
209dcae
Revert "Add full clone fallback to sparse checkout (#3661)" (#3851)
azure-sdk Jul 26, 2022
f2efced
Sync eng/common directory with azure-sdk-tools for PR 3753 (#3857)
azure-sdk Jul 27, 2022
9843c71
Bump macOs version to macos-11 (#3853)
sima-zhu Jul 28, 2022
1dab2c1
Update CHANGELOG.md
RickWinter Jul 28, 2022
9eae0df
Fix misleading step name in az module install (#3859)
azure-sdk Jul 29, 2022
86b3305
Retry poll calls on EINTR (#3858)
johnwheffner Aug 1, 2022
9a04638
Fix bad path to sample matrix json (#3860)
azure-sdk Aug 2, 2022
e8906ca
Sync eng/common directory with azure-sdk-tools for PR 3826 (#3863)
azure-sdk Aug 3, 2022
755d717
Core August releases (#3862)
antkmsft Aug 4, 2022
5a8d623
Increment version for core releases (#3865)
azure-sdk Aug 4, 2022
5411134
Storage Aug GA release (#3864)
Jinming-Hu Aug 5, 2022
bf65862
CG only runs on internal (#3866)
JonathanCrd Aug 5, 2022
93991ab
STG 79 80 81 Features (#3850)
Jinming-Hu Aug 5, 2022
5954ef7
Sync eng/common directory with azure-sdk-tools for PR 3860 (#3871)
azure-sdk Aug 5, 2022
1f82325
Storage August Preview Release (#3868)
Jinming-Hu Aug 9, 2022
b5c456c
Increment version for storage releases (#3875)
azure-sdk Aug 9, 2022
e019b3e
Fix an issue that reason phrase is missing as expected from HTTP/2 se…
keshen-msft Aug 10, 2022
c152c05
Update CODEOWNERS (#3881)
microzchang Aug 11, 2022
82d4446
updated targeted proxy version to one that properly allows consumptio…
azure-sdk Aug 15, 2022
2dd3dbe
Fix `azure-storage-blobs-cpp` beta install (#3889)
antkmsft Aug 17, 2022
634df13
Fixed #3899 - Handle new OSX version correctly; reformatted platform-…
LarryOsterman Aug 24, 2022
f8c41df
Simpler get-binarysizes check for OSX (#3901)
LarryOsterman Aug 24, 2022
50152b0
Merge branch 'main' into updatewebsocketswithmain
LarryOsterman Aug 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Helm charts (#3841)
* 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
gearama authored Jul 25, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 992a3a94092b91109ebba86937307f2c87274bbd
2 changes: 2 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@
"*.exe",
"*.a",
"*.lib",
"*.yaml",
"**/libcurl-stress-test/README.md",
".github/CODEOWNERS",
".gitignore",
".vscode/cspell.json",
7 changes: 0 additions & 7 deletions sdk/core/azure-core/test/libcurl-stress-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -17,10 +17,3 @@ target_link_libraries(azure-core-libcurl-stress-test PRIVATE azure-core)
create_map_file(azure-core-libcurl-stress-test azure-core-libcurl-stress-test.map)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Dockerfile
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)

find_program(DOCKER_EXECUTABLE docker)
#if docker is found try to build the docker image in the defined docker_build stage which should be run after build
if(DOCKER_EXECUTABLE)
add_custom_target(docker_build
COMMAND ${DOCKER_EXECUTABLE} build --build-arg targetTest=azure-core-libcurl-stress-test --build-arg build=on --tag=azuresdkforcpp/curlstress -f Dockerfile .)
endif()
16 changes: 16 additions & 0 deletions sdk/core/azure-core/test/libcurl-stress-test/Chart.yaml
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/
5 changes: 3 additions & 2 deletions sdk/core/azure-core/test/libcurl-stress-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT

FROM mcr.microsoft.com/mirror/docker/library/ubuntu:22.04

ARG targetTest
@@ -11,5 +14,3 @@ RUN chmod +x ./$targetTest
RUN apt-get update -y
RUN apt-get install valgrind -y

# execute under memcheck tool
RUN valgrind --tool=memcheck -s ./$targetTest $build
29 changes: 29 additions & 0 deletions sdk/core/azure-core/test/libcurl-stress-test/README.md
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 .
Original file line number Diff line number Diff line change
@@ -9,26 +9,19 @@
* the instructions to install and run the server before running this test.
*
*/

#define REQUESTS 100
#define WARMUP 100
#define ROUNDS 100

#include <azure/core.hpp>
#include <azure/core/http/curl_transport.hpp>
#include <fstream>
#include <ios>
#include <iostream>
#include <memory>
#include <stdlib.h>
#include <string>
#include <vector>

void SendRequest(std::string target)
{
std::cout << target << std::endl;
/* The transport adapter must allow insecure SSL certs.
If both curl and winHttp are available, curl is preferred for this test*/

// The transport adapter must allow insecure SSL certs.
Azure::Core::Http::CurlTransportOptions curlOptions;
curlOptions.SslVerifyPeer = false;
auto implementationClient = std::make_shared<Azure::Core::Http::CurlTransport>(curlOptions);
@@ -37,16 +30,15 @@ void SendRequest(std::string target)
{

Azure::Core::Context context;
// auto duration = std::chrono::milliseconds(1000);
// auto deadline = std::chrono::system_clock::now() + duration;
auto request
= Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(target));
auto response = implementationClient->Send(request, context); //.WithDeadline(deadline));
auto response = implementationClient->Send(request, context);
// Make sure to pull all bytes from network.
auto body = response->ExtractBodyStream()->ReadToEnd();
}
catch (std::exception const&)
{
// don't print exceptions, they are happening at each request, this is the point of the test
}
}

@@ -60,11 +52,11 @@ void Operation(int repetitions)
}
}

int main(int argc, char** argv) // i can have either 0 or 2 params here
int main(int argc, char**)
{
(void)argv; // to get rid of the unused warning
// some param was passed to the program , which happens only in build mode, not run of the docker
// file. thus we will run a quick test to make sure the executable runs.
// some param was passed to the program, doesn't matter what it is,
// it is meant for the moment to just run a quick iteration to check for sanity of the test.
// since prototype TODO: pass in warmup/rounds/requests as params.
if (argc != 1)
{
std::cout << "--------------\tBUILD TEST\t--------------" << std::endl;
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
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 -}}