Skip to content

Parse version > 9 in dotnet.py #4470

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 15 commits into from
Sep 23, 2024
Merged

Parse version > 9 in dotnet.py #4470

merged 15 commits into from
Sep 23, 2024

Conversation

am11
Copy link
Member

@am11 am11 commented Sep 20, 2024

A job run in PR dotnet/runtime#106599 is failing like https://dev.azure.com/dnceng-public/public/_build/results?buildId=813428&view=logs&j=3ca38e2b-df6d-5512-8718-3c103788a0f9&t=0d6eb74e-f21d-5060-4e66-099a24a67e5e

[2024/09/19 22:41:48][INFO] $ pushd "/mnt/vss/_work/1/performance"
[2024/09/19 22:41:48][INFO] $ popd
[2024/09/19 22:41:48][ERROR] Unexpected error: <class 'RuntimeError'>
[2024/09/19 22:41:48][ERROR] Traceback (most recent call last):
  File "/mnt/vss/_work/1/performance/scripts/run_performance_job.py", line 1187, in main
    run_performance_job(RunPerformanceJobArgs(**args))
  File "/mnt/vss/_work/1/performance/scripts/run_performance_job.py", line 768, in run_performance_job
    ci_setup.main(ci_setup_arguments)
  File "/mnt/vss/_work/1/performance/scripts/ci_setup.py", line 447, in main
    dotnet_version = dotnet.get_dotnet_version_precise(target_framework_moniker, args.cli) if args.dotnet_versions == [] else args.dotnet_versions[0]
  File "/mnt/vss/_work/1/performance/scripts/performance/tracer.py", line 90, in wrapper
    return func(*args, **kwargs)
  File "/mnt/vss/_work/1/performance/scripts/dotnet.py", line 614, in get_dotnet_version_precise
    sdk = get_dotnet_version_from_path(framework, dotnet_path, sdk_path)
  File "/mnt/vss/_work/1/performance/scripts/performance/tracer.py", line 90, in wrapper
    return func(*args, **kwargs)
  File "/mnt/vss/_work/1/performance/scripts/dotnet.py", line 601, in get_dotnet_version_from_path
    raise RuntimeError(
RuntimeError: Unable to determine the .NET SDK used for net9.0

@am11
Copy link
Member Author

am11 commented Sep 20, 2024

cc @ilonatommy

@am11
Copy link
Member Author

am11 commented Sep 20, 2024

Apparently, printf wasn't showing up in CI logs, so I moved the diag to exception message. Please retry.

@am11
Copy link
Member Author

am11 commented Sep 20, 2024

Ah, so it is cloning the wrong repo :(

@am11
Copy link
Member Author

am11 commented Sep 20, 2024

Thanks, sorry I was in my just before calling it a weekend meeting with my manager 🤣

@ilonatommy
Copy link
Member

ilonatommy commented Sep 20, 2024

That's fine. From some reason we're ignoring net10 that we parsed and we fall back to net9, see

getLogger().info("Writing pipeline variable %s with value %s" % (name, value))

that logs

[2024/09/20 11:47:56][INFO] Writing pipeline variable PERFLAB_Framework with value net9.0

in https://dev.azure.com/dnceng-public/public/_build/results?buildId=813887&view=logs&j=63c48da7-769c-5a69-ecd6-caa9e1c7e293&t=8b4a1f4f-91f7-5091-3359-c47019cbfacd&l=86

@am11
Copy link
Member Author

am11 commented Sep 20, 2024

noticed this one as well: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-106599-merge-9f744b5760d349c987/x64.micro.net10.0.Partition0/1/console.a0f73dde.log?helixlogtype=result

[2024/09/20 12:00:47][INFO] //    * The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed.
[2024/09/20 12:00:47][INFO] 
[2024/09/20 12:00:47][INFO] // Benchmark Perf_Type.GetType_FullyQualifiedNames: Job-ANOAPY(PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0) [input=System.Int32[,]]
[2024/09/20 12:00:47][INFO] //    * The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed.
[2024/09/20 12:00:47][INFO] 
[2024/09/20 12:00:47][INFO] // Benchmark Perf_UInt16.ToString: Job-LAURTV(OutlierMode=DontRemove, PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250ms, MaxIterationCount=20, MemoryRandomization=True, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0) [value=0]
[2024/09/20 12:00:47][INFO] //    * The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed.
[2024/09/20 12:00:47][INFO] 
[2024/09/20 12:00:47][INFO] // Benchmark Perf_UInt32.TryParse: Job-LAURTV(OutlierMode=DontRemove, PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250ms, MaxIterationCount=20, MemoryRandomization=True, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0) [value=0]
[2024/09/20 12:00:47][INFO] //    * The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed.
[2024/09/20 12:00:47][INFO] 
[2024/09/20 12:00:47][INFO] // Benchmark Perf_UInt64.Parse: Job-ANOAPY(PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0) [value=0]
[2024/09/20 12:00:47][INFO] //    * The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed.
[2024/09/20 12:00:47][INFO] 
[2024/09/20 12:00:47][INFO] // Benchmark Perf_Uri.CombineAbsoluteRelative: Job-ANOAPY(PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0) [input=/new/path]
[2024/09/20 12:00:47][INFO] //    * The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed.
[2024/09/20 12:00:47][INFO] 
[2024/09/20 12:00:47][INFO] // Benchmark Perf_Uri.CtorIdnHostPathAndQuery: Job-ANOAPY(PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0) [input=http://host/p(...)s?key=ünicode [50]]
[2024/09/20 12:00:47][INFO] //    * The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed.
[2024/09/20 12:00:47][INFO] 
[2024/09/20 12:00:47][INFO] // Benchmark Perf_Version.Parse4: Job-LAURTV(OutlierMode=DontRemove, PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250ms, MaxIterationCount=20, MemoryRandomization=True, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0)
[2024/09/20 12:00:47][INFO] //    * The required .NET Core SDK version 9.0 for runtime moniker WasmNet90 is not installed.
[2024/09/20 12:00:47][INFO] 

@ilonatommy
Copy link
Member

noticed this one as well: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-106599-merge-9f744b5760d349c987/x64.micro.net10.0.Partition0/1/console.a0f73dde.log?helixlogtype=result

I think this is understandable, considering that sdk 10 is expected to be used.

@ilonatommy
Copy link
Member

ilonatommy commented Sep 20, 2024

Don't we need another case here:

def get_target_framework_moniker(framework: str) -> str:
?

We're using this method to set framework that we then use to set the env variable that is logged as net9:

set_environment_variable('PERFLAB_Framework', framework)

This it not the full fix for sure, though. We have to figure out how args.channel became nativeaot9.0

Edit: aha, like this:

- nativeaot9.0

@ilonatommy
Copy link
Member

I re-run before the final touches were done, so in case it won't pass, we'll make another round.

@ilonatommy
Copy link
Member

Waiting for the 2nd run to finish:
I'm not sure if we are even using it in this CI run but this place looks like a candidate for changes as well:
https://github.com/dotnet/performance/blob/f6d0cff8bfb8bc0c3eec23b4b07c837e4c5f8abb/src/tools/ResultsComparer/Data.cs#L131C31-L131C41

@am11
Copy link
Member Author

am11 commented Sep 20, 2024

BenchmarkDotNet apparently also has a lot of hardcoded monikers https://github.com/search?q=repo%3Adotnet%2FBenchmarkDotNet%20net9&type=code

Maybe we need to update BDN as well?

@am11
Copy link
Member Author

am11 commented Sep 20, 2024

Maybe this will help? At least for PERFLAB_Framework 😅

@am11
Copy link
Member Author

am11 commented Sep 20, 2024

RuntimeError: Unable to determine the .NET SDK used for net10.0. SDKs found in /mnt/vss/_work/1/performance/CorrelationStaging/payload/dotnet/sdk: ['10.0.100-alpha.1.24468.12']. Major version: 0

Looks like regex required non-greedy when there is more than one digit in first match. Some sort of python gotcha, but this works (tested on godbolt with net9.0 and net10.0)

@lewing lewing requested a review from DrewScoggins September 20, 2024 16:48
@am11
Copy link
Member Author

am11 commented Sep 20, 2024

Next up:

[2024/09/20 16:59:55][INFO] /datadisks/disk1/work/A2B508ED/p/dotnet/sdk/10.0.100-alpha.1.24468.12/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(166,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 10.0. Either target .NET 9.0 or lower, or use a version of the .NET SDK that supports .NET 10.0. Download the .NET SDK from https://aka.ms/dotnet/download [/datadisks/disk1/work/A2B508ED/w/B0B10936/e/performance/src/benchmarks/micro/MicroBenchmarks.csproj::TargetFramework=net10.0]

so it is correctly passing 10.0, but 10.0 SDK is only supporting .NET 9.. see dotnet/runtime#106599 (comment)

@lewing lewing requested a review from caaavik-msft September 20, 2024 17:39
@caaavik-msft
Copy link
Contributor

We might need to get the BDN change to support targeting .NET 10 out and in this as well, similar to when we made this change last year:

'tfm': 'net9.0',
'branch': '9.0',
'tfm': 'net10.0',
'branch': '10.0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should do this in a separate change as this shouldn't be a dependency to get dotnet/runtime#106599 working. This also means we can spend some time to get the BDN changes in as well to support wasm on .NET 10.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@am11 Can you remove the change to channel_map.py then we can merge this in?

Copy link
Contributor

@caaavik-msft caaavik-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@caaavik-msft caaavik-msft merged commit d384536 into dotnet:main Sep 23, 2024
2 of 56 checks passed
@am11 am11 deleted the patch-1 branch September 23, 2024 21:20
@am11
Copy link
Member Author

am11 commented Sep 23, 2024

@caaavik-msft thanks. Just curious, are those unsupported TMFs like (netcoreapp3) and desktop CLR ones (net4XX) channels still relevant / working? If not, maybe we should clean that up and keep it to lowest supported LTS.

@caaavik-msft
Copy link
Contributor

Perhaps a good idea, I suppose there isn't much need for the older target frameworks. @DrewScoggins not sure if you had any other thoughts on if that might be something worth cleaning up.

@am11
Copy link
Member Author

am11 commented Sep 23, 2024

Judging by

throw new ArgumentException($"{prefix}: COMPlus Environment variables are disallowed. Please replace it with it's DOTNET equivalent.");
if we are actively disallowing COMPlus_ in favor of DOTNET_ environment vars, and those vars are essential for perf scenarios execution, then it means we are only supporting .NET 6+ (since DOTNET_ config functionality was added back then and COMPlus_ was the only supported prefix in previous versions).

@DrewScoggins
Copy link
Member

Yeah, I was thinking about this. I am trying to come up with a realistic scenario that would involve us needing to go back and do performance testing on anything that old, and can't really get there. If the need did somehow arise, we can always just add it back in.

I think removing the obsolete TFMs seems like a good idea.

@DrewScoggins
Copy link
Member

Judging by

throw new ArgumentException($"{prefix}: COMPlus Environment variables are disallowed. Please replace it with it's DOTNET equivalent.");

if we are actively disallowing COMPlus_ in favor of DOTNET_ environment vars, and those vars are essential for perf scenarios execution, then it means we are only supporting .NET 6+ (since DOTNET_ config functionality was added back then and COMPlus_ was the only supported prefix in previous versions).

That is for the GC perf tests and infrastructure, which is different than the existing microbenchmarks. However, I get your point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants