HomePhabricator
Diffusion Comm c85b3e51a769

[CI] Potentially improve reliability of Android CI

Tags
None
Referenced Files
F59485: 1209.png
May 20 2022, 7:09 AM
Subscribers
None

Description

[CI] Potentially improve reliability of Android CI

Summary:
These changes are restricted to the Buildkite CI that gets triggered on arc diff. These changes aren't necessary for the GitHub Actions CI since every build happens in a brand new "clean" virtual environment... and because it has been working without issue (barring unavoidable JCenter/Maven repo 500s).

  1. Include ./gradlew clean step before ./gradlew bundleRelease. This step is included in /native/package.json: yarn clean-all, but doesn't get included in normal yarn cleaninstall.
  2. Specify --no-daemon flag. From the Gradle docs:

Since Gradle 3.0, we enable Daemon by default and recommend using it for both developers' machines and Continuous Integration servers. However, if you suspect that Daemon makes your CI builds unstable, you can disable it to use a fresh runtime for each build since the runtime is completely isolated from any previous builds. (https://docs.gradle.org/current/userguide/gradle_daemon.html)

There's varying opinions online about whether this is necessary, but anecdotally I've noticed quite a few error messages involving the Gradle daemon when scanning through the logs of failed builds. It doesn't seem to add much overhead to the build time, and it seems like there's a possibility that it improves reliability. I haven't tested this in any meaningful/robust way...

  1. Pass in jvmargs from the command-line. Was previously doing this via environment variable (GRADLE_OPTS) and $HOME/gradle.properties... but looks like passing from command-line has highest precedence... and is the only option that has higher precedence than project-level gradle.properties. I was previously mistaken in thinking GRADLE_OPTS and $HOME/gradle.properties were being taken into account when I previously tried to resolve the Out of Memory issue and claimed I'd tried adjusting jvmargs.

Here is the discussion on precedence from the docs (https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties):

1209.png (896×2 px, 266 KB)

Here are the arguments I'm passing:

"-Dorg.gradle.jvmargs=-Xmx32g -XX:MaxPermSize=32g -XX:+HeapDumpOnOutOfMemoryError"

All of the Android CI machines currently have >= 64GB of RAM, may have to adjust this up/down depending on what machine-types we go with in the future. In the future we could be smart about this and get information about available RAM from /proc/meminfo?

Test Plan:
Ran the builds a few times with/without these changes and observed that they took marginally longer with the changes.

I think we'll just need to see over time whether this improves reliability?

Reviewers: palys-swm, ashoat

Reviewed By: ashoat

Subscribers: geekbrother, ashoat, palys-swm, Adrian, yayabosh

Differential Revision: https://phabricator.ashoat.com/D4072

Details

Provenance
atulAuthored on May 18 2022, 10:57 AM
Reviewer
ashoat
Differential Revision
D4072: [CI] Potentially improve reliability of Android CI
Parents
rCOMMd7a2de127bd2: [tunnelbroker] Fix `MESSAGES_TABLE_NAME` constant
Branches
Unknown
Tags
Unknown