Skip to content

Commit fc50c08

Browse files
gearamadanieljurek
andauthored
Storageblob (#4043)
* first take * grrrrr * qwqwq * ewqw * eewew * put back * pipeline * Set read-only VCPKG_BINARY_SOURCES_SECRET * Pass InstallLanguageSteps through the perf template * blop pipeline * path * ';l'l; * add support for sync param * --sync flag support * typo * sync * sync to y * for PR * clang Co-authored-by: Daniel Jurek <[email protected]>
1 parent 90f1ff9 commit fc50c08

File tree

10 files changed

+95
-8
lines changed

10 files changed

+95
-8
lines changed

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"HRESULT",
7575
"IMDS",
7676
"Intel",
77+
"issecret",
7778
"itfactor",
7879
"iusg",
7980
"jepio",

cmake-modules/PerfTest.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
macro(SetPerfDeps PACKAGE VAR_RESULT)
2+
string(TOUPPER ${PACKAGE} SUFFIX)
3+
string(CONCAT VAR_TRIGGER "VCPKG-" ${SUFFIX})
4+
message(STATUS "trigger name ${VAR_TRIGGER}")
5+
if(DEFINED ENV{${VAR_TRIGGER}})
6+
find_package(${PACKAGE} $ENV{${VAR_TRIGGER}} EXACT)
7+
add_compile_definitions(${VAR_RESULT}="$ENV{${VAR_TRIGGER}}")
8+
else()
9+
add_compile_definitions(${VAR_RESULT}="source")
10+
endif()
11+
endmacro()

eng/pipelines/templates/jobs/perf.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ parameters:
2323
- name: EnvVars
2424
type: object
2525
default: []
26+
- name: InstallLanguageSteps
27+
type: object
28+
default: []
2629

2730
extends:
2831
template: /eng/common/pipelines/templates/jobs/perf.yml
@@ -38,8 +41,4 @@ extends:
3841
Iterations: ${{ parameters.Iterations }}
3942
AdditionalArguments: ${{ parameters.AdditionalArguments }}
4043
EnvVars: ${{ parameters.EnvVars}}
41-
InstallLanguageSteps:
42-
- template: /eng/pipelines/templates/steps/vcpkg.yml
43-
#/eng/pipelines/templates/steps/vcpkg-clone.yml
44-
parameters:
45-
RepoOwner: Microsoft
44+
InstallLanguageSteps: ${{ parameters.InstallLanguageSteps }}

sdk/core/perf.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ extends:
3030
Arguments: ${{ parameters.Arguments }}
3131
Iterations: ${{ parameters.Iterations }}
3232
AdditionalArguments: ${{ parameters.AdditionalArguments }}
33+
InstallLanguageSteps:
34+
- pwsh: |
35+
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"
36+
displayName: Set Vcpkg Variables
37+
38+
EnvVars:
39+
# This is set in the InstallLanguageSteps
40+
VCPKG_BINARY_SOURCES_SECRET: $(VCPKG_BINARY_SOURCES_SECRET)

sdk/core/perf/src/options.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ std::vector<Azure::Perf::TestOption> Azure::Perf::GlobalTestOptions::GetOptionMe
8585
{"Rate", {"-r", "--rate"}, "Target throughput (ops/sec). Default to no throughput.", 1},
8686
{"Warmup", {"-w", "--warmup"}, "Duration of warmup in seconds. Default to 5 seconds.", 1},
8787
{"TestProxies", {"-x", "--test-proxies"}, "URIs of TestProxy Servers (separated by ';')", 1},
88-
{"help", {"-h", "--help"}, "Display help information.", 0}};
88+
{"help", {"-h", "--help"}, "Display help information.", 0},
89+
{"Sync", {"-y", "--sync"}, "Runs sync version of test, not implemented", 0}};
8990
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
param baseName string = resourceGroup().name
2+
param location string = resourceGroup().location
3+
4+
resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = {
5+
name: '${baseName}blob'
6+
location: location
7+
kind: 'BlockBlobStorage'
8+
sku: {
9+
name: 'Premium_LRS'
10+
}
11+
}
12+
13+
var name = storageAccount.name
14+
var key = storageAccount.listKeys().keys[0].value
15+
var connectionString = 'DefaultEndpointsProtocol=https;AccountName=${name};AccountKey=${key}'
16+
17+
output AZURE_STORAGE_ACCOUNT_NAME string = name
18+
output AZURE_STORAGE_ACCOUNT_KEY string = key
19+
output AZURE_STORAGE_CONNECTION_STRING string = connectionString
20+
output STANDARD_STORAGE_CONNECTION_STRING string = connectionString
21+
output STORAGE_CONNECTION_STRING string = connectionString
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
parameters:
2+
- name: PackageVersions
3+
displayName: PackageVersions (regex of package versions to run)
4+
type: string
5+
default: '12|source'
6+
- name: Tests
7+
displayName: Tests (regex of tests to run)
8+
type: string
9+
default: '^(download|upload|list-blobs)$'
10+
- name: Arguments
11+
displayName: Arguments (regex of arguments to run)
12+
type: string
13+
default: '(10240)|(10485760)|(1073741824)|(5 )|(500 )|(50000 )'
14+
- name: Iterations
15+
displayName: Iterations (times to run each test)
16+
type: number
17+
default: '5'
18+
- name: AdditionalArguments
19+
displayName: AdditionalArguments (passed to PerfAutomation)
20+
type: string
21+
default: ' '
22+
23+
extends:
24+
template: /eng/pipelines/templates/jobs/perf.yml
25+
parameters:
26+
ServiceDirectory: storage/azure-storage-blobs
27+
Services: "^storage-blob$"
28+
PackageVersions: ${{ parameters.PackageVersions }}
29+
Tests: ${{ parameters.Tests }}
30+
Arguments: ${{ parameters.Arguments }}
31+
Iterations: ${{ parameters.Iterations }}
32+
AdditionalArguments: ${{ parameters.AdditionalArguments }}
33+
InstallLanguageSteps:
34+
- pwsh: |
35+
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"
36+
displayName: Set Vcpkg Variables
37+
38+
EnvVars:
39+
# This is set in the InstallLanguageSteps
40+
VCPKG_BINARY_SOURCES_SECRET: $(VCPKG_BINARY_SOURCES_SECRET)

sdk/storage/azure-storage-blobs/test/perf/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ cmake_minimum_required (VERSION 3.13)
66
project(azure-storage-blobs-perf LANGUAGES CXX)
77
set(CMAKE_CXX_STANDARD 14)
88
set(CMAKE_CXX_STANDARD_REQUIRED True)
9+
include(AzureVcpkg)
10+
az_vcpkg_integrate()
911

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

3638
create_per_service_target_build(storage azure-storage-blobs-perf)
3739

40+
include(PerfTest)
41+
SETPERFDEPS(azure-storage-blobs-cpp VCPKG_STORAGE_BLOB_VERSION)
3842
# Include the headers from the project.
3943
target_include_directories(
4044
azure-storage-blobs-perf
@@ -47,7 +51,8 @@ if (MSVC)
4751
target_compile_options(azure-storage-blobs-perf PUBLIC /wd4996)
4852
endif()
4953

54+
5055
# link the `azure-perf` lib together with any other library which will be used for the tests.
51-
target_link_libraries(azure-storage-blobs-perf PRIVATE azure-storage-blobs azure-perf)
56+
target_link_libraries(azure-storage-blobs-perf PRIVATE Azure::azure-storage-blobs azure-perf)
5257
# Make sure the project will appear in the test folder for Visual Studio CMake view
5358
set_target_properties(azure-storage-blobs-perf PROPERTIES FOLDER "Tests/Storage")

sdk/storage/azure-storage-blobs/test/perf/src/azure_storage_blobs_perf_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

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

2021
// Create the test list
2122
std::vector<Azure::Perf::TestMetadata> tests

vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"name": "opentelemetry-cpp",
18-
"platform": "!uwp",
18+
"platform": "!(windows & !static)",
1919
"version>=": "1.3.0"
2020
},
2121
{

0 commit comments

Comments
 (0)