Skip to content
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

Nightly builds with baseline profiles #1173

Merged
merged 27 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
22d0598
Test baseline profiles for all variants
keyboardsurfer Jan 22, 2024
228f95a
Remove stale baseline-prof.txt
keyboardsurfer Jan 22, 2024
46cbde8
Enable nightly builds and revert Build.yaml
keyboardsurfer Jan 22, 2024
60514dd
Add nightly build status to README
keyboardsurfer Jan 23, 2024
e3c9dc3
Remove unneded steps from nightly baseline profile creation
keyboardsurfer Apr 19, 2024
34a666d
Skip baseline profile generation with new property
keyboardsurfer Apr 24, 2024
5d861df
Enable Startup Profile generation for release builds
keyboardsurfer Sep 5, 2024
18196da
🤖 Updates baselines for Dependency Guard
keyboardsurfer Sep 5, 2024
f599079
🤖 Updates baselines for Dependency Guard
keyboardsurfer Sep 5, 2024
5e41452
Remove build status and add generated profiles to gitignore
keyboardsurfer Sep 5, 2024
8957068
Remove unnecessary comment
keyboardsurfer Sep 5, 2024
8ed80b4
Remove services.json file
keyboardsurfer Sep 5, 2024
d7ce57f
Lower GMD specs
keyboardsurfer Sep 9, 2024
d88cbc9
Disable configuration caching
keyboardsurfer Sep 10, 2024
2ea4c91
Update GMD and Android SDK setup
keyboardsurfer Sep 10, 2024
8dce2c0
Add Android SDK setup for GMD
keyboardsurfer Sep 11, 2024
a25c3ba
Add options test options for GMD startup
keyboardsurfer Sep 11, 2024
1f5d001
Skipping BP generation for regular Builds
keyboardsurfer Sep 11, 2024
3e3068e
Enable KVM for GMD during assembly
keyboardsurfer Sep 11, 2024
9313580
Add custom timeout waiting for GMD
keyboardsurfer Sep 11, 2024
97bb642
Use pixel 5 sdk 33 GMD
keyboardsurfer Sep 12, 2024
784393d
Ensuring only one device is used for bp / benchmark
keyboardsurfer Sep 12, 2024
7b10f00
Apply guidance from issuetracker
keyboardsurfer Sep 12, 2024
07132e8
Setup GMD in separate step
keyboardsurfer Sep 13, 2024
d7bfa2d
Add GMD setup to all workflows
keyboardsurfer Sep 13, 2024
5017eb5
Remove system image download
keyboardsurfer Sep 18, 2024
bc0c7e4
Add new metrics for baseline profile measurement
keyboardsurfer Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions .github/workflows/Build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
ls /dev/kvm

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

Expand All @@ -40,6 +47,12 @@ jobs:
validate-wrappers: true
gradle-home-cache-cleanup: true

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Accept licenses
run: yes | sdkmanager --licenses || true

- name: Check build-logic
run: ./gradlew check -p build-logic

Expand Down Expand Up @@ -101,19 +114,22 @@ jobs:
commit_message: "🤖 Updates screenshots"

# Run local tests after screenshot tests to avoid wrong UP-TO-DATE. TODO: Ignore screenshots.
- name: Run local tests and create report
if: always()
- name: Run local tests
run: ./gradlew testDemoDebug :lint:test
# Replace task exclusions with `-Pandroidx.baselineprofile.skipgeneration` when
# https://android-review.googlesource.com/c/platform/frameworks/support/+/2602790 landed in a
# release build

- name: Setup GMD
keyboardsurfer marked this conversation as resolved.
Show resolved Hide resolved
run: ./gradlew :benchmarks:pixel6Api33Setup
--info
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"

- name: Build all build type and flavor permutations
run: ./gradlew :app:assemble :benchmarks:assemble
-x pixel6Api33ProdNonMinifiedReleaseAndroidTest
-x pixel6Api33DemoNonMinifiedReleaseAndroidTest
-x collectDemoNonMinifiedReleaseBaselineProfile
-x collectProdNonMinifiedReleaseBaselineProfile
run: ./gradlew :app:assemble :benchmarks:assemble -Pandroidx.baselineprofile.skipgeneration
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.experimental.androidTest.numManagedDeviceShards=1
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1
-Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=5

- name: Upload build outputs (APKs)
uses: actions/upload-artifact@v4
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/NightlyBaselineProfiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: NightlyBaselineProfiles

on:
schedule:
- cron: '42 4 * * *'

jobs:
baseline_profiles:
name: "Generate Baseline Profiles"
runs-on: ubuntu-latest

permissions:
contents: write

timeout-minutes: 60

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
keyboardsurfer marked this conversation as resolved.
Show resolved Hide resolved

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup GMD
run: ./gradlew :benchmarks:pixel6Api33Setup
--info
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"

- name: Build all build type and flavor permutations including baseline profiles
run: ./gradlew :app:assemble
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
14 changes: 10 additions & 4 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ jobs:
validate-wrappers: true
gradle-home-cache-cleanup: true

- name: Install GMD image for baseline profile generation
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager "system-images;android-33;aosp_atd;x86_64"
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
- name: Accept licenses
run: yes | sdkmanager --licenses || true

- name: Setup GMD
run: ./gradlew :benchmarks:pixel6Api33Setup
--info
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"

- name: Build release variant including baseline profile generation
run: ./gradlew :app:assembleDemoRelease
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ bin/
gen/
out/
build/
generated/

# Local configuration file (sdk path, etc)
local.properties
Expand Down
2 changes: 1 addition & 1 deletion app-nia-catalog/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.3
androidx.lifecycle:lifecycle-viewmodel:2.8.3
androidx.loader:loader:1.0.0
androidx.metrics:metrics-performance:1.0.0-alpha04
androidx.metrics:metrics-performance:1.0.0-beta01
androidx.profileinstaller:profileinstaller:1.3.1
androidx.savedstate:savedstate-ktx:1.2.1
androidx.savedstate:savedstate:1.2.1
Expand Down
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ baselineProfile {
// Don't build on every iteration of a full assemble.
// Instead enable generation directly for the release build variant.
automaticGenerationDuringBuild = false

// Make use of Dex Layout Optimizations via Startup Profiles
dexLayoutOptimization = true
}

dependencyGuard {
Expand Down
2 changes: 1 addition & 1 deletion app/dependencies/prodReleaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.3
androidx.lifecycle:lifecycle-viewmodel:2.8.3
androidx.loader:loader:1.0.0
androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
androidx.metrics:metrics-performance:1.0.0-alpha04
androidx.metrics:metrics-performance:1.0.0-beta01
androidx.navigation:navigation-common-ktx:2.8.0
androidx.navigation:navigation-common:2.8.0
androidx.navigation:navigation-compose:2.8.0
Expand Down
Loading
Loading