Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 5 additions & 36 deletions sdk/eventhubs/azure-messaging-eventhubs-stress/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,11 @@
ARG REGISTRY="azsdkengsys.azurecr.io"
FROM ${REGISTRY}/java/jdk-mariner-mvn:jdk11-latest AS builder

RUN yum update -y

RUN mkdir /stress-eh
WORKDIR /stress-eh

ADD ./.vscode /stress-eh/.vscode
ADD ./sdk/tools /stress-eh/sdk/tools
ADD ./sdk/parents /stress-eh/sdk/parents
ADD ./sdk/core /stress-eh/sdk/core
ADD ./sdk/monitor /stress-eh/sdk/monitor
ADD ./sdk/eventhubs /stress-eh/sdk/eventhubs
ADD ./eng /stress-eh/eng

ARG SKIP_CHECKS="-Dcheckstyle.skip -Dgpg.skip -Dmaven.javadoc.skip -Drevapi.skip -Dspotbugs.skip -Djacoco.skip -Dmaven.test.skip -Dcodesnippet.skip -Dspotless.skip"

RUN --mount=type=cache,target=/root/.m2 \
mvn -f /stress-eh/sdk/tools/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/core/azure-core/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/core/azure-core-http-netty/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/core/azure-core-http-okhttp/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/core/azure-core-http-vertx/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/core/azure-core-http-jdk-httpclient/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/core/azure-core-test/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/core/azure-core-amqp/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/core/azure-core-http-netty/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/eventhubs/azure-messaging-eventhubs/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml clean install ${SKIP_CHECKS} && \
mvn -f /stress-eh/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml clean install ${SKIP_CHECKS}

FROM mcr.microsoft.com/openjdk/jdk:21-mariner

RUN yum update -y

WORKDIR /app
COPY --from=builder /stress-eh/sdk/eventhubs/azure-messaging-eventhubs-stress/target .

# Copy the jar files built by New-StressTestRun.ps1 to the container.
COPY ./target .

RUN ls /app/azure-messaging-eventhubs-stress* >/dev/null 2>&1 || (echo "ERROR: no file starting with azure-messaging-eventhubs-stress was copied to /app." && exit 1)

# This is never executed (since job yaml overrides it)
ENTRYPOINT ["bash"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<#
.DESCRIPTION
This script compiles the stress test module, optionally performs Azure login, and deploys
the Event Hubs stress tests with the provided namespace and environment.

.PARAMETER Namespace
The namespace in AKS for the stress test run. This is a required parameter.

.PARAMETER Environment
The stress deployment environment name. Defaults to "storage".

.PARAMETER SkipCompile
Skips the Maven compile/install step when specified.

.PARAMETER SkipLogin
Skips the Azure CLI login step when specified.

.EXAMPLE
./New-StressTestRun.ps1 -Namespace stress-test-namespace

Builds the stress module, signs in to Azure, and deploys using the default environment.
#>
param(
[Parameter(Mandatory = $true)]
[string]$Namespace,

[Parameter()]
[string]$Environment = "storage",

[Parameter()]
[switch]$SkipCompile,

[Parameter()]
[switch]$SkipLogin
)

$ErrorActionPreference = "Stop"

if ([string]::IsNullOrWhiteSpace($Environment)) {
throw "Environment is required"
}

$scriptDir = $PSScriptRoot
Set-Location $scriptDir

if ($SkipCompile) {
Write-Host "Skipping compile step"
} else {
mvn clean install --% -am -pl com.azure:azure-messaging-eventhubs-stress -Dcheckstyle.skip -Dgpg.skip -Dmaven.javadoc.skip -Drevapi.skip -Dspotbugs.skip -Djacoco.skip -Dmaven.test.skip -Dcodesnippet.skip -Dspotless.skip
}

if ($SkipLogin) {
Write-Host "Skipping login step"
} else {
az login --scope https://management.core.windows.net//.default
}

try {
$resolvedDeployScript = Resolve-Path (Join-Path $PSScriptRoot "../../../eng/common/scripts/stress-testing/deploy-stress-tests.ps1")
} catch {
throw "Unable to find deploy script relative to $PSScriptRoot"
}

$resolvedDeployScript = $resolvedDeployScript.Path
& $resolvedDeployScript -Namespace $Namespace -Environment $Environment
Loading