Skip to content

Commit ff97795

Browse files
authored
[release/8.0] Backport improvements to Http and Ssl stress tests (#122141)
1 parent 2118a1a commit ff97795

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+857
-797
lines changed

eng/docker/build-docker-sdk.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ Param(
99
[switch][Alias('w')]$buildWindowsContainers
1010
)
1111

12-
$dotNetVersion="8.0"
1312
$ErrorActionPreference = "Stop"
1413

1514
$REPO_ROOT_DIR=$(git -C "$PSScriptRoot" rev-parse --show-toplevel)
15+
[xml]$xml = Get-Content (Join-Path $REPO_ROOT_DIR "eng\Versions.props")
16+
$VERSION="$($xml.Project.PropertyGroup.MajorVersion[0]).$($xml.Project.PropertyGroup.MinorVersion[0])"
1617

1718
$dockerFilePrefix="$PSScriptRoot/libraries-sdk"
1819

@@ -29,7 +30,7 @@ if ($buildWindowsContainers)
2930
}
3031

3132
$dockerFile="$dockerFilePrefix.windows.Dockerfile"
32-
33+
3334
# Collect the following artifacts to folder, that will be used as build context for the container,
3435
# so projects can build and test against the live-built runtime:
3536
# 1. Reference assembly pack (microsoft.netcore.app.ref)
@@ -54,15 +55,16 @@ if ($buildWindowsContainers)
5455
-Destination $dockerContext\targetingpacks.targets
5556
Copy-Item -Recurse -Path $REPO_ROOT_DIR\src\libraries\System.Net.Quic\src\System\Net\Quic\Interop `
5657
-Destination $dockerContext\msquic-interop
57-
58+
5859
# In case of non-CI builds, testhost may already contain Microsoft.AspNetCore.App (see build-local.ps1 in HttpStress):
59-
$testHostAspNetCorePath="$dockerContext\testhost\net$dotNetVersion-windows-$configuration-x64/shared/Microsoft.AspNetCore.App"
60+
$testHostAspNetCorePath="$dockerContext\testhost\net$VERSION-windows-$configuration-x64/shared/Microsoft.AspNetCore.App"
6061
if (Test-Path $testHostAspNetCorePath) {
6162
Remove-Item -Recurse -Force $testHostAspNetCorePath
6263
}
63-
64+
6465
docker build --tag $imageName `
6566
--build-arg CONFIGURATION=$configuration `
67+
--build-arg VERSION=$VERSION `
6668
--file $dockerFile `
6769
$dockerContext
6870
}
@@ -73,6 +75,7 @@ else
7375

7476
docker build --tag $imageName `
7577
--build-arg CONFIGURATION=$configuration `
78+
--build-arg "VERSION=$VERSION" `
7679
--file $dockerFile `
7780
$REPO_ROOT_DIR
7881
}

eng/docker/build-docker-sdk.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
2323

2424
imagename="dotnet-sdk-libs-current"
2525
configuration="Release"
26+
repo_root=$(git -C "$scriptroot" rev-parse --show-toplevel)
27+
major_version=$(grep -oP '(?<=<MajorVersion>).*?(?=</MajorVersion>)' "$repo_root/eng/Versions.props")
28+
minor_version=$(grep -oP '(?<=<MinorVersion>).*?(?=</MinorVersion>)' "$repo_root/eng/Versions.props")
29+
version="$major_version.$minor_version"
2630

27-
while [[ $# > 0 ]]; do
31+
while [[ $# -gt 0 ]]; do
2832
opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")"
2933
case "$opt" in
3034
-imagename|-t)
@@ -41,12 +45,12 @@ while [[ $# > 0 ]]; do
4145
esac
4246
done
4347

44-
repo_root=$(git rev-parse --show-toplevel)
4548
docker_file="$scriptroot/libraries-sdk.linux.Dockerfile"
4649

4750
docker build --tag $imagename \
4851
--build-arg CONFIGURATION=$configuration \
52+
--build-arg VERSION=$version \
4953
--file $docker_file \
5054
$repo_root
5155

52-
exit $?
56+
exit $?

eng/docker/libraries-sdk.linux.Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Builds and copies library artifacts into target dotnet sdk image
22
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8
3-
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:7.0-bullseye-slim
3+
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:latest
44

55
FROM $BUILD_BASE_IMAGE as corefxbuild
66

@@ -12,12 +12,15 @@ RUN ./build.sh clr+libs -runtimeconfiguration Release -configuration $CONFIGURAT
1212

1313
FROM $SDK_BASE_IMAGE as target
1414

15-
ARG VERSION=8.0
15+
ARG VERSION
1616
ARG CONFIGURATION=Release
1717
ENV _DOTNET_INSTALL_CHANNEL=$VERSION
1818

19+
# remove the existing SDK, we want to start from a clean slate with latest daily
20+
RUN rm -rf /usr/share/dotnet
21+
1922
# Install latest daily SDK:
20-
RUN wget https://dot.net/v1/dotnet-install.sh
23+
RUN wget https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh
2124
RUN bash ./dotnet-install.sh --channel $_DOTNET_INSTALL_CHANNEL --quality daily --install-dir /usr/share/dotnet
2225

2326
# Collect the following artifacts under /live-runtime-artifacts,
@@ -48,8 +51,8 @@ COPY --from=corefxbuild \
4851
/repo/src/libraries/System.Net.Quic/src/System/Net/Quic/Interop \
4952
/live-runtime-artifacts/msquic-interop
5053

51-
# Add AspNetCore bits to testhost:
52-
ENV _ASPNETCORE_SOURCE="/usr/share/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*"
54+
# Add AspNetCore bits to testhost, there should be only one version since we started from an image without existing SDK:
55+
ENV _ASPNETCORE_SOURCE="/usr/share/dotnet/shared/Microsoft.AspNetCore.App/*"
5356
ENV _ASPNETCORE_DEST="/live-runtime-artifacts/testhost/net$VERSION-linux-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App"
5457
RUN mkdir -p $_ASPNETCORE_DEST
5558
RUN cp -r $_ASPNETCORE_SOURCE $_ASPNETCORE_DEST
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# escape=`
22
# Simple Dockerfile which copies clr and library build artifacts into target dotnet sdk image
3-
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:7.0-nanoserver-ltsc2022
3+
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:8.0-nanoserver-ltsc2022
44
FROM $SDK_BASE_IMAGE as target
55

66
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
@@ -11,15 +11,18 @@ ARG CONFIGURATION=Release
1111

1212
USER ContainerAdministrator
1313

14-
RUN Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile .\dotnet-install.ps1
14+
# remove the existing ASP.NET SDK, we want to keep only the latest one we download later
15+
RUN Remove-Item -Force -Recurse 'C:/Program Files/dotnet/shared/Microsoft.AspNetCore.App/*'
16+
17+
RUN Invoke-WebRequest -Uri https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1 -OutFile .\dotnet-install.ps1
1518
RUN & .\dotnet-install.ps1 -Channel $env:_DOTNET_INSTALL_CHANNEL -Quality daily -InstallDir 'C:/Program Files/dotnet'
1619

1720
USER ContainerUser
1821

1922
COPY . /live-runtime-artifacts
2023

2124
# Add AspNetCore bits to testhost:
22-
ENV _ASPNETCORE_SOURCE="C:/Program Files/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*"
25+
ENV _ASPNETCORE_SOURCE="C:/Program Files/dotnet/shared/Microsoft.AspNetCore.App/*"
2326
ENV _ASPNETCORE_DEST="C:/live-runtime-artifacts/testhost/net$VERSION-windows-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App"
2427
RUN & New-Item -ItemType Directory -Path $env:_ASPNETCORE_DEST
2528
RUN Copy-Item -Recurse -Path $env:_ASPNETCORE_SOURCE -Destination $env:_ASPNETCORE_DEST

eng/pipelines/libraries/stress/http.yml

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ schedules:
1212
branches:
1313
include:
1414
- main
15+
- release/*.0
1516
- release/*-staging
1617

1718
variables:
@@ -35,6 +36,7 @@ extends:
3536
timeoutInMinutes: 240
3637
variables:
3738
DUMPS_SHARE_MOUNT_ROOT: "/dumps-share"
39+
DUMPS_SHARE: "$(Build.ArtifactStagingDirectory)/dumps/"
3840
pool:
3941
name: $(DncEngPublicBuildPool)
4042
demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open
@@ -58,32 +60,29 @@ extends:
5860
5961
- bash: |
6062
cd '$(httpStressProject)'
61-
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
62-
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
63-
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0"
64-
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
63+
export STRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0"
64+
export STRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
65+
mkdir -p $DUMPS_SHARE
6566
docker-compose up --abort-on-container-exit --no-color
6667
timeoutInMinutes: 35 # In case the HTTP/3.0 run hangs, we timeout shortly after the expected 30 minute run
6768
displayName: Run HttpStress - HTTP 3.0
6869
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
6970
7071
- bash: |
7172
cd '$(httpStressProject)'
72-
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/2.0"
73-
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/2.0"
74-
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 2.0"
75-
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 2.0"
73+
export STRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 2.0"
74+
export STRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 2.0"
75+
mkdir -p $DUMPS_SHARE
7676
docker-compose down
7777
docker-compose up --abort-on-container-exit --no-color
7878
displayName: Run HttpStress - HTTP 2.0
7979
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
8080
8181
- bash: |
8282
cd '$(httpStressProject)'
83-
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/1.1"
84-
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/1.1"
85-
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 1.1"
86-
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 1.1"
83+
export STRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 1.1"
84+
export STRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 1.1"
85+
mkdir -p $DUMPS_SHARE
8786
docker-compose down
8887
docker-compose up --abort-on-container-exit --no-color
8988
displayName: Run HttpStress - HTTP 1.1
@@ -103,12 +102,7 @@ extends:
103102
timeoutInMinutes: 150
104103
variables:
105104
DUMPS_SHARE_MOUNT_ROOT: "C:/dumps-share"
106-
107-
# The 1es-windows-2022-open image has an issue where the Chocolatey-installed V1 docker-compose takes precendence over the
108-
# V2 docker-compose required by the stress tests, see: https://github.com/actions/runner-images/issues/7080
109-
# This is worked around by handpicking the V2 executable.
110-
# The workaround should be removed when the official fix is propagated into 1es-windows-2022-open, or when we switch to another image.
111-
DOCKER_COMPOSE_CMD: "C:/ProgramData/docker/cli-plugins/docker-compose.exe"
105+
DUMPS_SHARE: "$(Build.ArtifactStagingDirectory)/dumps/"
112106
pool:
113107
name: $(DncEngPublicBuildPool)
114108
demands: ImageOverride -equals 1es-windows-2022-open
@@ -120,19 +114,12 @@ extends:
120114
lfs: false
121115

122116
- powershell: |
123-
# Workaround for https://github.com/microsoft/azure-pipelines-agent/issues/4554. Undo when the image bug is fixed.
124-
Remove-Item -Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCToolsVersion.v143.default.txt"
125-
126117
$(dockerfilesFolder)/build-docker-sdk.ps1 -w -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
127118
echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
128119
name: buildRuntime
129120
displayName: Build CLR and Libraries
130121
131122
- powershell: |
132-
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/"
133-
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/"
134-
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
135-
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
136123
$(httpStressProject)/run-docker-compose.ps1 -w -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
137124
echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
138125
name: buildStress
@@ -147,37 +134,28 @@ extends:
147134
148135
- powershell: |
149136
cd '$(httpStressProject)'
150-
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
151-
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
152-
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
153-
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
154-
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 3.0"
155-
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 3.0"
156-
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
137+
$env:STRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 3.0"
138+
$env:STRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 3.0"
139+
New-Item -Force $env:DUMPS_SHARE -ItemType Directory
140+
docker compose up --abort-on-container-exit --no-color
157141
displayName: Run HttpStress - HTTP 3.0
158142
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
159143
160144
- powershell: |
161145
cd '$(httpStressProject)'
162-
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/2.0"
163-
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/2.0"
164-
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
165-
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
166-
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 2.0"
167-
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 2.0"
168-
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
146+
$env:STRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 2.0"
147+
$env:STRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 2.0"
148+
New-Item -Force $env:DUMPS_SHARE -ItemType Directory
149+
docker compose up --abort-on-container-exit --no-color
169150
displayName: Run HttpStress - HTTP 2.0
170151
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
171152
172153
- powershell: |
173154
cd '$(httpStressProject)'
174-
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/1.1"
175-
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/1.1"
176-
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
177-
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
178-
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 1.1"
179-
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 1.1"
180-
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
155+
$env:STRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 1.1"
156+
$env:STRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 1.1"
157+
New-Item -Force $env:DUMPS_SHARE -ItemType Directory
158+
docker compose up --abort-on-container-exit --no-color
181159
displayName: Run HttpStress - HTTP 1.1
182160
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
183161

eng/pipelines/libraries/stress/ssl.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ schedules:
1212
branches:
1313
include:
1414
- main
15+
- release/*.0
1516
- release/*-staging
1617

1718
variables:
@@ -34,6 +35,9 @@ extends:
3435
- job: linux
3536
displayName: Docker Linux
3637
timeoutInMinutes: 120
38+
variables:
39+
DUMPS_SHARE_MOUNT_ROOT: "/dumps-share"
40+
DUMPS_SHARE: "$(Build.ArtifactStagingDirectory)/dumps/"
3741
pool:
3842
name: $(DncEngPublicBuildPool)
3943
demands: ImageOverride -equals Build.Ubuntu.2204.Amd64.Open
@@ -53,31 +57,32 @@ extends:
5357
5458
- bash: |
5559
cd '$(sslStressProject)'
60+
export STRESS_CLIENT_ARGS=$SSLSTRESS_CLIENT_ARGS
61+
export STRESS_SERVER_ARGS=$SSLSTRESS_SERVER_ARGS
62+
mkdir -p $DUMPS_SHARE
5663
docker-compose up --abort-on-container-exit --no-color
5764
displayName: Run SslStress
5865
66+
- publish: $(Build.ArtifactStagingDirectory)/dumps
67+
artifact: DumpsLinux
68+
condition: failed()
69+
5970
- job: windows
6071
displayName: Docker NanoServer
6172
timeoutInMinutes: 120
6273
pool:
6374
name: $(DncEngPublicBuildPool)
6475
demands: ImageOverride -equals 1es-windows-2022-open
6576
variables:
66-
# The 1es-windows-2022-open image has an issue where the Chocolatey-installed V1 docker-compose takes precendence over the
67-
# V2 docker-compose required by the stress tests, see: https://github.com/actions/runner-images/issues/7080
68-
# This is worked around by handpicking the V2 executable.
69-
# The workaround should be removed when the official fix is propagated into 1es-windows-2022-open, or when we switch to another image.
70-
DOCKER_COMPOSE_CMD: "C:/ProgramData/docker/cli-plugins/docker-compose.exe"
77+
DUMPS_SHARE_MOUNT_ROOT: "C:/dumps-share"
78+
DUMPS_SHARE: "$(Build.ArtifactStagingDirectory)/dumps/"
7179
steps:
7280
- checkout: self
7381
clean: true
7482
fetchDepth: 5
7583
lfs: false
7684

7785
- powershell: |
78-
# Workaround for https://github.com/microsoft/azure-pipelines-agent/issues/4554. Undo when the image bug is fixed.
79-
Remove-Item -Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCToolsVersion.v143.default.txt"
80-
8186
$(dockerfilesFolder)/build-docker-sdk.ps1 -w -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
8287
displayName: Build CLR and Libraries
8388
@@ -87,5 +92,12 @@ extends:
8792
8893
- powershell: |
8994
cd '$(sslStressProject)'
90-
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
95+
$env:STRESS_CLIENT_ARGS = $env:SSLSTRESS_CLIENT_ARGS
96+
$env:STRESS_SERVER_ARGS = $env:SSLSTRESS_SERVER_ARGS
97+
New-Item -Force $env:DUMPS_SHARE -ItemType Directory
98+
docker compose up --abort-on-container-exit --no-color
9199
displayName: Run SslStress
100+
101+
- publish: $(Build.ArtifactStagingDirectory)/dumps
102+
artifact: DumpsWindows
103+
condition: failed()

0 commit comments

Comments
 (0)