From 1079e8978d60457bfa6d272a63e631dec500edc0 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Mon, 30 Sep 2024 10:24:05 -0400 Subject: [PATCH 01/24] add free disk space step --- .github/workflows/android.yaml | 4 ++++ ci/free_disk_space.sh | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100755 ci/free_disk_space.sh diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index b65db506..8edacf30 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -138,6 +138,8 @@ jobs: - name: Check Licenses for modules working-directory: ./platform/jvm run: ./gradlew replay:checkLicense common:checkLicense # capture:checkLicense doesn't work at the moment + - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. + run: ./ci/free_disk_space.sh - name: Instrumentation Tests uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2.32 with: @@ -198,6 +200,8 @@ jobs: profile: Nexus 6 emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: echo "Generated AVD snapshot for caching." + - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. + run: ./ci/free_disk_space.sh - name: run tests uses: reactivecircus/android-emulator-runner@v2 timeout-minutes: 15 diff --git a/ci/free_disk_space.sh b/ci/free_disk_space.sh new file mode 100755 index 00000000..c5db81e8 --- /dev/null +++ b/ci/free_disk_space.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -euxo pipefail + +# Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. + +rm -rf "$AGENT_TOOLSDIRECTORY" +rm -rf /usr/share/dotnet +rm -rf /opt/ghc... +rm -f /mnt/swapfile From b94066644933957c0f6e3ad9f7fb6394b8b4e03f Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Mon, 30 Sep 2024 10:31:19 -0400 Subject: [PATCH 02/24] make tests blocking again --- .github/workflows/android.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 8edacf30..13dfa838 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -230,6 +230,4 @@ jobs: with: fetch-depth: 1 - name: check result - run: ./ci/check_result.sh ${{ needs.pre_check.result }} && ./ci/check_result.sh ${{ needs.build_apk.result }} - # TODO(snowp): Re-enable these checks once we fix the emulator issues - # && ./ci/check_result.sh ${{ needs.verify_android_hello_world_per_version.result }} && ./ci/check_result.sh ${{ needs.gradle_tests.result }} + run: ./ci/check_result.sh ${{ needs.pre_check.result }} && ./ci/check_result.sh ${{ needs.build_apk.result }} && ./ci/check_result.sh ${{ needs.verify_android_hello_world_per_version.result }} && ./ci/check_result.sh ${{ needs.gradle_tests.result }} From 5a54a781c14f85128d04cb4ec7b55d04ad6c4645 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Mon, 30 Sep 2024 10:31:30 -0400 Subject: [PATCH 03/24] do tnoi remove swapfile --- ci/free_disk_space.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/free_disk_space.sh b/ci/free_disk_space.sh index c5db81e8..6d7c682e 100755 --- a/ci/free_disk_space.sh +++ b/ci/free_disk_space.sh @@ -7,4 +7,3 @@ set -euxo pipefail rm -rf "$AGENT_TOOLSDIRECTORY" rm -rf /usr/share/dotnet rm -rf /opt/ghc... -rm -f /mnt/swapfile From b855866834017a3b3dd577c82df3c9721c354a52 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Mon, 30 Sep 2024 10:32:38 -0400 Subject: [PATCH 04/24] disable swap --- ci/free_disk_space.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/free_disk_space.sh b/ci/free_disk_space.sh index 6d7c682e..31eb3c9a 100755 --- a/ci/free_disk_space.sh +++ b/ci/free_disk_space.sh @@ -7,3 +7,7 @@ set -euxo pipefail rm -rf "$AGENT_TOOLSDIRECTORY" rm -rf /usr/share/dotnet rm -rf /opt/ghc... + +# Disable swap to make it possible to clean up swap strorage. +swapoff -a +rm -f /mnt/swapfile \ No newline at end of file From 1b219b21eb6ef966fcd62ea276ecbde1e5b0bce2 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Mon, 30 Sep 2024 10:38:23 -0400 Subject: [PATCH 05/24] use sudo --- ci/free_disk_space.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/free_disk_space.sh b/ci/free_disk_space.sh index 31eb3c9a..7d35b1c1 100755 --- a/ci/free_disk_space.sh +++ b/ci/free_disk_space.sh @@ -9,5 +9,5 @@ rm -rf /usr/share/dotnet rm -rf /opt/ghc... # Disable swap to make it possible to clean up swap strorage. -swapoff -a +sudo swapoff -a rm -f /mnt/swapfile \ No newline at end of file From 138edf046c3c2c6b47b73b4ea84ea5e5806c1f85 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Mon, 30 Sep 2024 10:45:30 -0400 Subject: [PATCH 06/24] use sudo --- ci/free_disk_space.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/free_disk_space.sh b/ci/free_disk_space.sh index 7d35b1c1..96598e49 100755 --- a/ci/free_disk_space.sh +++ b/ci/free_disk_space.sh @@ -10,4 +10,4 @@ rm -rf /opt/ghc... # Disable swap to make it possible to clean up swap strorage. sudo swapoff -a -rm -f /mnt/swapfile \ No newline at end of file +sudo rm -f /mnt/swapfile \ No newline at end of file From a21b13c56c50f41dc4d3c9b6421657dbd6f5e6a9 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Mon, 30 Sep 2024 11:00:17 -0400 Subject: [PATCH 07/24] reorder steps --- .github/workflows/android.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 13dfa838..cacca75a 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -116,6 +116,8 @@ jobs: ~/.android/avd/* ~/.android/adb* key: ${{ runner.os }}-avd-api-21-2 + - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. + run: ./ci/free_disk_space.sh - name: Create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' timeout-minutes: 30 @@ -138,8 +140,6 @@ jobs: - name: Check Licenses for modules working-directory: ./platform/jvm run: ./gradlew replay:checkLicense common:checkLicense # capture:checkLicense doesn't work at the moment - - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. - run: ./ci/free_disk_space.sh - name: Instrumentation Tests uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2.32 with: @@ -186,6 +186,8 @@ jobs: ~/.android/avd/* ~/.android/adb* key: ${{ runner.os }}-avd-api${{ matrix.api-level }}-1 + - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. + run: ./ci/free_disk_space.sh - name: Create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' timeout-minutes: 30 @@ -200,8 +202,6 @@ jobs: profile: Nexus 6 emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: echo "Generated AVD snapshot for caching." - - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. - run: ./ci/free_disk_space.sh - name: run tests uses: reactivecircus/android-emulator-runner@v2 timeout-minutes: 15 From 934923654426cea9845a87c9e93ff31275a0de01 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Mon, 30 Sep 2024 11:11:39 -0400 Subject: [PATCH 08/24] reorder again --- .github/workflows/android.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index cacca75a..e08ee336 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -93,6 +93,8 @@ jobs: steps: - name: Checkout project sources uses: actions/checkout@v4 + - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. + run: ./ci/free_disk_space.sh # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ - name: Enable KVM group perms @@ -116,8 +118,6 @@ jobs: ~/.android/avd/* ~/.android/adb* key: ${{ runner.os }}-avd-api-21-2 - - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. - run: ./ci/free_disk_space.sh - name: Create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' timeout-minutes: 30 @@ -167,6 +167,8 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. + run: ./ci/free_disk_space.sh # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ - name: Enable KVM group perms @@ -186,8 +188,6 @@ jobs: ~/.android/avd/* ~/.android/adb* key: ${{ runner.os }}-avd-api${{ matrix.api-level }}-1 - - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. - run: ./ci/free_disk_space.sh - name: Create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' timeout-minutes: 30 From f16b56d16cff81adce7392329e4cf3be485dac94 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 10:24:06 -0400 Subject: [PATCH 09/24] try diff ubuntu version --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index e08ee336..11d0fea7 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -66,7 +66,7 @@ jobs: run: ./ci/run_tests.sh build_apk: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: needs.pre_check.outputs.should_run == 'true' needs: pre_check steps: From d32cd7f3f74bf1e7287e34336b6950a56d4f9e7e Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 10:46:19 -0400 Subject: [PATCH 10/24] increase limits --- .github/workflows/android.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 11d0fea7..e0bae298 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -147,9 +147,9 @@ jobs: force-avd-creation: false api-level: 21 target: default - ram-size: 2048M + ram-size: 3072M arch: x86_64 - disk-size: 4096M + disk-size: 6144 profile: Nexus 6 disable-animations: true emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none From 7a0f27c4fcea5944db69f702d7e3b1987e1ec1e1 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 10:52:51 -0400 Subject: [PATCH 11/24] bump machines --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index e0bae298..8c151ee4 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -85,7 +85,7 @@ jobs: path: ./bazel-bin/examples/android/android_app.apk gradle_tests: # Requires a "larger runner", for nested virtualization support - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores env: SKIP_PROTO_GEN: 1 if: needs.pre_check.outputs.should_run == 'true' From 8fb63b0ba6df52244743f4cace2b6be30bb69be5 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 11:02:15 -0400 Subject: [PATCH 12/24] bump channel to release --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 8c151ee4..ca34a0bb 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -143,7 +143,7 @@ jobs: - name: Instrumentation Tests uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2.32 with: - channel: beta + channel: release force-avd-creation: false api-level: 21 target: default From fd58b2c763d5b80dac463296ded9102b0f1a18cd Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 11:06:50 -0400 Subject: [PATCH 13/24] use stable channel --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index ca34a0bb..76e25f26 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -143,7 +143,7 @@ jobs: - name: Instrumentation Tests uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2.32 with: - channel: release + channel: stable force-avd-creation: false api-level: 21 target: default From 8cbd7dae2dc69164f6095792b637e9655a378244 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 11:14:18 -0400 Subject: [PATCH 14/24] remove free disk space script --- .github/workflows/android.yaml | 14 +++++--------- ci/free_disk_space.sh | 13 ------------- 2 files changed, 5 insertions(+), 22 deletions(-) delete mode 100755 ci/free_disk_space.sh diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 76e25f26..f4849ccd 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -93,8 +93,6 @@ jobs: steps: - name: Checkout project sources uses: actions/checkout@v4 - - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. - run: ./ci/free_disk_space.sh # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ - name: Enable KVM group perms @@ -123,7 +121,7 @@ jobs: timeout-minutes: 30 uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2.32 with: - channel: beta + channel: stable force-avd-creation: false api-level: 21 target: default @@ -147,9 +145,9 @@ jobs: force-avd-creation: false api-level: 21 target: default - ram-size: 3072M + ram-size: 2048M arch: x86_64 - disk-size: 6144 + disk-size: 4096M profile: Nexus 6 disable-animations: true emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none @@ -167,8 +165,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Clean up space # Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. - run: ./ci/free_disk_space.sh # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ - name: Enable KVM group perms @@ -193,7 +189,7 @@ jobs: timeout-minutes: 30 uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2 with: - channel: beta + channel: stable api-level: ${{ matrix.api-level }} target: google_apis ram-size: 2048M @@ -207,7 +203,7 @@ jobs: timeout-minutes: 15 with: force-avd-creation: false - channel: beta + channel: stable api-level: ${{ matrix.api-level }} target: google_apis ram-size: 2048M diff --git a/ci/free_disk_space.sh b/ci/free_disk_space.sh deleted file mode 100755 index 96598e49..00000000 --- a/ci/free_disk_space.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -# Refer to https://github.com/ReactiveCircus/android-emulator-runner/issues/377#issuecomment-2296679727 for more details. - -rm -rf "$AGENT_TOOLSDIRECTORY" -rm -rf /usr/share/dotnet -rm -rf /opt/ghc... - -# Disable swap to make it possible to clean up swap strorage. -sudo swapoff -a -sudo rm -f /mnt/swapfile \ No newline at end of file From ef9eb9bf5b6fc4e98dc423403c2d75e71875503e Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 11:18:23 -0400 Subject: [PATCH 15/24] move to ubuntu-latest. --- .github/workflows/android.yaml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index f4849ccd..a0afd1ec 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -66,7 +66,7 @@ jobs: run: ./ci/run_tests.sh build_apk: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest if: needs.pre_check.outputs.should_run == 'true' needs: pre_check steps: @@ -84,8 +84,10 @@ jobs: name: android_app.apk path: ./bazel-bin/examples/android/android_app.apk gradle_tests: - # Requires a "larger runner", for nested virtualization support - runs-on: ubuntu-latest-8-cores + # Note: The emulator used in this CI job is effectively not accelerated, as doing so would require using + # "ubuntu-latest-8-cores" GitHub runners. + # Refer to https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ for more details. + runs-on: ubuntu-latest env: SKIP_PROTO_GEN: 1 if: needs.pre_check.outputs.should_run == 'true' @@ -94,19 +96,13 @@ jobs: - name: Checkout project sources uses: actions/checkout@v4 - # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ - - 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 - - name: set up JDK 17 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '17' cache: gradle - - name: Setup Rust ARM target + - name: Set up Rust ARM target run: rustup update && rustup target add aarch64-linux-android && rustup target add x86_64-linux-android - name: AVD cache uses: actions/cache@v4 From 896b8b197752de076150b0828940d90daaf66402 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 11:33:02 -0400 Subject: [PATCH 16/24] increase disk size --- .github/workflows/android.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index a0afd1ec..2e7e9c3e 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -123,7 +123,7 @@ jobs: target: default ram-size: 2048M arch: x86_64 - disk-size: 4096M + disk-size: 8192M profile: Nexus 6 disable-animations: true emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none @@ -143,7 +143,7 @@ jobs: target: default ram-size: 2048M arch: x86_64 - disk-size: 4096M + disk-size: 8192M profile: Nexus 6 disable-animations: true emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none @@ -190,7 +190,7 @@ jobs: target: google_apis ram-size: 2048M arch: x86_64 - disk-size: 4096M + disk-size: 8192M profile: Nexus 6 emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: echo "Generated AVD snapshot for caching." @@ -204,7 +204,7 @@ jobs: target: google_apis ram-size: 2048M arch: x86_64 - disk-size: 4096M + disk-size: 8192M profile: Nexus 6 emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: ./ci/verify_android.sh From fae2ee1b9477c7bc90731f4f64870542b9874d80 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 11:58:30 -0400 Subject: [PATCH 17/24] disable acceleration --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 2e7e9c3e..d3a62562 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -146,7 +146,7 @@ jobs: disk-size: 8192M profile: Nexus 6 disable-animations: true - emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: cd platform/jvm && adb uninstall io.bitdrift.gradletestapp.test; adb uninstall io.bitdrift.gradletestapp; cd ../.. && ./tools/android_sdk_wrapper.sh platform/jvm/gradlew -p platform/jvm gradle-test-app:check gradle-test-app:connectedCheck --stacktrace verify_android_hello_world_per_version: From a0c338f7e94356a0801bf810ec6f428570a5741b Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 12:44:49 -0400 Subject: [PATCH 18/24] less disk space --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index d3a62562..ff9a0e73 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -143,7 +143,7 @@ jobs: target: default ram-size: 2048M arch: x86_64 - disk-size: 8192M + disk-size: 6144M profile: Nexus 6 disable-animations: true emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none From c4d2ebdc79ae4ac6a571e3097a4d4cf9e4917f58 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 12:58:20 -0400 Subject: [PATCH 19/24] :hammer: From 191af3238b61d20702a1e0f17ccaf7961d3a5ae5 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 13:16:57 -0400 Subject: [PATCH 20/24] try to add 8 cores back --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index ff9a0e73..7552a9ca 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -87,7 +87,7 @@ jobs: # Note: The emulator used in this CI job is effectively not accelerated, as doing so would require using # "ubuntu-latest-8-cores" GitHub runners. # Refer to https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ for more details. - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores env: SKIP_PROTO_GEN: 1 if: needs.pre_check.outputs.should_run == 'true' From bad73984f06c153535f628c81caf9c47c16a226a Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 13:49:22 -0400 Subject: [PATCH 21/24] revert virtualization changes --- .github/workflows/android.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 7552a9ca..af97f167 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -84,9 +84,7 @@ jobs: name: android_app.apk path: ./bazel-bin/examples/android/android_app.apk gradle_tests: - # Note: The emulator used in this CI job is effectively not accelerated, as doing so would require using - # "ubuntu-latest-8-cores" GitHub runners. - # Refer to https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ for more details. + # Requires a "larger runner", for nested virtualization support runs-on: ubuntu-latest-8-cores env: SKIP_PROTO_GEN: 1 @@ -96,6 +94,12 @@ jobs: - name: Checkout project sources uses: actions/checkout@v4 + # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ + - 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 - name: Set up JDK 17 uses: actions/setup-java@v4 with: @@ -146,7 +150,7 @@ jobs: disk-size: 6144M profile: Nexus 6 disable-animations: true - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: cd platform/jvm && adb uninstall io.bitdrift.gradletestapp.test; adb uninstall io.bitdrift.gradletestapp; cd ../.. && ./tools/android_sdk_wrapper.sh platform/jvm/gradlew -p platform/jvm gradle-test-app:check gradle-test-app:connectedCheck --stacktrace verify_android_hello_world_per_version: @@ -204,7 +208,7 @@ jobs: target: google_apis ram-size: 2048M arch: x86_64 - disk-size: 8192M + disk-size: 6144M profile: Nexus 6 emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: ./ci/verify_android.sh From 90dea9728b4fcbd4d45111398788c01e906f8b06 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 13:49:30 -0400 Subject: [PATCH 22/24] lower disk-space bump --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index af97f167..d3335829 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -194,7 +194,7 @@ jobs: target: google_apis ram-size: 2048M arch: x86_64 - disk-size: 8192M + disk-size: 6144M profile: Nexus 6 emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: echo "Generated AVD snapshot for caching." From 1b24dc460bac092ea245cde4a20cf825c102838c Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 13:51:42 -0400 Subject: [PATCH 23/24] lower disk space bump --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index d3335829..6b2e7cde 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -127,7 +127,7 @@ jobs: target: default ram-size: 2048M arch: x86_64 - disk-size: 8192M + disk-size: 6144M profile: Nexus 6 disable-animations: true emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none From 5187b8d8fafafc85a66981609ae6cb655b78ac73 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Tue, 1 Oct 2024 13:59:53 -0400 Subject: [PATCH 24/24] fix spacing --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 6b2e7cde..b91b13ff 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -94,7 +94,7 @@ jobs: - name: Checkout project sources uses: actions/checkout@v4 - # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ + # See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ - 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