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

Storageblob #4043

Merged
merged 19 commits into from
Oct 21, 2022
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"HRESULT",
"IMDS",
"Intel",
"issecret",
"itfactor",
"iusg",
"jepio",
Expand Down
11 changes: 11 additions & 0 deletions cmake-modules/PerfTest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
macro(SetPerfDeps PACKAGE VAR_RESULT)
string(TOUPPER ${PACKAGE} SUFFIX)
string(CONCAT VAR_TRIGGER "VCPKG-" ${SUFFIX})
message(STATUS "trigger name ${VAR_TRIGGER}")
if(DEFINED ENV{${VAR_TRIGGER}})
find_package(${PACKAGE} $ENV{${VAR_TRIGGER}} EXACT)
add_compile_definitions(${VAR_RESULT}="$ENV{${VAR_TRIGGER}}")
else()
add_compile_definitions(${VAR_RESULT}="source")
endif()
endmacro()
9 changes: 4 additions & 5 deletions eng/pipelines/templates/jobs/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ parameters:
- name: EnvVars
type: object
default: []
- name: InstallLanguageSteps
type: object
default: []

extends:
template: /eng/common/pipelines/templates/jobs/perf.yml
Expand All @@ -38,8 +41,4 @@ extends:
Iterations: ${{ parameters.Iterations }}
AdditionalArguments: ${{ parameters.AdditionalArguments }}
EnvVars: ${{ parameters.EnvVars}}
InstallLanguageSteps:
- template: /eng/pipelines/templates/steps/vcpkg.yml
#/eng/pipelines/templates/steps/vcpkg-clone.yml
parameters:
RepoOwner: Microsoft
InstallLanguageSteps: ${{ parameters.InstallLanguageSteps }}
8 changes: 8 additions & 0 deletions sdk/core/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ extends:
Arguments: ${{ parameters.Arguments }}
Iterations: ${{ parameters.Iterations }}
AdditionalArguments: ${{ parameters.AdditionalArguments }}
InstallLanguageSteps:
- pwsh: |
Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SOURCES_SECRET;issecret=true;]clear;x-azblob,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-container,,read"
displayName: Set Vcpkg Variables

EnvVars:
# This is set in the InstallLanguageSteps
VCPKG_BINARY_SOURCES_SECRET: $(VCPKG_BINARY_SOURCES_SECRET)
3 changes: 2 additions & 1 deletion sdk/core/perf/src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ std::vector<Azure::Perf::TestOption> Azure::Perf::GlobalTestOptions::GetOptionMe
{"Rate", {"-r", "--rate"}, "Target throughput (ops/sec). Default to no throughput.", 1},
{"Warmup", {"-w", "--warmup"}, "Duration of warmup in seconds. Default to 5 seconds.", 1},
{"TestProxies", {"-x", "--test-proxies"}, "URIs of TestProxy Servers (separated by ';')", 1},
{"help", {"-h", "--help"}, "Display help information.", 0}};
{"help", {"-h", "--help"}, "Display help information.", 0},
{"Sync", {"-y", "--sync"}, "Runs sync version of test, not implemented", 0}};
}
21 changes: 21 additions & 0 deletions sdk/storage/azure-storage-blobs/perf-resources.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
param baseName string = resourceGroup().name
param location string = resourceGroup().location

resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = {
name: '${baseName}blob'
location: location
kind: 'BlockBlobStorage'
sku: {
name: 'Premium_LRS'
}
}

var name = storageAccount.name
var key = storageAccount.listKeys().keys[0].value
var connectionString = 'DefaultEndpointsProtocol=https;AccountName=${name};AccountKey=${key}'

output AZURE_STORAGE_ACCOUNT_NAME string = name
output AZURE_STORAGE_ACCOUNT_KEY string = key
output AZURE_STORAGE_CONNECTION_STRING string = connectionString
output STANDARD_STORAGE_CONNECTION_STRING string = connectionString
output STORAGE_CONNECTION_STRING string = connectionString
40 changes: 40 additions & 0 deletions sdk/storage/azure-storage-blobs/perf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
parameters:
- name: PackageVersions
displayName: PackageVersions (regex of package versions to run)
type: string
default: '12|source'
- name: Tests
displayName: Tests (regex of tests to run)
type: string
default: '^(download|upload|list-blobs)$'
- name: Arguments
displayName: Arguments (regex of arguments to run)
type: string
default: '(10240)|(10485760)|(1073741824)|(5 )|(500 )|(50000 )'
- name: Iterations
displayName: Iterations (times to run each test)
type: number
default: '5'
- name: AdditionalArguments
displayName: AdditionalArguments (passed to PerfAutomation)
type: string
default: ' '

extends:
template: /eng/pipelines/templates/jobs/perf.yml
parameters:
ServiceDirectory: storage/azure-storage-blobs
Services: "^storage-blob$"
PackageVersions: ${{ parameters.PackageVersions }}
Tests: ${{ parameters.Tests }}
Arguments: ${{ parameters.Arguments }}
Iterations: ${{ parameters.Iterations }}
AdditionalArguments: ${{ parameters.AdditionalArguments }}
InstallLanguageSteps:
- pwsh: |
Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SOURCES_SECRET;issecret=true;]clear;x-azblob,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-container,,read"
displayName: Set Vcpkg Variables

EnvVars:
# This is set in the InstallLanguageSteps
VCPKG_BINARY_SOURCES_SECRET: $(VCPKG_BINARY_SOURCES_SECRET)
7 changes: 6 additions & 1 deletion sdk/storage/azure-storage-blobs/test/perf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ cmake_minimum_required (VERSION 3.13)
project(azure-storage-blobs-perf LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include(AzureVcpkg)
az_vcpkg_integrate()

if(BUILD_TRANSPORT_CURL)
set(DOWNLOAD_WITH_LIBCURL inc/azure/storage/blobs/test/download_blob_transport_only.hpp)
Expand Down Expand Up @@ -35,6 +37,8 @@ add_executable (

create_per_service_target_build(storage azure-storage-blobs-perf)

include(PerfTest)
SETPERFDEPS(azure-storage-blobs-cpp VCPKG_STORAGE_BLOB_VERSION)
# Include the headers from the project.
target_include_directories(
azure-storage-blobs-perf
Expand All @@ -47,7 +51,8 @@ if (MSVC)
target_compile_options(azure-storage-blobs-perf PUBLIC /wd4996)
endif()


# link the `azure-perf` lib together with any other library which will be used for the tests.
target_link_libraries(azure-storage-blobs-perf PRIVATE azure-storage-blobs azure-perf)
target_link_libraries(azure-storage-blobs-perf PRIVATE Azure::azure-storage-blobs azure-perf)
# Make sure the project will appear in the test folder for Visual Studio CMake view
set_target_properties(azure-storage-blobs-perf PROPERTIES FOLDER "Tests/Storage")
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

int main(int argc, char** argv)
{
std::cout << "Azure-storage-blobs VERSION " << VCPKG_STORAGE_BLOB_VERSION << std::endl;

// Create the test list
std::vector<Azure::Perf::TestMetadata> tests
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
{
"name": "opentelemetry-cpp",
"platform": "!uwp",
"platform": "!(windows & !static)",
"version>=": "1.3.0"
},
{
Expand Down