Skip to content

Networking stress tests moved out of Hosted pool #35011

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6bded78
Networking stress tests moved out of Hosted pool
alnikola Apr 15, 2020
3659662
Provide Unix scripts for stress builds
safern Apr 15, 2020
1f87033
Fix build
safern Apr 15, 2020
94d95e1
Use powershell on windows, chmod +x bash script
safern Apr 16, 2020
3c8576d
Bring useWindowsContainers option back to ps scripts
safern Apr 16, 2020
c518a46
Fix syntax error
safern Apr 16, 2020
9c98c11
Fixed file description
alnikola Apr 20, 2020
831afd8
Fixed file description
alnikola Apr 20, 2020
a02d3f9
Force checks re-run
alnikola May 12, 2020
5f7db6a
Fix clr subset name on Linux
alnikola May 12, 2020
65bcc70
Fix clr subset name on Windows
alnikola May 12, 2020
cb89412
Restore accidentally removed libs subset
alnikola May 12, 2020
67f29cd
Build only runtime and CoreLib of CLR on Windows
alnikola May 12, 2020
a8d4abf
Build only runtime and CoreLib of CLR on Linux
alnikola May 12, 2020
5a564a4
Remove trailing whitespace
alnikola May 12, 2020
272b7ee
Merge branch 'master' into alnikola/move-net-stress-tests-to-win-pool
alnikola May 14, 2020
d22257a
Use Server pools and build with clr+libs
safern Jun 1, 2020
02b1ca3
Fix build
safern Jun 2, 2020
d42bec4
Added missing run-docker-compose.sh to SslStress
alnikola Jun 11, 2020
0d4b0fd
Move libraries build to the host OS on Linux
alnikola Jun 16, 2020
dd37363
Merge branch 'master' into alnikola/move-net-stress-tests-to-win-pool
alnikola Jun 16, 2020
8078a27
Set TFM to net5.0 in libraries-sdk.linux.Dockerfile
alnikola Jun 16, 2020
a39e3ef
Set TFM net5.0 in libraries-sdk-aspnetcore.linux.Dockerfile
alnikola Jun 16, 2020
bf9065f
Update stress tests to .NET 5.0 SDK images
alnikola Jun 16, 2020
e90b565
Runtime build moved back into Linux container
alnikola Jun 17, 2020
a130d74
- TFM set to .net5.0
alnikola Jun 17, 2020
19a9429
Chmod +x run-docker-compose.sh
alnikola Jun 18, 2020
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
**/*.obj
**/*.pch
**/*.pdb
!**/_.pdb
**/*.pgc
**/*.pgd
**/*.rsp
Expand Down
54 changes: 25 additions & 29 deletions eng/docker/build-docker-sdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,42 @@ $ErrorActionPreference = "Stop"

$REPO_ROOT_DIR=$(git -C "$PSScriptRoot" rev-parse --show-toplevel)

$dockerFilePrefix="$PSScriptRoot/libraries-sdk"

if ($privateAspNetCore)
{
$dockerFilePrefix="$PSScriptRoot/libraries-sdk-aspnetcore"
}

if ($buildWindowsContainers)
{
# Due to size concerns, we don't currently do docker builds on windows.
# Build on the host machine, then simply copy artifacts to the target docker image.
# This should result in significantly lower build times, for now.
& "$REPO_ROOT_DIR/build.cmd" -ci -subset clr+libs -runtimeconfiguration release -c $configuration

# Dockerize the build artifacts
if($privateAspNetCore)
{
docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--build-arg TESTHOST_LOCATION=. `
--file "$PSScriptRoot/libraries-sdk-aspnetcore.windows.Dockerfile" `
"$REPO_ROOT_DIR/artifacts/bin/testhost"
}
else
& "$REPO_ROOT_DIR/build.cmd" clr+libs -ci -rc release -c $configuration

if (!$?)
{
docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--build-arg TESTHOST_LOCATION=. `
--file "$PSScriptRoot/libraries-sdk.windows.Dockerfile" `
"$REPO_ROOT_DIR/artifacts/bin/testhost"
exit $LASTEXITCODE
}

$dockerFile="$dockerFilePrefix.windows.Dockerfile"

docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--build-arg TESTHOST_LOCATION=. `
--file $dockerFile `
"$REPO_ROOT_DIR/artifacts/bin/testhost"
}
else
else
{
# Docker build libraries and copy to dotnet sdk image
if($privateAspNetCore)
{
docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--file "$PSScriptRoot/libraries-sdk-aspnetcore.linux.Dockerfile" `
$REPO_ROOT_DIR
}
else
{
$dockerFile="$dockerFilePrefix.linux.Dockerfile"

docker build --tag $imageName `
--build-arg CONFIGURATION=$configuration `
--file "$PSScriptRoot/libraries-sdk.linux.Dockerfile" `
--file $dockerFile `
$REPO_ROOT_DIR
}
}

exit $LASTEXITCODE
61 changes: 61 additions & 0 deletions eng/docker/build-docker-sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
# Builds libraries and produces a dotnet sdk docker image
# that contains the current bits in its shared framework folder.

# Stop script if unbound variable found (use ${var:-} if intentional)
set -u

# Stop script if command returns non-zero exit code.
# Prevents hidden errors caused by missing error code propagation.
set -e

source="${BASH_SOURCE[0]}"

# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

imagename="dotnet-sdk-libs-current"
configuration="Release"
privateaspnetcore=0

while [[ $# > 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-imagename|-t)
imagename=$2
shift 2
;;
-configuration|-c)
configuration=$2
shift 2
;;
-privateaspnetcore|-pa)
privateaspnetcore=1
shift 1
;;
*)
shift 1
;;
esac
done

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

if [[ $privateaspnetcore -eq 1 ]]; then
docker_file="$scriptroot/libraries-sdk-aspnetcore.linux.Dockerfile"
fi

docker build --tag $imagename \
--build-arg CONFIGURATION=$configuration \
--file $docker_file \
$repo_root

exit $?
2 changes: 1 addition & 1 deletion eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Builds and copies library artifacts into target dotnet sdk image
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-f39df28-20191023143754
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.0.100-buster
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-buster-slim

FROM $BUILD_BASE_IMAGE as corefxbuild

Expand Down
2 changes: 1 addition & 1 deletion eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# escape=`
# Simple Dockerfile which copies library build artifacts into target dotnet sdk image
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.0.100-nanoserver-1809
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-nanoserver-1809
FROM $SDK_BASE_IMAGE as target

ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"
Expand Down
4 changes: 2 additions & 2 deletions eng/docker/libraries-sdk.linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Builds and copies library artifacts into target dotnet sdk image
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-f39df28-20191023143754
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.0.100-buster
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-buster-slim

FROM $BUILD_BASE_IMAGE as corefxbuild

Expand All @@ -25,4 +25,4 @@ ARG TARGET_COREFX_VERSION=3.0.0

COPY --from=corefxbuild \
$TESTHOST_LOCATION/$TFM-$OS-$CONFIGURATION-$ARCH/shared/$COREFX_SHARED_FRAMEWORK_NAME/$SOURCE_COREFX_VERSION/* \
$TARGET_SHARED_FRAMEWORK/$COREFX_SHARED_FRAMEWORK_NAME/$TARGET_COREFX_VERSION/
$TARGET_SHARED_FRAMEWORK/$COREFX_SHARED_FRAMEWORK_NAME/$TARGET_COREFX_VERSION/
4 changes: 2 additions & 2 deletions eng/docker/libraries-sdk.windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# escape=`
# Simple Dockerfile which copies library build artifacts into target dotnet sdk image
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.0.100-nanoserver-1809
# Simple Dockerfile which copies clr and library build artifacts into target dotnet sdk image
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-nanoserver-1809
FROM $SDK_BASE_IMAGE as target

ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"
Expand Down
16 changes: 9 additions & 7 deletions eng/pipelines/libraries/stress/http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@ jobs:
displayName: Docker Linux
timeoutInMinutes: 120
pool:
name: Hosted Ubuntu 1604
name: NetCorePublic-Pool
queue: BuildPool.Ubuntu.1604.Amd64.Open

steps:
- checkout: self
clean: true
fetchDepth: 5

- bash: |
$(dockerfilesFolder)/build-docker-sdk.ps1 -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
$(dockerfilesFolder)/build-docker-sdk.sh -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
displayName: Build CLR and Libraries

- bash: |
$(httpStressProject)/run-docker-compose.ps1 -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
$(httpStressProject)/run-docker-compose.sh -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
displayName: Build HttpStress

- bash: |
Expand All @@ -51,23 +52,24 @@ jobs:
displayName: Docker NanoServer
timeoutInMinutes: 120
pool:
vmImage: 'windows-latest'
name: NetCorePublic-Pool
queue: BuildPool.Server.Amd64.VS2019.Open

steps:
- checkout: self
clean: true
fetchDepth: 5
lfs: false

- pwsh: |
- powershell: |
$(dockerfilesFolder)/build-docker-sdk.ps1 -w -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
displayName: Build CLR and Libraries

- pwsh: |
- powershell: |
$(httpStressProject)/run-docker-compose.ps1 -w -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
displayName: Build HttpStress

- pwsh: |
- powershell: |
cd '$(httpStressProject)'
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress
16 changes: 9 additions & 7 deletions eng/pipelines/libraries/stress/ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,20 @@ jobs:
displayName: Docker Linux
timeoutInMinutes: 120
pool:
name: Hosted Ubuntu 1604
name: NetCorePublic-Pool
queue: BuildPool.Ubuntu.1604.Amd64.Open

steps:
- checkout: self
clean: true
fetchDepth: 5

- bash: |
$(dockerfilesFolder)/build-docker-sdk.ps1 -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
$(dockerfilesFolder)/build-docker-sdk.sh -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
displayName: Build CLR and Libraries

- bash: |
$(sslStressProject)/run-docker-compose.ps1 -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
$(sslStressProject)/run-docker-compose.sh -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
displayName: Build SslStress

- bash: |
Expand All @@ -52,23 +53,24 @@ jobs:
displayName: Docker NanoServer
timeoutInMinutes: 120
pool:
vmImage: 'windows-latest'
name: NetCorePublic-Pool
queue: BuildPool.Server.Amd64.VS2019.Open

steps:
- checkout: self
clean: true
fetchDepth: 5
lfs: false

- pwsh: |
- powershell: |
$(dockerfilesFolder)/build-docker-sdk.ps1 -w -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
displayName: Build CLR and Libraries

- pwsh: |
- powershell: |
$(sslStressProject)/run-docker-compose.ps1 -w -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
displayName: Build SslStress

- pwsh: |
- powershell: |
cd '$(sslStressProject)'
docker-compose up --abort-on-container-exit --no-color
displayName: Run SslStress
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/usr/bin/env bash
# Runs the stress test using docker-compose

# Stop script if unbound variable found (use ${var:-} if intentional)
set -u

# Stop script if command returns non-zero exit code.
# Prevents hidden errors caused by missing error code propagation.
set -e

source="${BASH_SOURCE[0]}"

# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

imagename="dotnet-sdk-libs-current"
configuration="Release"
privateaspnetcore=0
buildcurrentlibraries=0
buildonly=0
clientstressargs=""
serverstressargs=""

while [[ $# > 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-sdkimagename|-t)
imagename=$2
shift 2
;;
-configuration|-c)
configuration=$2
shift 2
;;
-privateaspnetcore|-pa)
privateaspnetcore=1
shift 1
;;
-buildcurrentlibraries|-b)
buildcurrentlibraries=1
shift 1
;;
-buildonly|-o)
buildonly=1
shift 1
;;
-clientstressargs)
clientstressargs=$2
shift 2
;;
-serverstressargs)
serverstressargs=$2
shift 2
;;
*)
shift 1
;;
esac
done

repo_root=$(git rev-parse --show-toplevel)

if [[ buildcurrentlibraries -eq 1 ]]; then
libraries_args=" -t $imagename -c $configuration"
if [[ $privateaspnetcore -eq 1 ]]; then
libraries_args="$libraries_args -pa"
fi

if ! $repo_root/eng/docker/build-docker-sdk.sh $libraries_args; then
exit 1
fi

elif [[ $privateaspnetcore -eq 1 ]]; then
echo "Using a private Asp.Net Core package (-pa) requires using privately built libraries. Please, enable it with -b switch."
exit 1
fi

build_args=""
if [[ "$imagename" != "" ]]; then
build_args=" --build-arg SDK_BASE_IMAGE=$imagename"
fi

compose_file="$scriptroot/docker-compose.yml"

if ! docker-compose --file "$compose_file" build $build_args; then
exit $?
fi

if [[ $buildonly -eq 0 ]]; then
export HTTPSTRESS_CLIENT_ARGS=$clientstressargs
export HTTPSTRESS_SERVER_ARGS=$serverstressargs
docker-compose --file "$compose_file" up --abort-on-container-exit
exit $?
fi
Loading