Add Runtime portion of android startup scenario (#61861)
authorParker Bibus <parkerbibus@microsoft.com>
Wed, 8 Dec 2021 00:27:04 +0000 (18:27 -0600)
committerGitHub <noreply@github.com>
Wed, 8 Dec 2021 00:27:04 +0000 (16:27 -0800)
Add app with debug instrumentation build and download. Add android scenario calls and include xharness.

Co-authored-by: Bill Wert <billwert@microsoft.com>
eng/pipelines/coreclr/perf.yml
eng/pipelines/coreclr/templates/build-perf-sample-apps.yml
eng/pipelines/coreclr/templates/perf-job.yml
eng/pipelines/coreclr/templates/run-scenarios-job.yml
eng/testing/performance/android_scenarios.proj
eng/testing/performance/performance-setup.ps1

index 0e274b0..ec233f3 100644 (file)
@@ -239,7 +239,7 @@ jobs:
         runJobTemplate: /eng/pipelines/coreclr/templates/run-scenarios-job.yml
         logicalmachine: 'perfpixel4a'
 
-  # run mono and maui iOS scenarios
+  # run mono iOS scenarios and maui iOS scenarios
   - template: /eng/pipelines/common/platform-matrix.yml
     parameters:
       jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml
@@ -382,7 +382,7 @@ jobs:
         runJobTemplate: /eng/pipelines/coreclr/templates/run-performance-job.yml
         logicalmachine: 'perftiger'
 
-# run coreclr perftiger microbenchmarks pgo perf jobs
+  # run coreclr perftiger microbenchmarks pgo perf jobs
   - template: /eng/pipelines/common/platform-matrix.yml
     parameters:
       jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml
index 3d5d83b..6e8ace4 100644 (file)
@@ -23,6 +23,32 @@ steps:
     - script: make run MONO_ARCH=arm64 DEPLOY_AND_RUN=false
       workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/Android
       displayName: Build HelloAndroid sample app
+    - template: /eng/pipelines/common/upload-artifact-step.yml
+      parameters:
+        rootFolder: $(Build.SourcesDirectory)/artifacts/bin/AndroidSampleApp/arm64/Release/android-arm64/publish/apk/bin/HelloAndroid.apk
+        includeRootFolder: true
+        displayName: Android Mono Artifacts
+        artifactName: AndroidMonoarm64
+        archiveExtension: '.tar.gz'
+        archiveType: tar
+        tarCompression: gz
+    - script: rm -r -f $(Build.SourcesDirectory)/artifacts/bin/AndroidSampleApp
+      workingDirectory: $(Build.SourcesDirectory)/artifacts/bin
+      displayName: clean bindir
+    - script: make run MONO_ARCH=arm64 DEPLOY_AND_RUN=false RUNTIME_COMPONENTS=diagnostics_tracing
+      workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/Android
+      displayName: Build HelloAndroid sample app
+    - script: mv $(Build.SourcesDirectory)/artifacts/bin/AndroidSampleApp/arm64/Release/android-arm64/publish/apk/bin/HelloAndroid.apk $(Build.SourcesDirectory)/artifacts/bin/AndroidSampleApp/arm64/Release/android-arm64/publish/apk/bin/HelloAndroidWithDiag.apk
+    - template: /eng/pipelines/common/upload-artifact-step.yml
+      parameters:
+        rootFolder: $(Build.SourcesDirectory)/artifacts/bin/AndroidSampleApp/arm64/Release/android-arm64/publish/apk/bin/HelloAndroidWithDiag.apk
+        includeRootFolder: true
+        displayName: Android Mono Artifacts With Diag
+        artifactName: AndroidMonoWithDiagarm64
+        archiveExtension: '.tar.gz'
+        archiveType: tar
+        tarCompression: gz
+    
   - ${{ if eq(parameters.osGroup, 'iOS') }}:
     - script: make build-appbundle TARGET=iOS MONO_ARCH=arm64 MONO_CONFIG=Release AOT=True USE_LLVM=False DEPLOY_AND_RUN=false
       env:
@@ -37,13 +63,13 @@ steps:
         artifactName:  ${{ parameters.artifactName }}
     - template: /eng/pipelines/common/upload-artifact-step.yml
       parameters:
-          rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
-          includeRootFolder: true
-          displayName: iOS Sample App NoLLVM
-          artifactName: iOSSampleAppNoLLVM
-          archiveExtension: '.tar.gz'
-          archiveType: tar
-          tarCompression: gz
+        rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
+        includeRootFolder: true
+        displayName: iOS Sample App NoLLVM
+        artifactName: iOSSampleAppNoLLVM
+        archiveExtension: '.tar.gz'
+        archiveType: tar
+        tarCompression: gz
     - script: rm -r -f $(Build.SourcesDirectory)/src/mono/sample/iOS/bin
       workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
       displayName: Clean bindir
@@ -60,31 +86,11 @@ steps:
         artifactName:  ${{ parameters.artifactName }}
     - template: /eng/pipelines/common/upload-artifact-step.yml
       parameters:
-          rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
-          includeRootFolder: true
-          displayName: iOS Sample App LLVM
-          artifactName: iOSSampleAppLLVM
-          archiveExtension: '.tar.gz'
-          archiveType: tar
-          tarCompression: gz
+        rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
+        includeRootFolder: true
+        displayName: iOS Sample App LLVM
+        artifactName: iOSSampleAppLLVM
+        archiveExtension: '.tar.gz'
+        archiveType: tar
+        tarCompression: gz
 
-  - template: /eng/pipelines/common/upload-artifact-step.yml
-    parameters:
-      osGroup: ${{ parameters.osGroup }}
-      osSubgroup: ${{ parameters.osSubgroup }}
-      archType: ${{ parameters.archType }}
-      buildConfig: ${{ parameters.buildConfig }}
-      runtimeFlavor: ${{ parameters.runtimeFlavor }}
-      helixQueues: ${{ parameters.helixQueues }}
-      targetRid: ${{ parameters.targetRid }}
-      nameSuffix: ${{ parameters.nameSuffix }}
-      platform: ${{ parameters.platform }}
-      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
-      rootFolder:  ${{ parameters.rootFolder }}
-      includeRootFolder:  ${{ parameters.includeRootFolder }}
-      displayName:  ${{ parameters.displayName }}
-      artifactName:  ${{ parameters.artifactName }}
-      archiveExtension:  ${{ parameters.archiveExtension }}
-      archiveType:  ${{ parameters.archiveType }}
-      tarCompression:  ${{ parameters.tarCompression }}
-  
index 50941e6..dd1ff0e 100644 (file)
@@ -154,11 +154,11 @@ jobs:
     - ${{ if eq(parameters.runtimeType, 'AndroidMono')}}:
       - template: /eng/pipelines/common/download-artifact-step.yml
         parameters:
-          unpackFolder: $(Build.SourcesDirectory)
+          unpackFolder: $(Build.SourcesDirectory)/androidHelloWorld
           cleanUnpackFolder: false
           artifactFileName: 'AndroidMonoarm64.tar.gz'
           artifactName: 'AndroidMonoarm64'
-          displayName: 'Mono Android runtime'
+          displayName: 'Mono Android HelloWorld'
       - template: /eng/pipelines/common/download-artifact-step.yml
         parameters:
           unpackFolder: $(Build.SourcesDirectory)
@@ -166,8 +166,14 @@ jobs:
           artifactFileName: 'MauiAndroidApp.tar.gz'
           artifactName: 'MauiAndroidApp'
           displayName: 'Maui Android App'
-      
-    
+      - template: /eng/pipelines/common/download-artifact-step.yml
+        parameters:
+          unpackFolder: $(Build.SourcesDirectory)/androidHelloWorldWithDiag
+          cleanUnpackFolder: false
+          artifactFileName: 'AndroidMonoWithDiagarm64.tar.gz'
+          artifactName: 'AndroidMonoWithDiagarm64'
+          displayName: 'Mono Android Diagnostic Helloworld'
+
     # Download iOSMono tests and MauiiOS/MacCatalyst
     - ${{ if eq(parameters.runtimeType, 'iOSMono') }}:
       - template: /eng/pipelines/common/download-artifact-step.yml
index edaf1f4..ab713b3 100644 (file)
@@ -118,26 +118,26 @@ jobs:
       displayName: Copy scenario support files (Linux)
       condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
     # build Startup
-    - script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)\Startup -f netcoreapp3.1 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\Startup\Startup.csproj
+    - script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)\Startup -f net6.0 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\Startup\Startup.csproj
       displayName: Build Startup tool (Windows)
       env:
-        PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1
+        PERFLAB_TARGET_FRAMEWORKS: net6.0
       condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
-    - script: $(PayloadDirectory)/dotnet/dotnet publish -c Release -o $(WorkItemDirectory)/startup -f netcoreapp3.1 -r linux-$(Architecture) $(PerformanceDirectory)/src/tools/ScenarioMeasurement/Startup/Startup.csproj
+    - script: $(PayloadDirectory)/dotnet/dotnet publish -c Release -o $(WorkItemDirectory)/startup -f net6.0 -r linux-$(Architecture) $(PerformanceDirectory)/src/tools/ScenarioMeasurement/Startup/Startup.csproj
       displayName: Build Startup tool (Linux)
       env:
-        PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1
+        PERFLAB_TARGET_FRAMEWORKS: net6.0
       condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
     # build SizeOnDisk
-    - script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)\SOD -f netcoreapp3.1 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\SizeOnDisk\SizeOnDisk.csproj
+    - script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)\SOD -f net6.0 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\SizeOnDisk\SizeOnDisk.csproj
       displayName: Build SizeOnDisk tool (Windows)
       env:
-        PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1
+        PERFLAB_TARGET_FRAMEWORKS: net6.0
       condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
-    - script: $(PayloadDirectory)/dotnet/dotnet publish -c Release -o $(WorkItemDirectory)/SOD -f netcoreapp3.1 -r linux-$(Architecture) $(PerformanceDirectory)/src/tools/ScenarioMeasurement/SizeOnDisk/SizeOnDisk.csproj
+    - script: $(PayloadDirectory)/dotnet/dotnet publish -c Release -o $(WorkItemDirectory)/SOD -f net6.0 -r linux-$(Architecture) $(PerformanceDirectory)/src/tools/ScenarioMeasurement/SizeOnDisk/SizeOnDisk.csproj
       displayName: Build SizeOnDisk tool (Linux)
       env:
-        PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1
+        PERFLAB_TARGET_FRAMEWORKS: net6.0
       condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
       
     # run perf testing in helix
index 338a696..52af8fa 100644 (file)
@@ -1,4 +1,9 @@
 <Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
+  <PropertyGroup>
+      <IncludeXHarnessCli>true</IncludeXHarnessCli>
+      <MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.21566.2</MicrosoftDotNetXHarnessCLIVersion>
+      <XharnessPath>%HELIX_CORRELATION_PAYLOAD%\microsoft.dotnet.xharness.cli\$(MicrosoftDotNetXHarnessCLIVersion)\tools\net6.0\any\Microsoft.DotNet.XHarness.CLI.dll</XharnessPath>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
     <Python>python3</Python>
     <HelixPreCommands>$(HelixPreCommands);chmod +x $HELIX_WORKITEM_PAYLOAD/SOD/SizeOnDisk</HelixPreCommands>
         <Command>$(Python) test.py sod --scenario-name &quot;%(Identity)&quot;</Command>
         <PostCommands>$(Python) post.py</PostCommands>
     </HelixWorkItem>
+    <HelixWorkItem Include="Startup - Android HelloWorld">
+      <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
+      <PreCommands>echo on;set XHARNESSPATH=$(XharnessPath);cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroidWithDiag.apk .;$(Python) pre.py</PreCommands>
+      <Command>$(Python) test.py devicestartup --device-type android --package-path pub\HelloAndroidWithDiag.apk --package-name net.dot.HelloAndroid --exit-code 42 --scenario-name &quot;%(Identity)&quot;</Command>
+      <PostCommands>$(Python) post.py</PostCommands>
+    </HelixWorkItem>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
index 5e2837f..d85325e 100644 (file)
@@ -148,7 +148,13 @@ if ($AndroidMono) {
     {
         mkdir $WorkItemDirectory
     }
-    Copy-Item -path "$SourceDirectory\artifacts\bin\AndroidSampleApp\arm64\Release\android-arm64\publish\apk\bin\HelloAndroid.apk" $PayloadDirectory
+    if(Test-Path "$SourceDirectory\androidHelloWorld\HelloAndroid.apk") {
+        Copy-Item -path "$SourceDirectory\androidHelloWorld\HelloAndroid.apk" $PayloadDirectory -Verbose
+    }
+        
+    if(Test-Path "$SourceDirectory\androidHelloWorldWithDiag\HelloAndroidWithDiag.apk") {
+        Copy-Item -path "$SourceDirectory\androidHelloWorldWithDiag\HelloAndroidWithDiag.apk" $PayloadDirectory -Verbose
+    }
     Copy-Item -path "$SourceDirectory\MauiAndroidDefault.apk" $PayloadDirectory
     $SetupArguments = $SetupArguments -replace $Architecture, 'arm64'
 }