android-ci: echo the artifact digests and deflated native-lib sizes (evidence follow-up to #113) #114

Merged
sirius merged 2 commits from onionwire/t_f05be394-evidence-digest into main 2026-09-18 22:53:43 +00:00
Owner

Follow-up to #113, which is merged and green (android-ci / android success on 3860c3d).

Two evidence gaps the merged run left, both in the run log rather than in the app:

  • sha256sum -c printed OK for the APK and the AAR but never the digests, so the artifact's identity was not recoverable from the run (and an APK is not byte-reproducible across machines, so it cannot be derived later).
  • unzip -l printed the uncompressed size of every .so; the deflated entry — what the download actually pays for — was nowhere.

Both are now echoed. android/CUPRATE_DAEMON.md also gets the two remaining CI-cost cells filled in from run 412 (APK 34,445,514 B / AAR 15,728,039 B, 11m 12s job, 5.6 G /cargo-target), and the honest shape of the cost: the first feature-on build is the 44-minute one (run 406), later builds settle at ~+2 min over the feature-off baseline.

No behaviour change: workflow reporting lines plus a doc table.

Follow-up to #113, which is merged and green (`android-ci / android` success on `3860c3d`). Two evidence gaps the merged run left, both in the run log rather than in the app: * `sha256sum -c` printed `OK` for the APK and the AAR but never the digests, so the artifact's identity was not recoverable from the run (and an APK is not byte-reproducible across machines, so it cannot be derived later). * `unzip -l` printed the uncompressed size of every `.so`; the **deflated** entry — what the download actually pays for — was nowhere. Both are now echoed. `android/CUPRATE_DAEMON.md` also gets the two remaining CI-cost cells filled in from run 412 (APK 34,445,514 B / AAR 15,728,039 B, 11m 12s job, 5.6 G `/cargo-target`), and the honest shape of the cost: the **first** feature-on build is the 44-minute one (run 406), later builds settle at ~+2 min over the feature-off baseline. No behaviour change: workflow reporting lines plus a doc table.
android-ci: echo the artifact digests and the deflated native-lib sizes
Some checks failed
android-ci / android (pull_request) Failing after 9m52s
294cedfbff
Run 412 (PR #113) proved the cuprated APK builds and carries the daemon, but
the log only ever printed `sha256sum -c ...: OK` — neither digest — and
`unzip -l`, which shows the uncompressed size of every .so and not the
deflated one the download pays for. Both are what a reader of the run needs to
identify the artifact, and neither can be recovered from the tree afterwards.

Also fills the two remaining cells of CUPRATE_DAEMON.md's CI-cost table from
that run (APK 34,445,514 B / AAR 15,728,039 B, 11m12s job, 5.6 G target
volume), and records that the first feature-on build is the 44-minute one
while later builds settle at +2 minutes over the feature-off baseline.
android-ci: 2 GB of Gradle heap for the cuprated release packaging
Some checks failed
android-ci / android (pull_request) Failing after 2s
c5e2cae694
Run 414 (PR #114) died in `:app:packageRelease` after a clean build:

    Execution failed for task ':app:packageRelease'.
    > A failure occurred while executing
      com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable

with no `Caused by` line and nothing else in the log — and it is not
reproducible on the same content: runs 412 and 413 (this tree, 1 GB heap)
packaged fine. The one budget in this build that got tight when cuprate came in
is the single-use Gradle daemon's heap, which now compresses a 55 MB SDK lib
(plus RandomX's 1.1 MB) in-process; the runner has 15 GB and the job's peak RSS
is ~3 GB, so 2 GB of heap costs nothing and removes the most likely mechanism.
android-release.yml gets the same number: it packages the same APK.
Author
Owner

Run 414 (the first run of this PR) died in :app:packageRelease after a clean build:

Execution failed for task ':app:packageRelease'.
> A failure occurred while executing
  com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable

No Caused by line, nothing else in the log — and it is not reproducible on the same content: run 412 (PR #113) and run 413 (the post-merge push on main) packaged the identical tree fine. The one budget that got tight when cuprate came in is the single-use Gradle daemon heap, which now compresses a 55 MB SDK lib (plus RandomX's 1.1 MB) in-process; the runner has 15 GB free and the job peak RSS is ~3 GB. So this PR also carries 2 GB of Gradle heap in both Android workflows instead of 1 GB — a cheap change against the most likely mechanism, and a re-run is the test of it.

If it recurs with the bigger heap, the remaining suspects are the shared /gradle build cache and the runner's docker layer, both of which are runner-side and out of this PR's reach — worth a card of its own rather than more guessing here.

Run 414 (the first run of this PR) died in `:app:packageRelease` after a clean build: Execution failed for task ':app:packageRelease'. > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable No `Caused by` line, nothing else in the log — and it is not reproducible on the same content: run 412 (PR #113) and run 413 (the post-merge push on `main`) packaged the identical tree fine. The one budget that got tight when cuprate came in is the single-use Gradle daemon heap, which now compresses a 55 MB SDK lib (plus RandomX's 1.1 MB) in-process; the runner has 15 GB free and the job peak RSS is ~3 GB. So this PR also carries 2 GB of Gradle heap in both Android workflows instead of 1 GB — a cheap change against the most likely mechanism, and a re-run is the test of it. If it recurs with the bigger heap, the remaining suspects are the shared `/gradle` build cache and the runner's docker layer, both of which are runner-side and out of this PR's reach — worth a card of its own rather than more guessing here.
Author
Owner

This PR is red for environmental reasons, not for its content — three runs, three different infrastructure failures

run sha result what the log says
414 294cedf failure 9m52s :app:packageRelease FAILED — A failure occurred while executing PackageAndroidArtifact$IncrementalSplitterRunnable, no Caused by line, nothing else in the log. Not reproducible on the same content: run 412 (PR #113) and run 413 (the post-merge push on main) packaged this exact tree fine.
415 c5e2cae failure 16m29s The log stops at 22:16:03 and never resumes. forgejo.siriusdevops.com returned 503 "no healthy upstream" (Cloudflare) from ~22:20 to ~22:34 — the job died with the server.
416 c5e2cae failure 2s failed to create container: 'Error response from daemon: No such image: node:20-bullseye' — the runner host restarted during that outage and its docker daemon no longer has the job image, and the runner will not re-pull it (forcePull=false).

So the third failure is at container creation, before any step of this workflow runs: no commit to this branch can go green until the runner's docker host is restored (pull node:20-bullseye or restart the runner so it re-pulls). Nothing here is a reason to distrust the change.

What this PR still is: two evidence lines in android-ci.yml (echo both artifact digests; echo the deflated size of every native lib) plus the two CI-cost cells in android/CUPRATE_DAEMON.md, and — from run 414's unexplained packaging death — 2 GB of Gradle heap in both Android workflows instead of 1 GB. The 44 MB-vs-55 MB heap question is a hypothesis, stated as one in the comment there; a re-run is what tests it.

Suggested handling: leave it open, and after the runner is healthy, re-run (or re-push) and merge if green. If :app:packageRelease fails again with the bigger heap, the remaining suspects are the shared /gradle build cache volume and the runner's docker layer — runner-side, and worth their own card rather than more guessing here.

## This PR is red for environmental reasons, not for its content — three runs, three different infrastructure failures | run | sha | result | what the log says | |---|---|---|---| | 414 | `294cedf` | failure 9m52s | `:app:packageRelease` FAILED — `A failure occurred while executing PackageAndroidArtifact$IncrementalSplitterRunnable`, **no `Caused by` line**, nothing else in the log. Not reproducible on the same content: run 412 (PR #113) and run 413 (the post-merge push on `main`) packaged this exact tree fine. | | 415 | `c5e2cae` | failure 16m29s | The log stops at 22:16:03 and never resumes. `forgejo.siriusdevops.com` returned **503 "no healthy upstream"** (Cloudflare) from ~22:20 to ~22:34 — the job died with the server. | | 416 | `c5e2cae` | failure **2s** | `failed to create container: 'Error response from daemon: No such image: node:20-bullseye'` — the runner host restarted during that outage and its docker daemon no longer has the job image, and the runner will not re-pull it (`forcePull=false`). | So the third failure is at container creation, before any step of this workflow runs: **no commit to this branch can go green until the runner's docker host is restored** (pull `node:20-bullseye` or restart the runner so it re-pulls). Nothing here is a reason to distrust the change. What this PR still is: two evidence lines in `android-ci.yml` (echo both artifact digests; echo the deflated size of every native lib) plus the two CI-cost cells in `android/CUPRATE_DAEMON.md`, and — from run 414's unexplained packaging death — 2 GB of Gradle heap in both Android workflows instead of 1 GB. The 44 MB-vs-55 MB heap question is a hypothesis, stated as one in the comment there; a re-run is what tests it. Suggested handling: leave it open, and after the runner is healthy, re-run (or re-push) and merge if green. If `:app:packageRelease` fails again *with* the bigger heap, the remaining suspects are the shared `/gradle` build cache volume and the runner's docker layer — runner-side, and worth their own card rather than more guessing here.
sirius merged commit 0af97e144a into main 2026-09-18 22:53:43 +00:00
Author
Owner

Runner restored; PR #114 head is being re-verified. What actually happened, with evidence.

The handoff premise is wrong: the runner host did not restart. siriussec has uptime 7d20h (read at 22:59 UTC from a hostPath probe pod scheduled on that node). No reboot.

What is actually there:

  1. The android runner is not a container on a host — it is the forgejo-runner-amd64 Deployment in the siriussec k8s cluster (node siriussec, 10.10.0.2), manifest sirius/homek8s apps/base/forgejo/runner-amd64.yaml. A docker:27-dind sidecar is the daemon the runner talks to (DOCKER_HOST=unix:///var/run/docker.sock), and that dind's /var/lib/docker is the forgejo-runner-amd64 PVC (subPath: docker).
  2. Run 415 created its job container at 22:14:21, so node:20-bullseye was present then. By 22:34:27 it was gone: run 416 logged docker pull image=node:20-bullseye ... forcePull=false, skipped it, and docker create died with Error response from daemon: No such image: node:20-bullseye — a 2-second failure in which no workflow step ever ran. act_runner treats that pull as best-effort when forcePull=false, so a missing job image is fatal-but-silent from the workflow's point of view. There is no workflow-side fix: actions/checkout is a JS action and needs node inside the job container, so the container must exist before step 1.
  3. The runner pod was recreated in that window — events Scaled down replica set forgejo-runner-amd64-59fbb7bfc4 from 1 to 0 at 22:36 and Scaled up ... from 0 to 1 at 22:37. Not Flux (its last applied revision is 3d19h old) and not a reboot. The Forgejo pod was restarted deliberately at the same time (lastState.terminated.reason: Completed, exit 0).
  4. The dind's data root came back empty at 22:40:35: Loading containers: start. → Loading containers: done. in 0.5 s, /var/lib/docker/image/overlay2/imagedb/content/sha256/* stamped 22:41 (node:20-bullseye) and 22:42 (debian:bookworm), and all four named build volumes (onionwire-android-sdk, -cargo-registry, -target, -gradle) created at 22:42. The PVC itself was not wiped — <pvc>/cache and <pvc>/.cache still carry Sep 12 mtimes — but <pvc>/docker/* and <pvc>/runner.ini were gone, so the register init container re-registered the runner as id 8.
  5. Consequence for this PR: run 417 (workflow_dispatch on c5e2cae, -Xmx2048m) is a cold build — SDK/NDK, cargo registry, cargo target and Gradle cache all went with the images. Expect ~45 min, not run 412's 11 min. Warm volumes return for the next run.

I could not establish what emptied <pvc>/docker and removed <pvc>/runner.ini between 22:14 and 22:34. A mount-layout change is ruled out: every ReplicaSet revision of the deployment (gen 1..5) mounts data@/var/lib/docker(docker). If the dind was reset by hand while the Forgejo 503 was being fixed, that is the explanation — and it is worth knowing, because the next reset costs a 45-minute android build.

On the :app:packageRelease flake (run 414). The overlap hypothesis is refuted:

  • run 413 (push on main) stopped at 21:53:38 and run 414 started at 21:53:38 — the onionwire-android-release-v2 concurrency group did serialise them;
  • the amd64 runner's live config.toml has capacity: 1, so two jobs cannot hold /gradle or /cargo-target concurrently at all;
  • run 414's own resource block is identical to 412's and 413's: 37 G free on /dev/nvme0n1p3, Mem: 15Gi total, 2.9Gi used, 12Gi available, load comparable.

Run 414 executed the same 95 Gradle tasks with the same 41 cache hits as run 412; the only difference in the whole build was :app:packageRelease itself, and the log contains no Caused by: line — the throwable carried no cause. That is also why I am not calling the 2 GB heap a proven fix: 412 and 413 packaged this same tree green on 1 GB. Run 417 is the test of it, and its result is the next comment here.

Runner restored; PR #114 head is being re-verified. What actually happened, with evidence. **The handoff premise is wrong: the runner host did not restart.** `siriussec` has uptime 7d20h (read at 22:59 UTC from a hostPath probe pod scheduled on that node). No reboot. What is actually there: 1. The android runner is not a container on a host — it is the `forgejo-runner-amd64` **Deployment** in the `siriussec` k8s cluster (node `siriussec`, 10.10.0.2), manifest `sirius/homek8s` `apps/base/forgejo/runner-amd64.yaml`. A `docker:27-dind` sidecar is the daemon the runner talks to (`DOCKER_HOST=unix:///var/run/docker.sock`), and that dind's `/var/lib/docker` is the `forgejo-runner-amd64` PVC (`subPath: docker`). 2. Run 415 created its job container at 22:14:21, so `node:20-bullseye` was present then. By 22:34:27 it was gone: run 416 logged `docker pull image=node:20-bullseye ... forcePull=false`, skipped it, and `docker create` died with `Error response from daemon: No such image: node:20-bullseye` — a 2-second failure in which no workflow step ever ran. act_runner treats that pull as best-effort when `forcePull=false`, so a missing job image is fatal-but-silent from the workflow's point of view. There is no workflow-side fix: `actions/checkout` is a JS action and needs node inside the job container, so the container must exist before step 1. 3. The runner pod was recreated in that window — events `Scaled down replica set forgejo-runner-amd64-59fbb7bfc4 from 1 to 0` at 22:36 and `Scaled up ... from 0 to 1` at 22:37. Not Flux (its last applied revision is 3d19h old) and not a reboot. The Forgejo pod was restarted deliberately at the same time (`lastState.terminated.reason: Completed`, exit 0). 4. The dind's data root came back **empty** at 22:40:35: `Loading containers: start.` → `Loading containers: done.` in 0.5 s, `/var/lib/docker/image/overlay2/imagedb/content/sha256/*` stamped 22:41 (`node:20-bullseye`) and 22:42 (`debian:bookworm`), and all four named build volumes (`onionwire-android-sdk`, `-cargo-registry`, `-target`, `-gradle`) created at 22:42. The PVC itself was not wiped — `<pvc>/cache` and `<pvc>/.cache` still carry Sep 12 mtimes — but `<pvc>/docker/*` and `<pvc>/runner.ini` were gone, so the register init container re-registered the runner as id 8. 5. Consequence for this PR: run 417 (`workflow_dispatch` on `c5e2cae`, `-Xmx2048m`) is a **cold** build — SDK/NDK, cargo registry, cargo target and Gradle cache all went with the images. Expect ~45 min, not run 412's 11 min. Warm volumes return for the next run. I could not establish what emptied `<pvc>/docker` and removed `<pvc>/runner.ini` between 22:14 and 22:34. A mount-layout change is ruled out: every ReplicaSet revision of the deployment (gen 1..5) mounts `data@/var/lib/docker(docker)`. If the dind was reset by hand while the Forgejo 503 was being fixed, that is the explanation — and it is worth knowing, because the next reset costs a 45-minute android build. **On the `:app:packageRelease` flake (run 414).** The overlap hypothesis is refuted: * run 413 (push on `main`) stopped at 21:53:38 and run 414 started at 21:53:38 — the `onionwire-android-release-v2` concurrency group did serialise them; * the amd64 runner's live `config.toml` has `capacity: 1`, so two jobs cannot hold `/gradle` or `/cargo-target` concurrently at all; * run 414's own resource block is identical to 412's and 413's: 37 G free on `/dev/nvme0n1p3`, `Mem: 15Gi total, 2.9Gi used, 12Gi available`, load comparable. Run 414 executed the same 95 Gradle tasks with the same 41 cache hits as run 412; the only difference in the whole build was `:app:packageRelease` itself, and the log contains no `Caused by:` line — the throwable carried no cause. That is also why I am not calling the 2 GB heap a proven fix: 412 and 413 packaged this same tree green on 1 GB. Run 417 is the test of it, and its result is the next comment here.
Author
Owner

Result: the runner is restored and both verification runs are green.

Run 417 — workflow_dispatch on this PR's head c5e2cae, GRADLE_OPTS=-Xmx2048m, cold volumes (the wipe in the previous comment):
BUILD SUCCESSFUL in 47m 14s, 96 actionable tasks (94 executed, 2 from cache), build_wall_clock_seconds=3191 (53m 11s), /cargo-target 2.7 G after.

Run 418 — push on main at the merge commit 0af97e14, i.e. the post-merge check, warm volumes:
BUILD SUCCESSFUL in 7m 26s, 96 actionable tasks (55 executed, 41 from cache), build_wall_clock_seconds=646 (10m 46s).

Both runs carry the evidence this PR added, which is the point of it:

=== native lib entries (length / method / deflated) ===
55438112  Defl:N 18249189  67%  lib/arm64-v8a/libonionwire_sdk.so
19954224  Defl:N  6961212  65%  lib/arm64-v8a/libmonerowalletrpc.so
 1122296  Defl:N   387996  65%  lib/arm64-v8a/librandomx_rs-40461fbb0a00e85c.so
=== sha256 ===
<apk digest>  onionwire-0.1.0-android-arm64-v8a.apk
<aar digest>  onionwire-sdk-0.1.0.aar

and both artifacts are the same size (APK 34,445,598 B, AAR 15,728,122 B; versionName 0.1.0, versionCode 100, compileSdk 36, minSdk 26, targetSdk 36, signer CN=Android Debug as expected for a verification build).

Two things worth recording from the digests now being printed, since neither was visible before:

run APK sha256 AAR sha256
417 (c5e2cae, cold) ca040256669b3d8a1273103dd385e87b2f1d3c3e8e3f22543af642cd504e13c7 b2c016c71387bad186e8bc5f6cc75d32fdc540f525d7a1443fce82078372f99c
418 (0af97e14, warm) d4178870059409ea920cd59dcad1ef6ff19b08cb7219101fca1dce5311af66b3 b2c016c71387bad186e8bc5f6cc75d32fdc540f525d7a1443fce82078372f99c

Same tree, two runs: the APK differs (not byte-reproducible — exactly why echoing it matters) and the AAR does not (b2c016c7… in both). That asymmetry is now observable, and it was not before this PR.

Status of the :app:packageRelease question: unresolved but now bounded. Run 414 remains the only packageRelease failure in the visible android history (every other red android run was a cargo/toolchain error: 400 = randomx-rs build script, 404 = tapes MSRV). Runs 412/413 packaged this same tree green on 1 GB, and 414's own resource block was identical to theirs, so 2 GB is headroom, not a demonstrated fix. What is ruled out is the overlap theory (see the previous comment: serialised by the concurrency group and by capacity: 1).

If it recurs, the log will still be causeless — Gradle printed no Caused by: for it. That is fixable cheaply in scripts/build-android-local.sh (add --stacktrace to the ./gradlew line, which is the one line both android-ci.yml and android-release.yml build through). I have filed that as a follow-up rather than smuggling it into this PR.

Result: the runner is restored and both verification runs are green. **Run 417** — `workflow_dispatch` on this PR's head `c5e2cae`, `GRADLE_OPTS=-Xmx2048m`, cold volumes (the wipe in the previous comment): `BUILD SUCCESSFUL in 47m 14s`, 96 actionable tasks (94 executed, 2 from cache), `build_wall_clock_seconds=3191` (53m 11s), `/cargo-target` 2.7 G after. **Run 418** — `push` on `main` at the merge commit `0af97e14`, i.e. the post-merge check, warm volumes: `BUILD SUCCESSFUL in 7m 26s`, 96 actionable tasks (55 executed, 41 from cache), `build_wall_clock_seconds=646` (10m 46s). Both runs carry the evidence this PR added, which is the point of it: ``` === native lib entries (length / method / deflated) === 55438112 Defl:N 18249189 67% lib/arm64-v8a/libonionwire_sdk.so 19954224 Defl:N 6961212 65% lib/arm64-v8a/libmonerowalletrpc.so 1122296 Defl:N 387996 65% lib/arm64-v8a/librandomx_rs-40461fbb0a00e85c.so === sha256 === <apk digest> onionwire-0.1.0-android-arm64-v8a.apk <aar digest> onionwire-sdk-0.1.0.aar ``` and both artifacts are the same size (APK 34,445,598 B, AAR 15,728,122 B; `versionName 0.1.0`, `versionCode 100`, `compileSdk 36`, `minSdk 26`, `targetSdk 36`, signer `CN=Android Debug` as expected for a verification build). Two things worth recording from the digests now being printed, since neither was visible before: | run | APK sha256 | AAR sha256 | |---|---|---| | 417 (`c5e2cae`, cold) | `ca040256669b3d8a1273103dd385e87b2f1d3c3e8e3f22543af642cd504e13c7` | `b2c016c71387bad186e8bc5f6cc75d32fdc540f525d7a1443fce82078372f99c` | | 418 (`0af97e14`, warm) | `d4178870059409ea920cd59dcad1ef6ff19b08cb7219101fca1dce5311af66b3` | `b2c016c71387bad186e8bc5f6cc75d32fdc540f525d7a1443fce82078372f99c` | Same tree, two runs: the **APK differs** (not byte-reproducible — exactly why echoing it matters) and the **AAR does not** (`b2c016c7…` in both). That asymmetry is now observable, and it was not before this PR. **Status of the `:app:packageRelease` question:** unresolved but now bounded. Run 414 remains the only `packageRelease` failure in the visible android history (every other red android run was a cargo/toolchain error: 400 = `randomx-rs` build script, 404 = `tapes` MSRV). Runs 412/413 packaged this same tree green on 1 GB, and 414's own resource block was identical to theirs, so 2 GB is headroom, not a demonstrated fix. What is ruled out is the overlap theory (see the previous comment: serialised by the concurrency group *and* by `capacity: 1`). If it recurs, the log will still be causeless — Gradle printed no `Caused by:` for it. That is fixable cheaply in `scripts/build-android-local.sh` (add `--stacktrace` to the `./gradlew` line, which is the one line both `android-ci.yml` and `android-release.yml` build through). I have filed that as a follow-up rather than smuggling it into this PR.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!114
No description provided.