From 040caff61a28db91544d8cf3ba36f9a10978dd40 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 12 Jan 2023 11:15:08 -0500 Subject: [PATCH 1/3] [wasm] perf: generate, and collect binlogs --- eng/pipelines/common/perf-variables.yml | 9 +++--- .../perf-wasm-prepare-artifacts-steps.yml | 1 + eng/testing/performance/blazor_perf.proj | 31 +++++++++++-------- eng/testing/performance/performance-setup.sh | 2 ++ 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/eng/pipelines/common/perf-variables.yml b/eng/pipelines/common/perf-variables.yml index c40e91741549e..9b14ab5067a05 100644 --- a/eng/pipelines/common/perf-variables.yml +++ b/eng/pipelines/common/perf-variables.yml @@ -1,14 +1,15 @@ variables: - name: _wasmCollectHelixLogsScript value: >- - test "$_commandExitCode" -eq 0 || ( - test -d "$HELIX_WORKITEM_UPLOAD_ROOT" && ( - export _PERF_DIR=$HELIX_WORKITEM_ROOT/performance; + test -d "$HELIX_WORKITEM_UPLOAD_ROOT" && ( + export _PERF_DIR=$HELIX_WORKITEM_ROOT/performance; + mkdir -p $HELIX_WORKITEM_UPLOAD_ROOT/log; + find $_PERF_DIR -name '*.binlog' | xargs -I{} cp {} $HELIX_WORKITEM_UPLOAD_ROOT/log; + test "$_commandExitCode" -eq 0 || ( mkdir -p $HELIX_WORKITEM_UPLOAD_ROOT/log/MicroBenchmarks/obj; mkdir -p $HELIX_WORKITEM_UPLOAD_ROOT/log/MicroBenchmarks/bin; mkdir -p $HELIX_WORKITEM_UPLOAD_ROOT/log/BenchmarkDotNet.Autogenerated/obj; mkdir -p $HELIX_WORKITEM_UPLOAD_ROOT/log/for-running; - find $_PERF_DIR -name '*.binlog' | xargs -I{} cp {} $HELIX_WORKITEM_UPLOAD_ROOT/log; cp -R $_PERF_DIR/artifacts/obj/MicroBenchmarks $HELIX_WORKITEM_UPLOAD_ROOT/log/MicroBenchmarks/obj; cp -R $_PERF_DIR/artifacts/bin/MicroBenchmarks $HELIX_WORKITEM_UPLOAD_ROOT/log/MicroBenchmarks/bin; cp -R $_PERF_DIR/artifacts/obj/BenchmarkDotNet.Autogenerated $HELIX_WORKITEM_UPLOAD_ROOT/log/BenchmarkDotNet.Autogenerated/obj; diff --git a/eng/pipelines/coreclr/perf-wasm-prepare-artifacts-steps.yml b/eng/pipelines/coreclr/perf-wasm-prepare-artifacts-steps.yml index f8d0c51022c37..e35b4fcb79003 100644 --- a/eng/pipelines/coreclr/perf-wasm-prepare-artifacts-steps.yml +++ b/eng/pipelines/coreclr/perf-wasm-prepare-artifacts-steps.yml @@ -7,6 +7,7 @@ steps: /p:Configuration=${{ parameters.configForBuild }} /p:ContinuousIntegrationBuild=true /t:InstallWorkloadUsingArtifacts + /bl:$(Build.SourcesDirectory)/artifacts/log/${{ parameters.configForBuild }}/InstallWorkloadUsingArtifacts.binlog $(Build.SourcesDirectory)/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj displayName: "Install workload using artifacts" diff --git a/eng/testing/performance/blazor_perf.proj b/eng/testing/performance/blazor_perf.proj index 5126b8d7649aa..89834743d16dd 100644 --- a/eng/testing/performance/blazor_perf.proj +++ b/eng/testing/performance/blazor_perf.proj @@ -1,18 +1,15 @@ - + + %HELIX_WORKITEM_UPLOAD_ROOT%\ + %24{HELIX_WORKITEM_UPLOAD_ROOT}/ + python3 - $(HelixPreCommands);chmod +x $HELIX_WORKITEM_PAYLOAD/SOD/SizeOnDisk + $(HelixPreCommands);chmod +x $HELIX_WORKITEM_PAYLOAD/SOD/SizeOnDisk - --has-workload --readonly-dotnet --msbuild "/p:_TrimmerDumpDependencies=true" --msbuild-static AdditionalMonoLinkerOptions=%27"%24(AdditionalMonoLinkerOptions) --dump-dependencies"%27 + --has-workload --readonly-dotnet --msbuild "/p:_TrimmerDumpDependencies=true" --msbuild /warnaserror:NU1602,NU1604 --msbuild-static AdditionalMonoLinkerOptions=%27"%24(AdditionalMonoLinkerOptions) --dump-dependencies"%27 --binlog $(LogDirectory)blazor_publish.binlog $(Python) pre.py publish $(PublishArgs) - - - %(Identity) - - - %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\ $(ScenarioDirectory)blazorminapp\ @@ -36,6 +33,12 @@ $PERFLAB_TARGET_FRAMEWORKS + + + %(Identity) + + + $(WorkItemDirectory) @@ -46,27 +49,29 @@ $(WorkItemDirectory) cd $(BlazorMinAOTDirectory) && $(PublishCommand) && $(Python) test.py sod --scenario-name "%(Identity)" + 00:30 $(WorkItemDirectory) - cd $(BlazorDirectory) && $(PublishCommand) --binlog %27./traces/blazor_publish.binlog%27 && $(Python) test.py sod --scenario-name "%(Identity)" + cd $(BlazorDirectory) && $(PublishCommand) && $(Python) test.py sod --scenario-name "%(Identity)" $(Python) post.py --readonly-dotnet $(WorkItemDirectory) - cd $(BlazorAOTDirectory) && $(PublishCommand) --binlog %27./traces/blazor_publish.binlog%27 && $(Python) test.py sod --scenario-name "%(Identity)" + cd $(BlazorAOTDirectory) && $(PublishCommand) && $(Python) test.py sod --scenario-name "%(Identity)" $(Python) post.py --readonly-dotnet + 00:30 $(WorkItemDirectory) - cd $(BlazorPizzaDirectory) && $(PublishCommand) -f $(PerflabTargetFrameworks) --binlog %27./traces/blazor_publish.binlog%27 && $(Python) test.py sod --scenario-name "%(Identity)" --dirs $(PizzaAppPubLocation) + cd $(BlazorPizzaDirectory) && $(PublishCommand) -f $(PerflabTargetFrameworks) && $(Python) test.py sod --scenario-name "%(Identity)" --dirs $(PizzaAppPubLocation) $(Python) post.py --readonly-dotnet $(WorkItemDirectory) - cd $(BlazorPizzaAOTDirectory) && $(PublishCommand) -f $(PerflabTargetFrameworks) --binlog %27./traces/blazor_publish.binlog%27 && $(Python) test.py sod --scenario-name "%(Identity)" --dirs $(PizzaAppPubLocation) + cd $(BlazorPizzaAOTDirectory) && $(PublishCommand) -f $(PerflabTargetFrameworks) && $(Python) test.py sod --scenario-name "%(Identity)" --dirs $(PizzaAppPubLocation) $(Python) post.py --readonly-dotnet 1:00 diff --git a/eng/testing/performance/performance-setup.sh b/eng/testing/performance/performance-setup.sh index 2a7727d48c313..a4a93ba3e16ed 100755 --- a/eng/testing/performance/performance-setup.sh +++ b/eng/testing/performance/performance-setup.sh @@ -346,6 +346,8 @@ else # uncomment to use BenchmarkDotNet sources instead of nuget packages # git clone https://github.com/dotnet/BenchmarkDotNet.git $benchmark_directory + (cd $performance_directory; git show -s HEAD) + docs_directory=$performance_directory/docs mv $docs_directory $workitem_directory fi From e29d39a02b2eb74d6aca03da9cc4cbbed2d46d1d Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 12 Jan 2023 11:16:15 -0500 Subject: [PATCH 2/3] [wasm] perf: remove workaround to allow building for net8.0 with 8.0 sdk --- eng/pipelines/coreclr/perf-wasm-jobs.yml | 9 ++++++--- .../coreclr/perf-wasm-prepare-artifacts-steps.yml | 2 +- eng/pipelines/coreclr/templates/perf-job.yml | 2 +- eng/pipelines/coreclr/templates/run-scenarios-job.yml | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/coreclr/perf-wasm-jobs.yml b/eng/pipelines/coreclr/perf-wasm-jobs.yml index 1f620b8d83e4c..20800e2e6cf9a 100644 --- a/eng/pipelines/coreclr/perf-wasm-jobs.yml +++ b/eng/pipelines/coreclr/perf-wasm-jobs.yml @@ -115,7 +115,8 @@ jobs: runJobTemplate: /eng/pipelines/coreclr/templates/run-performance-job.yml logicalmachine: 'perftiger' javascriptEngine: 'v8' - additionalSetupParameters: '--dotnet-versions 8.0.0' # passed to ci_setup.py + # passed to ci_setup.py to work with 8.0 sdk when using tfm!=net8.0 + #additionalSetupParameters: '--dotnet-versions 8.0.0' collectHelixLogsScript: ${{ parameters.collectHelixLogsScript }} compare: ${{ parameters.compare }} onlySanityCheck: ${{ parameters.onlySanityCheck }} @@ -141,7 +142,8 @@ jobs: runjobtemplate: /eng/pipelines/coreclr/templates/run-performance-job.yml logicalmachine: 'perftiger' javascriptEngine: 'v8' - additionalSetupParameters: '--dotnet-versions 8.0.0' # passed to ci_setup.py + # passed to ci_setup.py to work with 8.0 sdk when using tfm!=net8.0 + #additionalSetupParameters: '--dotnet-versions 8.0.0' # passed to ci_setup.py collectHelixLogsScript: ${{ parameters.collectHelixLogsScript }} compare: ${{ parameters.compare }} onlySanityCheck: ${{ parameters.onlySanityCheck }} @@ -164,7 +166,8 @@ jobs: projectFile: blazor_perf.proj runKind: blazor_scenarios runJobTemplate: /eng/pipelines/coreclr/templates/run-scenarios-job.yml - additionalSetupParameters: '--dotnetversions 8.0.0' # passed to performance-setup.sh + # passed to ci_setup.py to work with 8.0 sdk when using tfm!=net8.0 + # additionalSetupParameters: '--dotnetversions 8.0.0' # passed to performance-setup.sh logicalmachine: 'perftiger' downloadSpecificBuild: ${{ parameters.downloadSpecificBuild }} perfForkToUse: ${{ parameters.perfForkToUse }} diff --git a/eng/pipelines/coreclr/perf-wasm-prepare-artifacts-steps.yml b/eng/pipelines/coreclr/perf-wasm-prepare-artifacts-steps.yml index e35b4fcb79003..0502a534d36ce 100644 --- a/eng/pipelines/coreclr/perf-wasm-prepare-artifacts-steps.yml +++ b/eng/pipelines/coreclr/perf-wasm-prepare-artifacts-steps.yml @@ -13,7 +13,7 @@ steps: - script: >- mkdir -p $(Build.SourcesDirectory)/artifacts/staging && - cp -r $(Build.SourcesDirectory)/artifacts/bin/dotnet-net7+latest $(Build.SourcesDirectory)/artifacts/staging && + cp -r $(Build.SourcesDirectory)/artifacts/bin/dotnet-latest $(Build.SourcesDirectory)/artifacts/staging && cp -r $(Build.SourcesDirectory)/artifacts/bin/microsoft.netcore.app.runtime.browser-wasm $(Build.SourcesDirectory)/artifacts/staging && cp -r $(Build.SourcesDirectory)/artifacts/bin/microsoft.netcore.app.ref $(Build.SourcesDirectory)/artifacts/staging displayName: "Prepare artifacts staging directory" diff --git a/eng/pipelines/coreclr/templates/perf-job.yml b/eng/pipelines/coreclr/templates/perf-job.yml index af0de6eb8dd5c..fe4b457539ae0 100644 --- a/eng/pipelines/coreclr/templates/perf-job.yml +++ b/eng/pipelines/coreclr/templates/perf-job.yml @@ -188,7 +188,7 @@ jobs: - script: >- mkdir -p $(librariesDownloadDir)/bin/wasm/wasm-data && mkdir -p $(librariesDownloadDir)/bin/wasm/dotnet && - cp -r $(librariesDownloadDir)/BrowserWasm/staging/dotnet-net7+latest/* $(librariesDownloadDir)/bin/wasm/dotnet && + cp -r $(librariesDownloadDir)/BrowserWasm/staging/dotnet-latest/* $(librariesDownloadDir)/bin/wasm/dotnet && cp src/mono/wasm/Wasm.Build.Tests/data/test-main-7.0.js $(librariesDownloadDir)/bin/wasm/wasm-data/test-main.js && find $(librariesDownloadDir)/bin/wasm -type d && find $(librariesDownloadDir)/bin/wasm -type f -exec chmod 664 {} \; diff --git a/eng/pipelines/coreclr/templates/run-scenarios-job.yml b/eng/pipelines/coreclr/templates/run-scenarios-job.yml index b33f8b6cf2b42..353bfef9e2327 100644 --- a/eng/pipelines/coreclr/templates/run-scenarios-job.yml +++ b/eng/pipelines/coreclr/templates/run-scenarios-job.yml @@ -145,7 +145,7 @@ jobs: # Using test-main-7.0.js, since we are building with tfm:net7.0 - script: >- mkdir -p $(librariesDownloadDir)/bin/wasm/data && - cp -r $(librariesDownloadDir)/BrowserWasm/staging/dotnet-net7+latest $(librariesDownloadDir)/bin/wasm && + cp -r $(librariesDownloadDir)/BrowserWasm/staging/dotnet-latest $(librariesDownloadDir)/bin/wasm && cp src/mono/wasm/Wasm.Build.Tests/data/test-main-7.0.js $(librariesDownloadDir)/bin/wasm/data/test-main.js && find $(librariesDownloadDir)/bin/wasm -type f -exec chmod 664 {} \; displayName: "Create wasm directory (Linux)" From 2ffcc61f9b2ae392c2bf726439390dfbd7cc7059 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 12 Jan 2023 11:16:38 -0500 Subject: [PATCH 3/3] [wasm] perf: revert to using latest v8 - this is because jsvu fails to generate a wrapper for the specific version, because this version of jsvu (2.0.1) is broken with node 14.x . And node 18.x builds are not built for ubuntu 18.04 --- eng/pipelines/coreclr/templates/run-performance-job.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index b355f43e9744a..bddc621be62fc 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -71,9 +71,9 @@ jobs: curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - && sudo apt-get -y install nodejs && npm install --prefix $HELIX_WORKITEM_PAYLOAD jsvu -g && - $HELIX_WORKITEM_PAYLOAD/bin/jsvu --os=linux64 v8@11.0.162 && - rm -f ~/.jsvu/v8 && - ln -s ~/.jsvu/v8-11.0.162 ~/.jsvu/v8 + $HELIX_WORKITEM_PAYLOAD/bin/jsvu --os=linux64 --engines=v8 && + find ~/.jsvu -ls && + ~/.jsvu/v8 -e "console.log(`V8 version: ${this.version()}`)" - ${{ if ne(parameters.runtimeType, 'wasm') }}: - HelixPreCommandsWasmOnLinux: echo - HelixPreCommandStemWindows: 'set ORIGPYPATH=%PYTHONPATH%;py -m pip install -U pip;py -3 -m venv %HELIX_WORKITEM_PAYLOAD%\.venv;call %HELIX_WORKITEM_PAYLOAD%\.venv\Scripts\activate.bat;set PYTHONPATH=;py -3 -m pip install -U pip;py -3 -m pip install azure.storage.blob==12.0.0;py -3 -m pip install azure.storage.queue==12.0.0;set "PERFLAB_UPLOAD_TOKEN=$(HelixPerfUploadTokenValue)"'