-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Build HttpStress and SslStress with live-built runtime using current TFM #61689
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsAs noted in #60769 (comment), the assumption that the live-built runtime of version This PR changes both local (non-containerized) and containerized stress builds to build against the live-built runtime with the help of Some tricky parts:
Fixes #60769.
|
{ | ||
// For some reason, System.Security.Cryptography.Encoding.dll fails to resolve when being loaded on-demand by AspNetCore. | ||
// Enforce early-loading to workaround this issue. | ||
_ = new Oid(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the error I get by removing this line:
https://dev.azure.com/dnceng/public/_build/results?buildId=1459792&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=6c56d998-158d-5232-283c-5140104799fc
I'm open to ideas or recommendations that can help getting rid of this hack, but I would like to avoid spending time root-causing the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wfurt any ideas? Should we file this as a separate issue? Or is this related to all the targeting pack magic around?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.props
Outdated
Show resolved
Hide resolved
also delete OSX <PackageRid>, since OSX stress runs are practically unsupported
/azp run runtime-libraries stress-http |
Azure Pipelines successfully started running 1 pipeline(s). |
I followed PS convention ( |
/azp run runtime-libraries stress-http |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-libraries stress-ssl |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -57,6 +57,7 @@ jobs: | |||
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0" | |||
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0" | |||
docker-compose up --abort-on-container-exit --no-color | |||
timeoutInMinutes: 35 # In case the HTTP/3.0 run hangs, we timeout shortly after the expected 30 minute run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm adding this because I experienced mysterious HTTP/3.0 hangs on some runs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what happened? I see only blank screen (no output from the run)? Either way, we shouldn't hold this PR on it and investigate it separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It stopped logging after this line, then that log disappeared for some reason after the whole job becoming cancelled. Unfortunately I wasn't able to reproduce this behavior locally.
I would be surprised if this is caused by my changes, we haven't seen working stress runs on the CI for a while.
I can build the
I have |
@ManickaP docker or local? In case of local, did you use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proper first pass through the change (it's big 😄)
I haven't gotten to fully test this yet though.
{ | ||
// For some reason, System.Security.Cryptography.Encoding.dll fails to resolve when being loaded on-demand by AspNetCore. | ||
// Enforce early-loading to workaround this issue. | ||
_ = new Oid(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wfurt any ideas? Should we file this as a separate issue? Or is this related to all the targeting pack magic around?
src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.ps1
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.sh
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,44 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this script same (or very similar) as the one in HttpStress
? Should we somehow share it (in eng dir potentially)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HttpStress doesn't need Microsoft.AspNetCore.App
so in that case it's much simpler. There is a lot of duplication including msbuild stuff and scripts, but moving these bits to a shared location would make things only harder to maintain. It's already pretty hard to track what lives in /eng/docker
vs individual stress projects.
If we had a 3rd stress project that would make these bits worth to dedupe.
stress_configuration=${1,,} # Lowercase all characters in $1 | ||
stress_configuration=${stress_configuration^} # Uppercase first character |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this really matter, I've been using lower-case interchangeably.
As a result, the whole if-else could be reduced to stress_configuration="${1:-Release}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes the scripts refer to filesystem locations based on the configuration variable values:
runtime/src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.sh
Line 38 in 48a9602
testhost_root=$repo_root/artifacts/bin/testhost/net$version-Linux-$libraries_configuration-x64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I learned the hard way it does matter in certain scenarios 🤣.
However, I was thinking how to make this more convenient to use, e.g.: testhost_root=$(ls -t -d $repo_root/artifacts/bin/testhost/net$version-Linux-*-x64 | head -n 1)
which picks the most recent testhost dir if you do not specify which one you want to use.
So the script would work nicely without providing any argument with either release or debug testhost builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, this is just a suggestion for possible future improvement. I certainly won't hold the PR on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I just made it fail with a verbose message if you build it with the wrong config.
No, I used to be able to build and run against globally installed SDK/runtime, which I've used extensively. Note that my connection is not so great to pull SDKs all the time, I usually install them globally once for all clones I have. |
After this PR, you really need the testhost to run the stress project. I don't know if there is a reliable way to hack the global Note that my script does ./build-local.sh -aspnetlocation "/usr/share/dotnet/shared/Microsoft.AspNetCore.App/7.0.0-alpha.1.21567.1" |
src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.sh
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The script for running stress with your local bits is very convenient, I like it a lot!
/azp run runtime-libraries stress-http |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-libraries stress-ssl |
Azure Pipelines successfully started running 1 pipeline(s). |
As noted in #60769 (comment), the assumption that the live-built runtime of version
(X+1).0
can be a drop-in replacement in an SDK of versionX.0
is sometimes wrong, and it currently breaks our stress builds.This PR changes both local (non-containerized) and containerized stress builds to build against the live-built runtime with the help of
targetingpacks.targets
.Some tricky parts:
/live-runtime-artifacts
and reference that location from properties required bytargetingpacks.targets
/live-runtime-artifacts
. Tests are being executed by:TESTHOSTDIR/dotnet exec STRESSBINDIR/HttpStress.dll <args>
.targetingpacks.targets
also goes to/live-runtime-artifacts
Microsoft.AspNetCore.App
bits. These are acquired by getting the latest daily SDK build withdotnet-install.sh/ps1
privateAspNetCore
stuff implemented in Run stress tests on private Asp.Net Core package #33860. Scripts args and dockerfiles dealing with that have been removed.build-local.ps1/sh
have been implemented. In case of HttpStress these scripts need to grab the daily SDK just like container scripts.Fixes #60769.
/cc @ManickaP @safern