Skip to content

Use 4-core Linux for Android device tests - #2139

Merged
mattjohnsonpint merged 10 commits into
mainfrom
gha-large-runner
Mar 3, 2023
Merged

mattjohnsonpint merged 10 commits into
mainfrom
gha-large-runner

Conversation

@mattjohnsonpint

@mattjohnsonpint mattjohnsonpint commented Jan 30, 2023 •

Copy link
Copy Markdown
Contributor

When running the Android device tests, lets run the Android emulator on a 4-core Linux "larger runner" instead of the macOS runner.

For Linux, this only works on larger runners, because the 2-core default Linux runners are on hardware that does not support nested virtualization. We were running them previously on macOS, which do support nested virtualization but for some reason are still flaky when trying to use it.

This is in hopes that we have fewer intermittent test failures related to the emulator failing to boot.

It also happens to be cheaper.

#skip-changelog

@mattjohnsonpint

mattjohnsonpint commented Feb 26, 2023 •

Copy link
Copy Markdown
Contributor Author

This blog post from GitHub has the additional detail needed to enable KVM nested virtualization, which the Android emulator requires:

https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/

@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

It works! Had to change the cache key to not use the AVDs created from the macOS runner. Other than that, was pretty straightforward.

Also tested if hardware GPU acceleration (-gpu host) works, but it does not. We'll stick with -gpu swiftshader_indirect.

@mattjohnsonpint
mattjohnsonpint marked this pull request as ready for review March 1, 2023 23:43
@mattjohnsonpint
mattjohnsonpint enabled auto-merge (squash) March 1, 2023 23:44
@mattjohnsonpint mattjohnsonpint changed the title Try 4-core Linux for Android device tests Use 4-core Linux for Android device tests Mar 1, 2023
@mattjohnsonpint
mattjohnsonpint disabled auto-merge March 1, 2023 23:57
@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

Seems to be working well now. This is a representative run (uses cached avds from prior run):
https://github.com/getsentry/sentry-dotnet/actions/runs/4308804445

image

May be possible to optimize further, but this is pretty good. Seems to be stable so far also.

@mattjohnsonpint
mattjohnsonpint marked this pull request as draft March 2, 2023 01:33
@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

Holding temporarily for internal review, but it does all work.

@bruno-garcia

Copy link
Copy Markdown
Member

Seems to be working well now. This is a representative run (uses cached avds from prior run): https://github.com/getsentry/sentry-dotnet/actions/runs/4308804445

image

May be possible to optimize further, but this is pretty good. Seems to be stable so far also.

That compares to:
image
?

@mattjohnsonpint
mattjohnsonpint marked this pull request as ready for review March 3, 2023 19:05
@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

When they work, the perf is about the same. It does vary somewhat between runs though.

The problem is that they often don't work. If the emulator fails to boot, the test eventually times out. Then we have to re-run the failed jobs. The hope is that running on Linux will be more stable. Either way, they're definitely cheaper.

@mattjohnsonpint
mattjohnsonpint enabled auto-merge (squash) March 3, 2023 19:10
@mattjohnsonpint
mattjohnsonpint merged commit 2f6319e into main Mar 3, 2023
@mattjohnsonpint
mattjohnsonpint deleted the gha-large-runner branch March 3, 2023 19:22
ric-oliv added a commit that referenced this pull request Oct 24, 2026
The emulator jobs ran on the ubuntu-latest-4-cores larger runner. #2139
moved them there in 2023 because the 2-core standard runners couldn't
run a hardware-accelerated emulator. Since April 2024 they can, with the
same KVM udev rule this workflow already sets, and on public
repositories ubuntu-latest now has 4 CPUs and 16 GB of RAM.

The standard runner has less disk, so the jobs print the free space
before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ric-oliv added a commit that referenced this pull request Oct 25, 2026
The emulator jobs ran on the ubuntu-latest-4-cores larger runner. #2139
moved them there in 2023 because the 2-core standard runners couldn't
run a hardware-accelerated emulator. Since April 2024 they can, with
the same KVM udev rule this workflow already sets, and on public
repositories ubuntu-latest now has 4 CPUs and 16 GB of RAM. Both the
device test and the integration test jobs move.

On the first runs the device tests took 2.5 to 4.5 minutes, against
2.3 to 4.4 on the larger runner, with the same 2,921 tests. The
standard runner listed less disk, but had 88 GB free at the start and
67 at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ric-oliv added a commit that referenced this pull request Oct 26, 2026
The emulator jobs ran on the ubuntu-latest-4-cores larger runner. #2139
moved them there in 2023 because the 2-core standard runners couldn't
run a hardware-accelerated emulator. Since April 2024 they can, with
the same KVM udev rule this workflow already sets, and on public
repositories ubuntu-latest now has 4 CPUs and 16 GB of RAM. Both the
device test and the integration test jobs move.

On the first runs the device tests took 2.5 to 4.5 minutes, against
2.3 to 4.4 on the larger runner, with the same 2,921 tests. The
standard runner listed less disk, but had 88 GB free at the start and
67 at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ric-oliv added a commit that referenced this pull request Oct 27, 2026
The emulator jobs ran on the ubuntu-latest-4-cores larger runner. #2139
moved them there in 2023 because the 2-core standard runners couldn't
run a hardware-accelerated emulator. Since April 2024 they can, with
the same KVM udev rule this workflow already sets, and on public
repositories ubuntu-latest now has 4 CPUs and 16 GB of RAM. Both the
device test and the integration test jobs move.

On the first runs the device tests took 2.5 to 4.5 minutes, against
2.3 to 4.4 on the larger runner, with the same 2,921 tests. The
standard runner listed less disk, but had 88 GB free at the start and
67 at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ric-oliv added a commit that referenced this pull request Oct 27, 2026
The emulator jobs ran on the ubuntu-latest-4-cores larger runner. #2139
moved them there in 2023 because the 2-core standard runners couldn't
run a hardware-accelerated emulator. Since April 2024 they can, with
the same KVM udev rule this workflow already sets, and on public
repositories ubuntu-latest now has 4 CPUs and 16 GB of RAM. Both the
device test and the integration test jobs move.

On the first runs the device tests took 2.5 to 4.5 minutes, against
2.3 to 4.4 on the larger runner, with the same 2,921 tests. The
standard runner listed less disk, but had 88 GB free at the start and
67 at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ric-oliv added a commit that referenced this pull request Oct 27, 2026
The emulator jobs ran on the ubuntu-latest-4-cores larger runner. #2139
moved them there in 2023 because the 2-core standard runners couldn't
run a hardware-accelerated emulator. Since April 2024 they can, with
the same KVM udev rule this workflow already sets, and on public
repositories ubuntu-latest now has 4 CPUs and 16 GB of RAM. Both the
device test and the integration test jobs move.

On the first runs the device tests took 2.5 to 4.5 minutes, against
2.3 to 4.4 on the larger runner, with the same 2,921 tests. The
standard runner listed less disk, but had 88 GB free at the start and
67 at the end.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants