tremplin: Detect and recover from incomplete setup.

When we get interrupted during setup we can get containers broken in
various weird ways which we can't launch or recover from without
completely deleting the container. Detect when a container hasn't
completed setup and delete then recreate from scratch when that happens.

1. Create containers under a temporary name and rename once fully
downloaded.
2. Set metadata on the container once setup, if this metadata is missing
it's not fully set up so delete and recreate.
3. Only apply changes to containers created from when this commit lands
(tracked by another piece of metadata). All existing containers we assume
are set up correctly.

BUG=chromium:1000567
TEST=manual. Install Crostini from scratch, launch old, launch new,
interrupt setup.

Change-Id: I2b25e30b0747e3336fc9bf9d3a8453a5df9b4d17
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tremplin/+/1986534
Reviewed-by: David Munro <davidmunro@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Commit-Queue: David Munro <davidmunro@google.com>
Tested-by: David Munro <davidmunro@google.com>
Auto-Submit: David Munro <davidmunro@google.com>
1 file changed
tree: 1d97fa437bf387b76a1d5e1ce7de1bc8c7288b78
  1. src/
  2. .gitignore
  3. OWNERS
  4. README.md
README.md

Tremplin

Tremplin is the “springboard” daemon that runs in the Termina VM and exposes a gRPC interface for managing LXD containers.