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 8/4 #8

Merged
merged 52 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1d0e42b
[ServiceBus] Fix empty coroutines/Futures with async auto lock renewe…
yunhaoling Jul 27, 2021
65c1086
add basic ga tag w/ settable campaignid (#19945)
azure-sdk Jul 27, 2021
77a6281
Perftests for monitor query (#19941)
Jul 27, 2021
ffdb2b4
[QnA] Release prep (#19947)
annatisch Jul 27, 2021
19f5918
STG78 Preview (#18801)
tasherif-msft Jul 28, 2021
5b23cb5
Update livetest_folder_link.py (#19968)
RAY-316 Jul 28, 2021
f4455f8
[AutoRelease] t2-media-2021-07-15-32183 (#19811)
Jul 28, 2021
d238273
Verify API surface level against all approved revisions for GA releas…
azure-sdk Jul 28, 2021
ba67a6c
Allow Tox Environments to be Configured As Skippable via platform-mat…
scbedd Jul 28, 2021
d1f9f8a
extend regression time (#19967)
scbedd Jul 28, 2021
4192b56
[Fix]ChangeLog date format (#19973)
xiafu-msft Jul 28, 2021
ef54724
Refactor SharedTokenCacheCredential (#19914)
chlowell Jul 28, 2021
dd36ab2
Fix azure.identity.aio.AzureApplicationCredential import (#19961)
chlowell Jul 28, 2021
8228131
update to latest swagger 21-12-01 (#19982)
xiangyan99 Jul 28, 2021
f64daef
Fix Monitor Query SDK typos (#19980)
scottaddie Jul 29, 2021
2f8c931
[translation] update target container permissions (#19992)
kristapratico Jul 29, 2021
ccb706a
Move stress testing scripts to eng/common (#19994)
azure-sdk Jul 29, 2021
fa95a09
Edit pass on Monitor Query README file (#19979)
scottaddie Jul 29, 2021
97a6b81
add ga id to index (#19995)
scbedd Jul 29, 2021
05008ae
[AutoRelease] t2-batch-2021-07-30-27488 (#19996)
Jul 30, 2021
77fc6b4
[Batch] Data plane SDK v11.0.0 (#19889)
cRui861 Jul 30, 2021
e497463
Update CHANGELOG.md (#20006)
dpwatrous Jul 30, 2021
455b3a0
d2183715d380084ff04313a73c8803d042fe91b9 (#20009)
xiangyan99 Jul 30, 2021
ac60fb9
Rename query (#19952)
Jul 30, 2021
8926a2f
Add Logs Batch query results (#20013)
Jul 30, 2021
6878e8f
Minor changes in docs (#20016)
Jul 30, 2021
e9f8c6a
[AutoRelease] t2-storagecache-2021-07-29-63871 (#19987)
Aug 2, 2021
6771b32
[AutoRelease] t2-recoveryservicessiterecovery-2021-07-28-40357 (#19970)
Aug 2, 2021
0c2514a
Update PythonSdkLiveTest.yml (#19999)
BigCat20196 Aug 2, 2021
d427638
Update ci.yml (#20026)
RAY-316 Aug 2, 2021
a88809f
Update ci.yml (#20028)
RAY-316 Aug 2, 2021
9f110dd
cut hard dependency on requests (#19930)
xiangyan99 Aug 2, 2021
85cf69c
add sample for raw_response_hook (#19985)
xiangyan99 Aug 2, 2021
f94428c
Rename AZURE_POD_IDENTITY_TOKEN_URL -> AZURE_POD_IDENTITY_AUTHORITY_H…
chlowell Aug 2, 2021
d115e14
update version and changelog (#20034)
xiangyan99 Aug 2, 2021
6f688cc
`azure-applicationinsights` Hyperlinks need sphinx style formatting (…
scbedd Aug 2, 2021
1cf5632
Refine MVAD sample (#19737)
DavidZeLiang Aug 2, 2021
31c370f
[AutoRelease] t2-databricks-2021-08-02-64065 (#20029)
Aug 3, 2021
14f613e
[AutoRelease] t2-apimanagement-2021-08-03-81462 (#20052)
Aug 3, 2021
dfc4ead
[EventHubs] update import DictMixin from _mixin (#20041)
swathipil Aug 3, 2021
d681e2c
Synapse multiapi support for artifacts and vpn (#20046)
xiangyan99 Aug 3, 2021
2cb6357
Close session of ChallengePolicyClient in context manager (#20047)
xiangyan99 Aug 3, 2021
6b9ac65
[core] remove chardet dep from azure.core.rest (#19962)
iscai-msft Aug 3, 2021
19487ff
fix samples with renamed params (#20063)
kristapratico Aug 3, 2021
d01a468
Flatten the batch response (#20049)
Aug 3, 2021
9d4f5a6
[rest] add case insensitive headers test (#20067)
iscai-msft Aug 3, 2021
d5db098
update changelogs (#20070)
xiangyan99 Aug 3, 2021
ae6d87b
Add auto-merge to Version increment PR (#20072)
chidozieononiwu Aug 3, 2021
acf2264
CloudEvents/EG Events must recognize magic events (#19922)
Aug 4, 2021
2a927b2
[AutoRelease] t2-elastic-2021-08-04-63942 (#20077)
Aug 4, 2021
6585a10
Add custom JSONEncoder for model serialization (#19595)
mccoyp Aug 4, 2021
3d9c147
[AutoRelease] t2-quantum-2021-08-04-00093 (#20080)
Aug 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 19 additions & 9 deletions eng/common/docgeneration/Generate-DocIndex.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Get-BlobStorage-Artifacts($blobStorageUrl, $blobDirectoryRegex, $blobAr
$blobStorageUrlPageToken = $blobStorageUrl + "&marker=$pageToken"
$resp = Invoke-RestMethod -Method Get -Uri $blobStorageUrlPageToken
}
# Convert to xml documents.
# Convert to xml documents.
$xmlDoc = [xml](removeBomFromString $resp)
foreach ($elem in $xmlDoc.EnumerationResults.Blobs.BlobPrefix) {
# What service return like "dotnet/Azure.AI.Anomalydetector/", needs to fetch out "Azure.AI.Anomalydetector"
Expand All @@ -39,8 +39,8 @@ function Get-BlobStorage-Artifacts($blobStorageUrl, $blobDirectoryRegex, $blobAr
} while ($pageToken)
return $returnedArtifacts
}
# The sequence of Bom bytes differs by different encoding.

# The sequence of Bom bytes differs by different encoding.
# The helper function here is only to strip the utf-8 encoding system as it is used by blob storage list api.
# Return the original string if not in BOM utf-8 sequence.
function RemoveBomFromString([string]$bomAwareString) {
Expand All @@ -55,8 +55,8 @@ function RemoveBomFromString([string]$bomAwareString) {
}
return $bomAwareString
}
function Get-TocMapping {

function Get-TocMapping {
Param (
[Parameter(Mandatory = $true)] [Object[]] $metadata,
[Parameter(Mandatory = $true)] [String[]] $artifacts
Expand Down Expand Up @@ -87,10 +87,10 @@ function Get-TocMapping {
}
$orderServiceMapping[$artifact] = @($serviceName, $displayName)
}
return $orderServiceMapping
return $orderServiceMapping
}

function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) {
function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang, [String]$campaignId = "UA-62780441-46") {
LogDebug "Start generating the docfx toc and build docfx site..."

LogDebug "Initializing Default DocFx Site..."
Expand All @@ -100,6 +100,15 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) {
LogDebug "Copying template and configuration..."
New-Item -Path "${DocOutDir}" -Name "templates" -ItemType "directory" -Force
Copy-Item "${DocGenDir}/templates/*" -Destination "${DocOutDir}/templates" -Force -Recurse

$headerTemplateLocation = "${DocOutDir}/templates/matthews/partials/head.tmpl.partial"

if ($campaignId -and (Test-Path $headerTemplateLocation)){
$headerTemplateContent = Get-Content -Path $headerTemplateLocation -Raw
$headerTemplateContent = $headerTemplateContent -replace "GA_CAMPAIGN_ID", $campaignId
Set-Content -Path $headerTemplateLocation -Value $headerTemplateContent -NoNewline
}

Copy-Item "${DocGenDir}/docfx.json" -Destination "${DocOutDir}/" -Force
$YmlPath = "${DocOutDir}/api"
New-Item -Path $YmlPath -Name "toc.yml" -Force
Expand All @@ -109,7 +118,7 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) {
$artifact = $serviceMapping.Key
$serviceName = $serviceMapping.Value[0]
$displayName = $serviceMapping.Value[1]

$fileName = ($serviceName -replace '\s', '').ToLower().Trim()
if ($visitedService.ContainsKey($serviceName)) {
if ($displayName) {
Expand Down Expand Up @@ -145,7 +154,7 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) {
& $($DocFx) build "${DocOutDir}/docfx.json"
# The line below is used for testing in local
#docfx build "${DocOutDir}/docfx.json"
Copy-Item "${DocGenDir}/assets/logo.svg" -Destination "${DocOutDir}/_site/" -Force
Copy-Item "${DocGenDir}/assets/logo.svg" -Destination "${DocOutDir}/_site/" -Force
}

function UpdateDocIndexFiles {
Expand All @@ -166,6 +175,7 @@ function UpdateDocIndexFiles {
# Update main.js package regex and replacement
$mainJsContent = $mainJsContent -replace "var PACKAGE_REGEX = ''", "var PACKAGE_REGEX = $packageRegex"
$mainJsContent = $mainJsContent -replace "var PACKAGE_REPLACEMENT = ''", "var PACKAGE_REPLACEMENT = `"$regexReplacement`""

Set-Content -Path $MainJsPath -Value $mainJsContent -NoNewline
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
<meta name="generator" content="docfx {{_docfxVersion}}">
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
<link rel="shortcut icon" href="{{_rel}}{{{_appFaviconPath}}}{{^_appFaviconPath}}favicon.ico{{/_appFaviconPath}}">
<link rel="stylesheet" href="{{_rel}}styles/docfx.vendor.css">
<link rel="stylesheet" href="{{_rel}}styles/docfx.css">
<link rel="stylesheet" href="{{_rel}}styles/main.css">
<meta property="docfx:navrel" content="{{_navRel}}">
<meta property="docfx:tocrel" content="{{_tocRel}}">
{{#_noindex}}<meta name="searchOption" content="noindex">{{/_noindex}}
{{#_enableSearch}}<meta property="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
{{#_enableNewTab}}<meta property="docfx:newtab" content="true">{{/_enableNewTab}}

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_CAMPAIGN_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'GA_CAMPAIGN_ID');
</script>
</head>
16 changes: 14 additions & 2 deletions eng/common/scripts/Create-APIReview.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Param (
)

# Submit API review request and return status whether current revision is approved or pending or failed to create review
function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel)
function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel, $releaseStatus)
{
$multipartContent = [System.Net.Http.MultipartFormDataContent]::new()
$FileStream = [System.IO.FileStream]::new($filePath, [System.IO.FileMode]::Open)
Expand All @@ -33,6 +33,17 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel)
$StringContent = [System.Net.Http.StringContent]::new($apiLabel)
$StringContent.Headers.ContentDisposition = $stringHeader
$multipartContent.Add($stringContent)
Write-Host "Request param, label: $apiLabel"

if ($releaseStatus -and ($releaseStatus -ne "Unreleased"))
{
$compareAllParam = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data")
$compareAllParam.Name = "compareAllRevisions"
$compareAllParamContent = [System.Net.Http.StringContent]::new($true)
$compareAllParamContent.Headers.ContentDisposition = $compareAllParam
$multipartContent.Add($compareAllParamContent)
Write-Host "Request param, compareAllRevisions: true"
}

$headers = @{
"ApiKey" = $apiKey;
Expand Down Expand Up @@ -103,13 +114,14 @@ if ($packages)

Write-Host "Version: $($version)"
Write-Host "SDK Type: $($pkgInfo.SdkType)"
Write-Host "Release Status: $($pkgInfo.ReleaseStatus)"

# Run create review step only if build is triggered from main branch or if version is GA.
# This is to avoid invalidating review status by a build triggered from feature branch
if ( ($SourceBranch -eq $DefaultBranch) -or (-not $version.IsPrerelease))
{
Write-Host "Submitting API Review for package $($pkg)"
$respCode = Submit-APIReview -packagename $pkg -filePath $pkgPath -uri $APIViewUri -apiKey $APIKey -apiLabel $APILabel
$respCode = Submit-APIReview -packagename $pkg -filePath $pkgPath -uri $APIViewUri -apiKey $APIKey -apiLabel $APILabel -releaseStatus $pkgInfo.ReleaseStatus
Write-Host "HTTP Response code: $($respCode)"
# HTTP status 200 means API is in approved status
if ($respCode -eq '200')
Expand Down
174 changes: 174 additions & 0 deletions eng/common/scripts/stress-testing/deploy-stress-tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
[CmdletBinding(DefaultParameterSetName = 'Default')]
param(
[string]$SearchDirectory,
[hashtable]$Filters,
[string]$Environment,
[string]$Repository,
[switch]$PushImages,
[string]$ClusterGroup,
[string]$DeployId,

[Parameter(ParameterSetName = 'DoLogin', Mandatory = $true)]
[switch]$Login,

[Parameter(ParameterSetName = 'DoLogin')]
[string]$Subscription
)

$ErrorActionPreference = 'Stop'

. $PSScriptRoot/find-all-stress-packages.ps1
$FailedCommands = New-Object Collections.Generic.List[hashtable]

if (!(Get-Module powershell-yaml)) {
Install-Module -Name powershell-yaml -RequiredVersion 0.4.1 -Force -Scope CurrentUser
}

# Powershell does not (at time of writing) treat exit codes from external binaries
# as cause for stopping execution, so do this via a wrapper function.
# See https://github.com/PowerShell/PowerShell-RFC/pull/277
function Run() {
Write-Host "`n==> $args`n" -ForegroundColor Green
$command, $arguments = $args
& $command $arguments
if ($LASTEXITCODE) {
Write-Error "Command '$args' failed with code: $LASTEXITCODE" -ErrorAction 'Continue'
$FailedCommands.Add(@{ command = "$args"; code = $LASTEXITCODE })
}
}

function RunOrExitOnFailure() {
run @args
if ($LASTEXITCODE) {
exit $LASTEXITCODE
}
}

function Login([string]$subscription, [string]$clusterGroup, [boolean]$pushImages) {
Write-Host "Logging in to subscription, cluster and container registry"
az account show *> $null
if ($LASTEXITCODE) {
RunOrExitOnFailure az login --allow-no-subscriptions
}

$clusterName = (az aks list -g $clusterGroup -o json| ConvertFrom-Json).name

RunOrExitOnFailure az aks get-credentials `
-n "$clusterName" `
-g "$clusterGroup" `
--subscription "$subscription" `
--overwrite-existing

if ($pushImages) {
$registry = (az acr list -g $clusterGroup -o json | ConvertFrom-Json).name
RunOrExitOnFailure az acr login -n $registry
}
}

function DeployStressTests(
[string]$searchDirectory = '.',
[hashtable]$filters = @{},
[string]$environment = 'test',
[string]$repository = 'images',
[boolean]$pushImages = $false,
[string]$clusterGroup = 'rg-stress-test-cluster-',
[string]$deployId = 'local',
[string]$subscription = 'Azure SDK Test Resources'
) {
if ($PSCmdlet.ParameterSetName -eq 'DoLogin') {
Login $subscription $clusterGroup $pushImages
}

RunOrExitOnFailure helm repo add stress-test-charts https://stresstestcharts.blob.core.windows.net/helm/
Run helm repo update
if ($LASTEXITCODE) { return $LASTEXITCODE }

$pkgs = FindStressPackages $searchDirectory $filters
Write-Host "" "Found $($pkgs.Length) stress test packages:"
Write-Host $pkgs.Directory ""
foreach ($pkg in $pkgs) {
Write-Host "Deploying stress test at '$($pkg.Directory)'"
DeployStressPackage $pkg $deployId $environment $repository $pushImages
}

Write-Host "Releases deployed by $deployId"
Run helm list --all-namespaces -l deployId=$deployId

if ($FailedCommands) {
Write-Warning "The following commands failed:"
foreach ($cmd in $FailedCommands) {
Write-Error "'$($cmd.command)' failed with code $($cmd.code)" -ErrorAction 'Continue'
}
exit 1
}
}

function DeployStressPackage(
[object]$pkg,
[string]$deployId,
[string]$environment,
[string]$repository,
[boolean]$pushImages
) {
$registry = (az acr list -g $clusterGroup -o json | ConvertFrom-Json).name
if (!$registry) {
Write-Host "Could not find container registry in resource group $clusterGroup"
exit 1
}

if ($pushImages) {
Run helm dependency update $pkg.Directory
if ($LASTEXITCODE) { return $LASTEXITCODE }

$dockerFiles = Get-ChildItem "$($pkg.Directory)/Dockerfile*"
foreach ($dockerFile in $dockerFiles) {
# Infer docker image name from parent directory name, if file is named `Dockerfile`
# or from suffix, is file is named like `Dockerfile.myimage` (for multiple dockerfiles).
$prefix, $imageName = $dockerFile.Name.Split(".")
if (!$imageName) {
$imageName = $dockerFile.Directory.Name
}
$imageTag = "${registry}.azurecr.io/$($repository.ToLower())/$($imageName):$deployId"
Write-Host "Building and pushing stress test docker image '$imageTag'"
Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName
if ($LASTEXITCODE) { return $LASTEXITCODE }
Run docker push $imageTag
if ($LASTEXITCODE) {
if ($PSCmdlet.ParameterSetName -ne 'DoLogin') {
Write-Warning "If docker push is failing due to authentication issues, try calling this script with '-Login'"
}
return $LASTEXITCODE
}
}
}

Write-Host "Creating namespace $($pkg.Namespace) if it does not exist..."
kubectl create namespace $pkg.Namespace --dry-run=client -o yaml | kubectl apply -f -

Write-Host "Installing or upgrading stress test $($pkg.ReleaseName) from $($pkg.Directory)"
Run helm upgrade $pkg.ReleaseName $pkg.Directory `
-n $pkg.Namespace `
--install `
--set repository=$registry.azurecr.io/$repository `
--set tag=$deployId `
--set stress-test-addons.env=$environment
if ($LASTEXITCODE) {
# Issues like 'UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress'
# can be the result of cancelled `upgrade` operations (e.g. ctrl-c).
# See https://github.com/helm/helm/issues/4558
Write-Warning "The issue may be fixable by first running 'helm rollback -n $($pkg.Namespace) $($pkg.ReleaseName)'"
return $LASTEXITCODE
}

# Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around
# specific releases (thereby enabling filtering on `helm list`) is to label the underlying secret resources.
# There is not currently support for setting these labels via the helm cli.
$helmReleaseConfig = kubectl get secrets `
-n $pkg.Namespace `
-l status=deployed,name=$($pkg.ReleaseName) `
-o jsonpath='{.items[0].metadata.name}'

Run kubectl label secret -n $pkg.Namespace --overwrite $helmReleaseConfig deployId=$deployId
}

DeployStressTests @PSBoundParameters
53 changes: 53 additions & 0 deletions eng/common/scripts/stress-testing/find-all-stress-packages.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
param(
[string]$searchDirectory = '.',
[hashtable]$filters = @{}
)

class StressTestPackageInfo {
[string]$Namespace
[string]$Directory
[string]$ReleaseName
}

function FindStressPackages([string]$directory, [hashtable]$filters = @{}) {
# Bare minimum filter for stress tests
$filters['stressTest'] = 'true'

$packages = @()
$chartFiles = Get-ChildItem -Recurse -Filter 'Chart.yaml' $directory
foreach ($chartFile in $chartFiles) {
$chart = ParseChart $chartFile
if (matchesAnnotations $chart $filters) {
$packages += NewStressTestPackageInfo $chart $chartFile
}
}

return $packages
}

function ParseChart([string]$chartFile) {
return ConvertFrom-Yaml (Get-Content -Raw $chartFile)
}

function MatchesAnnotations([hashtable]$chart, [hashtable]$filters) {
foreach ($filter in $filters.GetEnumerator()) {
if (!$chart.annotations -or $chart.annotations[$filter.Key] -ne $filter.Value) {
return $false
}
}

return $true
}

function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartFile) {
return [StressTestPackageInfo]@{
Namespace = $chart.annotations.namespace
Directory = $chartFile.DirectoryName
ReleaseName = $chart.name
}
}

# Don't call functions when the script is being dot sourced
if ($MyInvocation.InvocationName -ne ".") {
FindStressPackages $searchDirectory $filters
}
Loading