-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Update Readme & Provide current context on Hardware Acceleration on Github #279
Update Readme & Provide current context on Hardware Acceleration on Github #279
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just 1 comment on Ubuntu support.
README.md
Outdated
@@ -4,14 +4,18 @@ | |||
<a href="https://github.com/ReactiveCircus/android-emulator-runner"><img alt="GitHub Actions status" src="https://github.com/ReactiveCircus/android-emulator-runner/workflows/Main%20workflow/badge.svg"></a> | |||
</p> | |||
|
|||
A GitHub Action for installing, configuring and running hardware-accelerated Android Emulators on macOS virtual machines. | |||
A GitHub Action for installing, configuring and running Android Emulators on macOS and Ubuntu virtual machines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still important to distinguish between macOs and Ubuntu support. Being able to run in swiftshader_indirect
mode is still way faster than -accel off
. When people read this without any caveat they would expect running the action on linux VMs to be feasible, which is far from the reality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in commit: e860dce
README.md
Outdated
The **macOS** VM provided by **GitHub Actions** has **HAXM** installed so we are able to create a new AVD instance, launch an emulator with hardware acceleration, and run our Android | ||
tests directly on the VM. You can also achieve this on a self-hosted Linux runner, but it will need to be on a compatible instance that allows you to enable KVM - for example AWS EC2 Bare Metal instances. | ||
The **macOS** 10.x VM provided by **GitHub Actions** had **HAXM** [pre-installed](https://github.com/actions/runner-images/blob/main/images/macos/macos-10.15-Readme.md) so we were able to create a new AVD instance, launch an emulator with hardware acceleration and run our Android | ||
tests directly on the VM. However, Github's [macOS-11](https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md) and [macOS-12](https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md) VMs **no longer** come pre-installed with HAXM. See [here](https://github.com/actions/runner-images/issues/183#issuecomment-610723516) and [here](https://github.com/actions/runner-images/issues/6388) for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading this and checking the links - I find myself asking, "So, how do I install HAXM then, and do I need to?" We should either point at how to do that (if possible), or explain why we don't need it (if that's so).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattjohnsonpint Good call. Will add this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in commit: e860dce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm even more confused now, as the gist shows scripting the emulator directly instead of using the react-android-emulator
action.
FWIW, I'm not installing HAXM, and for the most part, react-android-emulator
is working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattjohnsonpint Oh whoops, good call! I accidentally linked the wrong gist (same thing but without android-emulator-runner) Thank you!
fixed in 592f866
Sorry, but I'm still quite confused about what's actually being said here. According to https://developer.android.com/studio/run/emulator-acceleration, the flag I tried installing haxm and then setting the flag to
... and then the AVD fails to boot. So if we can't use hardware acceleration, why are you recommending we install haxm? |
Looking closer at the existing readme, on the first line:
If we have to use software acceleration with Don't get me wrong - I'd still much rather use this action than to script all the emulator commands myself, but does it actually support hardware-accelerated emulators? |
Oh, wait a sec. I think I was confused between the GPU acceleration mode and the VM acceleration mode. Am I understanding correctly then, that the GPU mode must stay software accelerated with |
@mattjohnsonpint Yes, my understanding is that you can choose between CPU vs GPU for Graphics Acceleration, and this is different from VM Acceleration. You can utilize VM-Acceleration if there is Hypervisor + enabled IVT(Intel Virtualization Technology (VT, VT-x, vmx) extensions), and if the emulator is not inside another VM -- which means VM-Acceleration is usually not possible on Ubuntu agents scaled with something like VMSphere. So, if we have From what I can tell, for some reason One question I need to test is using SKIA rendering. I'm not sure if SKIA completely replaces host/swiftshader_indirect for screen rendering, or if it can be used with both of them. My assumption is that SKIA will be an option to use instead of I also wish there was a way for me to more easily communicate with the Google Emulator team to clear this up, so if anyone has suggestions on that please let me know. I will add more clarity to the readme regarding this. |
README.md
Outdated
@@ -6,12 +6,21 @@ | |||
|
|||
A GitHub Action for installing, configuring and running hardware-accelerated Android Emulators on macOS virtual machines. | |||
|
|||
The old ARM-based emulators were slow and are no longer supported by Google. The modern Intel Atom (x86 and x86_64) emulators require hardware acceleration (HAXM on Mac & Windows, QEMU on Linux) from the host to run fast. This presents a challenge on CI as to be able to run hardware accelerated emulators within a docker container, **KVM** must be supported by the host VM which isn't the case for cloud-based CI providers due to infrastructural limits. If you want to learn more about this, here's an article I wrote: [Running Android Instrumented Tests on CI](https://dev.to/ychescale9/running-android-emulators-on-ci-from-bitrise-io-to-github-actions-3j76). | |||
The old ARM-based emulators were slow and are no longer supported by Google. The modern Intel Atom (x86 and x86_64) emulators can be fast, but rely on two forms of hardware acceleration to reach their peak potential: [Graphics Acceleration](https://developer.android.com/studio/run/emulator-acceleration#accel-graphics), e.g. `emulator -accel on` and [Virtual Machine(VM) Acceleration](https://developer.android.com/studio/run/emulator-acceleration#accel-vm), e.g. `emulator -gpu host`. Note: GPU and VM Acceleration are two different and non-mutually exclusive forms of Hardware Acceleration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the examples given are reversed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattjohnsonpint Thank you so much for catching this!! I really appreciate it. Addressed in 8f64fa8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great now. Thanks!
Note: This PR also helps address #270 |
See also: intel/haxm#403 for info on installing HAXM |
One of the jobs failed due to an emulator timeout on boot. Since I couldn't rerun the tests I tried to add a method in which contributors could comment "run tests" on a PR to re-run the Ideally the comment would run the workflow against the latest commit of the PR, and update the failed checks. Even better would be a method to rerun all failed or cancelled jobs, instead of running all of them -- but I do not believe that is currently supported. (I put in a discussion post here) to request that, or see if it is possible. |
The current readme felt a bit disingenuous & outdated given the current situation with Github's Hosted Runners.
This PR is a general update & rephrasing of the README to provide more clarity, and is an attempt to give a more accurate representation of the state of the action.
See: actions/runner-images#6388 , actions/runner-images#183 (comment)