Repository navigation
Phase 1 Milestone B: the container engine (P1-05 to P1-10) - #8
Merged
Merged
Conversation
Define the Engine trait in verone-core with the operations every engine provides: check_host, prepare_image, create, destroy, start, stop, status, control_endpoint and capabilities, plus the types they exchange (host checks, phone status, boot report, control endpoint, capabilities). Add FakeEngine, an in-memory engine that records calls, simulates phone states and can be told to fail the next call, so front ends can be tested without a container runtime. Change the plan's rule 1 at the owner's request: one branch and pull request per milestone, with one commit per task. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add typed wrappers around the Docker command line in verone-engine-container: version, info, image presence, pull, create, start, update of the restart policy, kill, remove, inspect, exec, one-off runs and published ports. All calls go through the core process runner, and JSON output is parsed into the fields Verone uses. Unit tests run against a stub script standing in for the runtime. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add HostProbe to verone-engine-container. It checks that the runtime is installed and reachable, that the kernel offers binder, that the running kernel's modules are installed, that there is disk space where the runtime stores images and where phone data lives, and that memory is sufficient. It also reports which graphics mode 'auto' would pick and whether adb and scrcpy are installed. The probe's root folder, search path and free-space lookup can be replaced, so every check is tested against a fake system tree. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add the image table with the Android 14 image pinned by digest, and the pinned helper image used for file operations on root-owned data. Add ContainerEngine, which implements the Engine trait on Docker: - builds the container options from the phone profile and stores them in a label, so a changed profile recreates the container while the data stays; - resolves the graphics mode itself: GPU when a usable render node exists, otherwise software, never a node driven by the nvidia driver; - waits for Android to report a finished boot, and in auto mode falls back to software once if GPU mode does not come up; - stops a phone by switching the restart policy off and powering Android off from inside, because the runtime's stop only kills it; - erases phone data through the helper image. Add an adb helper that verifies the connection before each use and drops a stale one, and a hint for the case where the runtime cannot publish the optional adb port. Integration tests boot real phones when VERONE_TEST_DOCKER=1 is set. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add 'verone doctor', which prints every host check with its fix and exits with code 3 if any check failed, and 'verone image pull' and 'verone image list'. All three support --json. The doctor command was planned as P1-15. It is added here because the acceptance test of P1-07 needs it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Milestone B of
docs/phases/phase-1.md: everything needed to run a phone, below the command line. Five commits.a63d863Enginetrait and its types inverone-core, andFakeEnginefor tests6be9b0bruntime.rs: typed wrappers around the Docker command line071fccdhost.rs: host checks against a replaceable view of the system3c20281images.rs,engine.rs,adb.rs: pinned images, the container lifecycle, the adb helper, and integration tests935c2efverone doctor,verone image pull,verone image listWhy
Milestone C (the phone commands) is a thin layer over this engine. Getting boot, stop, restart and adb right, and proving them on real phones, is the core of Phase 1.
Acceptance tests
Run on the reference laptop (Arch Linux, kernel 7.3.4, Docker 29.9.3, Rust 1.99.1).
Integration tests on real phones:
Measured during that run: first boot in GPU mode 23.7 s; return after an in-Android restart 21.1 s; clean stop 1.0 s with exit code 130; fallback boot in software 13.5 s.
Commands, run for real:
How each task's "Done when" is met:
verone doctorexits 0 here and 3 with no runtime.14; still works after stop/start and after an in-Android restart without manual reconnection; port 5599 is published on127.0.0.1only.Notes for the reviewer
doctorarrived early. It was planned as P1-15, but P1-07's acceptance test needs it. P1-15 has nothing left to do.engine.rs, so they are one commit; the commands are a second.xt_tcpudp). On one run after a reboot Docker could not load it and the port test failed; on the final run it passed. The engine now adds a hint (sudo modprobe xt_tcpudp) to that error. Verone publishes no port by default, so ordinary phones are unaffected.autoonly. A phone explicitly set to GPU mode fails with guidance instead of silently switching. After a recorded fallback,autogoes straight to software on later starts.erase_datais a method ofContainerEngine, not of theEnginetrait. Whether it belongs in the trait is decided in P1-14, which uses it.VERONE_TEST_DOCKER=1is set, so CI runs unit tests only. They boot phones one at a time and keep their data undertarget/tmp.a63d863).serdeandserde_jsonin the engine crate;tempfileas a dev-dependency.🤖 Generated with Claude Code