From ff0857a7382d0602605bf7155ffa03ab0e04426d Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 16 Aug 2022 17:30:28 +0000 Subject: [PATCH 1/7] perf pipeline: Switch to node 14.x - Switch to node 14.x instead of 18.x, because the latter doesn't seem to be compatible with ubuntu 18.x: `node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)` - Also, remove the existing `nodejs` package before installing a new one, because these machines are shared, and would get affected by installations performed by other runs. --- eng/pipelines/coreclr/templates/run-performance-job.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index d4e25aff3f4985..fff6154979e084 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -79,7 +79,8 @@ jobs: pip3 install azure.storage.queue==12.0.0 && sudo apt-get update && sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates && - curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && + sudo apt-get -y remove nodejs && + 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 --engines=v8,javascriptcore && From 86459f77b1ee1b8575f23e58c54dafa9b9264604 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 16 Aug 2022 18:21:32 +0000 Subject: [PATCH 2/7] perf pipeline: install wasm pre-reqs only on wasm jobs --- .../coreclr/templates/run-performance-job.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index fff6154979e084..33cb5a2e84d6c3 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -64,6 +64,13 @@ jobs: - HelixPerfUploadTokenValue: '$(PerfCommandUploadTokenLinux)' - ${{ if and(notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.osGroup, 'windows')) }}: - HelixPerfUploadTokenValue: '$(PerfCommandUploadToken)' + - ${{ if eq(parameters.runtimeType, 'wasm') }}: + - HelixPreCommandsWasmOnLinux: >- + sudo apt-get -y remove nodejs && + 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 --engines=v8,javascriptcore - 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)"' - HelixPreCommandStemLinux: >- export ORIGPYPATH=$PYTHONPATH @@ -79,11 +86,7 @@ jobs: pip3 install azure.storage.queue==12.0.0 && sudo apt-get update && sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates && - sudo apt-get -y remove nodejs && - 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 --engines=v8,javascriptcore && + $(HelixPreCommandsWasmOnLinux) && export PERFLAB_UPLOAD_TOKEN="$(HelixPerfUploadTokenValue)" && export PERF_PREREQS_INSTALLED=1; test "x$PERF_PREREQS_INSTALLED" = "x1" || echo "** Error: Failed to install prerequites **" From 3d31109dbb0278a911e84fe95b1867a4bd27b7eb Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 16 Aug 2022 18:21:54 +0000 Subject: [PATCH 3/7] perf pipeline: correctly return exit code, so helix can pick that up and set _commandExitCode --- eng/testing/performance/microbenchmarks.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/performance/microbenchmarks.proj b/eng/testing/performance/microbenchmarks.proj index 1331e1e7a811c0..bb23eb6e67553a 100644 --- a/eng/testing/performance/microbenchmarks.proj +++ b/eng/testing/performance/microbenchmarks.proj @@ -135,7 +135,7 @@ if [ "x$PERF_PREREQS_INSTALLED" = "x1" ]; then $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"; else - echo "\n\n** Error: Failed to install prerequisites **\n\n"; export _commandExitCode=1; + echo "\n\n** Error: Failed to install prerequisites **\n\n"; (exit 1); fi $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" $(DotnetExe) run -f $(PERFLAB_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand) From d1db9bf79c3fdf86097e4f360227abe36fe1598f Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 16 Aug 2022 18:47:51 +0000 Subject: [PATCH 4/7] Set a default value for non-wasm cases --- .../coreclr/templates/run-performance-job.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index 33cb5a2e84d6c3..9baa380e0e95bd 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -66,11 +66,13 @@ jobs: - HelixPerfUploadTokenValue: '$(PerfCommandUploadToken)' - ${{ if eq(parameters.runtimeType, 'wasm') }}: - HelixPreCommandsWasmOnLinux: >- - sudo apt-get -y remove nodejs && - 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 --engines=v8,javascriptcore + sudo apt-get -y remove nodejs && + 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 --engines=v8,javascriptcore + - ${{ 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)"' - HelixPreCommandStemLinux: >- export ORIGPYPATH=$PYTHONPATH From c1e7956de6ff6132dfcc3776c81cbccb2b001546 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 16 Aug 2022 16:41:57 -0400 Subject: [PATCH 5/7] Change the prereqs condition so a failure needs to be explicitly marked This allows cases which don't care about this, to continue working, because they won't set `$PERF_PREREQS_INSTALL_FAILED`, and default to continuing with the job. --- .../coreclr/templates/run-performance-job.yml | 6 +++--- eng/testing/performance/microbenchmarks.proj | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index 9baa380e0e95bd..947a56a413c92a 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -89,9 +89,9 @@ jobs: sudo apt-get update && sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates && $(HelixPreCommandsWasmOnLinux) && - export PERFLAB_UPLOAD_TOKEN="$(HelixPerfUploadTokenValue)" && - export PERF_PREREQS_INSTALLED=1; - test "x$PERF_PREREQS_INSTALLED" = "x1" || echo "** Error: Failed to install prerequites **" + export PERFLAB_UPLOAD_TOKEN="$(HelixPerfUploadTokenValue)" + || export PERF_PREREQS_INSTALL_FAILED=1; + test "x$PERF_PREREQS_INSTALL_FAILED" = "x1" && echo "** Error: Failed to install prerequites **" - HelixPreCommandStemMusl: 'export ORIGPYPATH=$PYTHONPATH;sudo apk add icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib cargo;sudo apk add libgdiplus --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing; python3 -m venv $HELIX_WORKITEM_PAYLOAD/.venv;source $HELIX_WORKITEM_PAYLOAD/.venv/bin/activate;export PYTHONPATH=;python3 -m pip install -U pip;pip3 install azure.storage.blob==12.7.1;pip3 install azure.storage.queue==12.1.5;export PERFLAB_UPLOAD_TOKEN="$(HelixPerfUploadTokenValue)"' - ExtraMSBuildLogsWindows: 'set MSBUILDDEBUGCOMM=1;set "MSBUILDDEBUGPATH=%HELIX_WORKITEM_UPLOAD_ROOT%"' - ExtraMSBuildLogsLinux: 'export MSBUILDDEBUGCOMM=1;export "MSBUILDDEBUGPATH=$HELIX_WORKITEM_UPLOAD_ROOT"' diff --git a/eng/testing/performance/microbenchmarks.proj b/eng/testing/performance/microbenchmarks.proj index bb23eb6e67553a..39b68e6eb80efb 100644 --- a/eng/testing/performance/microbenchmarks.proj +++ b/eng/testing/performance/microbenchmarks.proj @@ -132,10 +132,10 @@ $(WorkItemDirectory) $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" - if [ "x$PERF_PREREQS_INSTALLED" = "x1" ]; then - $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"; - else + if [ "x$PERF_PREREQS_INSTALL_FAILED" = "x1" ]; then echo "\n\n** Error: Failed to install prerequisites **\n\n"; (exit 1); + else + $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"; fi $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" $(DotnetExe) run -f $(PERFLAB_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand) @@ -148,10 +148,10 @@ $(WorkItemDirectory) $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument)" - if [ "x$PERF_PREREQS_INSTALLED" = "x1" ]; then - $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)"; - else + if [ "x$PERF_PREREQS_INSTALL_FAILED" = "x1" ]; then echo "\n\n** Error: Failed to install prerequisites **\n\n"; export _commandExitCode=1; + else + $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)"; fi $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)" $(DotnetExe) run -f $(PERFLAB_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults) From 7519f8ba7ca3f27aabfc244a88f6c9ac863e60c1 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 17 Aug 2022 03:08:35 -0400 Subject: [PATCH 6/7] Use --user with pip install --- .../coreclr/templates/run-performance-job.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index 947a56a413c92a..218c8262ad52de 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -78,21 +78,21 @@ jobs: export ORIGPYPATH=$PYTHONPATH export CRYPTOGRAPHY_ALLOW_OPENSSL_102=true; echo "** Installing prerequistes **"; - python3 -m pip install -U pip && + python3 -m pip install --user -U pip && sudo apt-get -y install python3-venv && python3 -m venv $HELIX_WORKITEM_PAYLOAD/.venv && ls -l $HELIX_WORKITEM_PAYLOAD/.venv/bin/activate && export PYTHONPATH= && - python3 -m pip install -U pip && - pip3 install azure.storage.blob==12.0.0 && - pip3 install azure.storage.queue==12.0.0 && + python3 -m pip install --user -U pip && + pip3 install --user azure.storage.blob==12.0.0 && + pip3 install --user azure.storage.queue==12.0.0 && sudo apt-get update && sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates && $(HelixPreCommandsWasmOnLinux) && export PERFLAB_UPLOAD_TOKEN="$(HelixPerfUploadTokenValue)" || export PERF_PREREQS_INSTALL_FAILED=1; test "x$PERF_PREREQS_INSTALL_FAILED" = "x1" && echo "** Error: Failed to install prerequites **" - - HelixPreCommandStemMusl: 'export ORIGPYPATH=$PYTHONPATH;sudo apk add icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib cargo;sudo apk add libgdiplus --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing; python3 -m venv $HELIX_WORKITEM_PAYLOAD/.venv;source $HELIX_WORKITEM_PAYLOAD/.venv/bin/activate;export PYTHONPATH=;python3 -m pip install -U pip;pip3 install azure.storage.blob==12.7.1;pip3 install azure.storage.queue==12.1.5;export PERFLAB_UPLOAD_TOKEN="$(HelixPerfUploadTokenValue)"' + - HelixPreCommandStemMusl: 'export ORIGPYPATH=$PYTHONPATH;sudo apk add icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib cargo;sudo apk add libgdiplus --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing; python3 -m venv $HELIX_WORKITEM_PAYLOAD/.venv;source $HELIX_WORKITEM_PAYLOAD/.venv/bin/activate;export PYTHONPATH=;python3 -m pip install --user -U pip;pip3 install --user azure.storage.blob==12.7.1;pip3 install --user azure.storage.queue==12.1.5;export PERFLAB_UPLOAD_TOKEN="$(HelixPerfUploadTokenValue)"' - ExtraMSBuildLogsWindows: 'set MSBUILDDEBUGCOMM=1;set "MSBUILDDEBUGPATH=%HELIX_WORKITEM_UPLOAD_ROOT%"' - ExtraMSBuildLogsLinux: 'export MSBUILDDEBUGCOMM=1;export "MSBUILDDEBUGPATH=$HELIX_WORKITEM_UPLOAD_ROOT"' - HelixPreCommand: '' From bee15e46e9574c19534d4fc39e163e432cb9a6e5 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 17 Aug 2022 13:42:56 -0400 Subject: [PATCH 7/7] Update eng/testing/performance/microbenchmarks.proj --- eng/testing/performance/microbenchmarks.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/performance/microbenchmarks.proj b/eng/testing/performance/microbenchmarks.proj index 39b68e6eb80efb..3793751775f92d 100644 --- a/eng/testing/performance/microbenchmarks.proj +++ b/eng/testing/performance/microbenchmarks.proj @@ -149,7 +149,7 @@ $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument)" if [ "x$PERF_PREREQS_INSTALL_FAILED" = "x1" ]; then - echo "\n\n** Error: Failed to install prerequisites **\n\n"; export _commandExitCode=1; + echo "\n\n** Error: Failed to install prerequisites **\n\n"; (exit 1); else $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)"; fi