From 9b2c75492ef7e0dc977a258637328dbc1b11f4b6 Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Fri, 30 Jul 2021 07:37:47 -0400 Subject: [PATCH 1/2] Deploy for stress tests at resource group scope --- eng/common/scripts/stress-testing/deploy-stress-tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index 1d8d958a2cd0..c95b0ebbd9b7 100644 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -116,8 +116,9 @@ function DeployStressPackage( exit 1 } + Run helm dependency update $pkg.Directory + if ($pushImages) { - Run helm dependency update $pkg.Directory if ($LASTEXITCODE) { return $LASTEXITCODE } $dockerFiles = Get-ChildItem "$($pkg.Directory)/Dockerfile*" From b49d06e578180541f6f03b8aa550ce9245f3f0ee Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Tue, 10 Aug 2021 13:26:54 -0400 Subject: [PATCH 2/2] Automatically compile bicep files in stress test deploy script --- .../scripts/stress-testing/deploy-stress-tests.ps1 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index c95b0ebbd9b7..25af8c9edd72 100644 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -117,10 +117,14 @@ function DeployStressPackage( } Run helm dependency update $pkg.Directory + if ($LASTEXITCODE) { return } - if ($pushImages) { - if ($LASTEXITCODE) { return $LASTEXITCODE } + if (Test-Path "$($pkg.Directory)/test-resources.bicep") { + Run az bicep build -f "$($pkg.Directory)/test-resources.bicep" + if ($LASTEXITCODE) { return } + } + if ($pushImages) { $dockerFiles = Get-ChildItem "$($pkg.Directory)/Dockerfile*" foreach ($dockerFile in $dockerFiles) { # Infer docker image name from parent directory name, if file is named `Dockerfile` @@ -132,13 +136,13 @@ function DeployStressPackage( $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 } + if ($LASTEXITCODE) { return } 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 + return } } } @@ -158,7 +162,7 @@ function DeployStressPackage( # 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 + return } # Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around