mirror of
https://github.com/hanzoai/vm.git
synced 2026-10-01 00:47:56 +00:00
A checkpoint is already content-addressed and chunked, so archiving one is not
a new format — it is the same chunks, somewhere durable. cas.rs said as much in
the one line above ChunkStore: "implement this for S3, SSH, or any other remote
storage." This is that implementation, and nothing else changed shape to admit
it.
Two pieces, each doing one thing:
S3ChunkStore a ChunkStore against an S3-compatible endpoint. SigV4 is the
minimum of it — one header set, no query signing, no chunked
upload — because a chunk is 64KB and immutable, so every request
it signs is a whole-object PUT or GET. Config comes from the
environment under the names rclone and the AWS SDKs both already
use, so a host configured for one is configured for this.
Tiered local first, archive behind it. A reload reads a chunk from the
network ONCE and keeps it, so the second resume of the same
checkpoint costs nothing over a purely local one.
Absent is not an error. No endpoint means this host has no archive, and a vm
that never archives must not fail to start because nobody configured one — the
selection point falls back to the local store it always used.
A failed archive write is a warning, not a failure: the host still has a working
local checkpoint, and the chunk is content-addressed, so a later put is the same
bytes under the same name. Losing that write costs a re-upload, never a wrong
read.
10 tests pass, the 8 that were there and 2 new.
Co-authored-by: Hanzo Dev <[email protected]>