Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Persistence Artifact Inventory

This document lists AgentENV artifacts that can remain on disk or in object storage beyond a single function call. It is organized by the module that owns each artifact’s lifecycle.

Path Roots

RootDefaultOwnerNotes
home_path/var/lib/aenvsrc/cfg.rsBase for paths containing the literal $AENV_HOME placeholder. AENV_HOME_PATH overrides it before placeholder expansion.
runtime_path/run/aenvsrc/cfg.rs, src/sandbox/network/*Base for transient namespace mount points and daemon sockets. AENV_RUNTIME_PATH overrides it.
deps_path$AENV_HOME/depssrc/cfg.rs, src/setup/*Base for downloaded runtime dependencies. AENV_DEPS_PATH can place these rebuildable assets outside home_path.
Firecracker sandbox work dirs$AENV_HOME/firecracker-work with agentenv-fc- childrensrc/sandbox/firecracker/*Per-sandbox runtime directories for sockets, symlinks, ublk runtime dirs, local logs, and writable OverlayBD upper layer data (overlaybd/upper.data, overlaybd/upper.index). An explicit [firecracker].work_dir overrides the root.
firecracker.serial_dir$AENV_HOME/logs/serialsrc/sandbox/firecracker/*Durable Firecracker stdout/stderr root, grouped by sandbox ID. An explicit [firecracker].serial_dir overrides the root.
managed_snapshot_root<firecracker-work-base>/managed-snapshotssrc/sandbox/firecracker/*In-process live snapshot artifact root used to keep captured snapshots alive until publish or drop.
persisted_sandbox_store_path$AENV_HOME/persisted-sandboxessrc/orchestrator/persistence/*Durable paused sandbox records and artifacts.
snapshot_store$AENV_HOME/snapshot-storesrc/snapshot/repository/*Durable committed snapshot repository root. The configured backend uses <snapshot_store>/repository. Relative explicit paths are resolved against the config file directory.
snapshot.local_cache_path$AENV_HOME/snapshot-local-cachesrc/snapshot/artifact_cache.rs, runtime resolversNode-local cache for materialized runtime artifacts. Relative explicit paths are resolved against the config file directory.
image.cache.root_dir$AENV_HOME/image-cachesrc/image/*, overlaybd runtimeNode-local image cache root. Contains configs/, indexes/, commits/, and remote-blocks/.
p2p.store_dir$AENV_HOME/p2p/storesrc/p2p/*, src/cfg.rsLocal store for P2P artifact transport backends. Relative explicit paths are resolved against the config file directory.
image.cache.remote_blocks<image.cache.root_dir>/remote-blocksoverlaybd runtime configRemote block cache root. Overlaybd also stores premerged-index/ under this cache dir. Its size limit comes from image.cache.remote_blocks.max_size_gb.
ublk.daemon_socket_path$AENV_RUNTIME/ublk-daemon.socksrc/sandbox/ublk/*, storage/ublk-daemon/*Unix socket used for server-to-daemon IPC.
ublk.daemon_log_path$AENV_HOME/logs/ublk-daemon.logstorage/ublk-daemon/*Daemon log file supplied during config normalization. An explicit path overrides the default.

Setup And Config

Owned by src/setup/* and src/cfg.rs.

ArtifactLocationContentsPurposeLifecycle
Firecracker binary<deps_path>/firecracker/{version}/firecrackerFirecracker executableVM process runtimeCreated during setup when missing. Old versions are retained until manually removed.
CPU template helper<deps_path>/firecracker/{version}/cpu-template-helperOptional Firecracker helper executableDetects host CPU config for cluster-wide CPU intersectionExtracted from Firecracker package when present.
Kernel image<deps_path>/kernel/{version}/vmlinux.binGuest kernelVM boot sourceDownloaded during setup. Old versions are retained until manually removed.
Tools drive<deps_path>/tools/{version}/tools.ext4Read-only ext4 image with envd/toolsFirecracker root drive shared by sandboxes and pinned by snapshots through its immutable release versionExtracted from OCI or imported from tools.drive_path during setup. Old versions are retained until manually removed.
Overlaybd tools<deps_path>/overlaybd/bin/*, <deps_path>/overlaybd/lib/*overlaybd-create, overlaybd-apply, overlaybd-commit, overlaybd-resize, librariesOCI-to-overlaybd conversion and packagingInstalled during setup when release metadata does not match.
Overlaybd release metadata<deps_path>/overlaybd/tools-release.jsonInstalled overlaybd release identifierDetects whether tools need reinstallingRewritten on setup when release changes.
Overlaybd package downloads<deps_path>/overlaybd/downloads/*Downloaded package archivesSetup cache for overlaybd release packagesKept after install; no automatic GC.
Generated overlaybd config$AENV_HOME/overlaybd/overlaybd-global.json, $AENV_HOME/overlaybd/mem-overlaybd-global.jsonRuntime global config, cache path, credentials configConfigures overlaybd runtime and memory snapshot overlaybd accessRewritten during setup/startup.
Overlaybd runtime log<deps_path>/overlaybd/overlaybd.logOverlaybd runtime logsDebuggingAppended by overlaybd runtime; no automatic GC.

Firecracker Sandbox

Runtime

Owned by src/sandbox/firecracker/*.

ArtifactLocationContentsPurposeLifecycleRebuildable
Managed live snapshot root<firecracker-work-base>/managed-snapshots/{sandbox_id}/{uuid}/...Firecracker snapshot artifacts kept alive in-processHolds captured running-sandbox snapshots until publish, and supports in-process pause stateCreated by FirecrackerSandbox::pause() or snapshot(). Removed when PersistentSnapshotRootGuard drops.No.
Snapshot VM statesnapshot artifact dir vm_state.binFirecracker VM statePause/resume and snapshot publish inputCreated by Firecracker create_snapshot. Owner depends on caller: persister, managed root, or repository publish input.No.
Raw memory diffsnapshot artifact dir mem.binSparse Firecracker diff memory dumpInput to memory overlaybd conversion and source for virtual memory sizeCreated by Firecracker create_snapshot. Removed best-effort after the memory overlaybd layer is committed.Temporary input only; not reconstructed after cleanup.
Memory overlaybd layersnapshot artifact dir mem_overlaybd/overlaybd.commitSealed overlaybd layer for memory pagesRuntime memory restore and publish inputCreated by packaging mem.bin. Imported into repository managed layers during publish.No, unless raw mem.bin is still present.
Memory image configsnapshot artifact dir mem_image.jsonOverlaybd image config stacking memory layersResume paused sandbox and publish memory layersWritten after memory conversion. Later repository resolvers regenerate runtime memory configs from committed layers.Yes after publish; no for paused sandbox unless layers are known.
Rootfs snapshot configsnapshot artifact dir rootfs/image.jsonOverlaybd image config for captured rootfs stateResume paused sandbox and publish rootfs layersStaged from live runtime config after restack/seal.Yes only from associated layers and metadata.
Rootfs snapshot layersnapshot artifact dir rootfs/snapshot.commitSealed writable upper from live rootfsCaptures disk writes since previous lower stackCreated by ublk daemon restack for writable overlaybd rootfs.No.
Inherited runtime layerssnapshot artifact dir rootfs/inherited-layers/{index}/{source-file}Snapshot-owned hard links or copies of inherited runtime-created lower suffixesRemoves dependence on previous managed snapshot or persisted sandbox artifact rootsCreated during pause when inherited lowers come from the managed snapshot root or another sandbox/generation under the same persisted artifacts root.No.
Attached-drive snapshot dirssnapshot artifact dir drives/{drive_id}/...Per-drive image config and snapshot layerCaptures writable attached-drive stateCreated alongside rootfs snapshot for each drive.No.
Firecracker work dirconfigured work root, or consumed pool tempfile dirAPI socket, symlinks, runtime dirs, local logsFirecracker CWD for a sandboxCreated when sandbox handle is built, or moved from a warm pool entry; removed by owning TempDir.Yes, except live state.
Firecracker serial logsfirecracker.serial_dir/{sandbox_id}/*, or warm pool work dir logsFirecracker stdout/stderrDebuggingOpened on spawn and appended. Warm logs are relocated when a warm process is consumed. Configured serial output is not automatically GC’d.No, but disposable.
Firecracker logger outputfirecracker.log in the same per-sandbox log directory as the serial logsFirecracker internal logger (PUT /logger)DebuggingOnly created when firecracker.log_level is set to a non-empty level. Written by Firecracker itself; not automatically GC’d.No, but disposable.

Firecracker Pool

Owned by src/sandbox/firecracker/pool.rs.

ArtifactLocationContentsPurposeLifecycle
Warm pool work dirsystem tempfile dirFirecracker socket and warm process logsPre-spawned Firecracker process CWDCreated by pool maintenance as a TempDir. Removed when warm entry is cleaned up, or moved into the consuming sandbox and later dropped there.
Warm pool logswarm pool work dir firecracker-stdout.log, firecracker-stderr.logFirecracker output before the warm process is consumedDebugging warm startupCreated on warm spawn. Relocated into sandbox log path when consumed if no explicit stdout/stderr override.

Extra Drives

Owned by src/sandbox/extra_drive.rs and Firecracker snapshot code.

ArtifactLocationContentsPurposeLifecycleRebuildable
Extra-drive runtime dirsandbox work dir extra-drive-runtime-{drive_id}/Runtime image.json, upper files, result fileublk runtime for attached driveCreated when preparing extra drives. Released on rollback/stop; work dir cleanup removes files.Not while running; otherwise unnecessary.
Extra-drive symlinksandbox work dir extra-drive-{drive_id}Symlink to /dev/ublkbN device pathFirecracker drive attachment pathCreated after ublk runtime device creation. Removed on rollback or work dir cleanup.Yes.
Extra-drive snapshot artifactsnapshot artifact dir drives/{drive_id}/...Captured drive overlaybd config and commit layerPreserve attached-drive writable state across pause/resume/publishCreated during sandbox snapshot/pause. Later owned by persister, managed root, or repository publish flow.No.

Image Resolver

Owned by src/image/*.

ArtifactLocationContentsPurposeLifecycle
Image config cache<image.cache.root_dir>/configs/*-image.jsonDigest-qualified overlaybd image configs for resolved user imagesAvoids repeating OCI manifest classification and config generationWritten on image resolve. Regenerated if invalid or if referenced local lowers are missing. No unified GC today.
Image metadata sidecar<image.cache.root_dir>/configs/*.metadata.jsonBase env/workdir metadata from OCI image configPreserves image launch context beside cached image configWritten after image config. Rebuilt if missing while image config is usable.
Overlaybd commit cache<image.cache.root_dir>/commits/{digest-slug}/overlaybd.commitContent-addressed overlaybd commit layers from standard OCI conversion, and target dirs for remote overlaybd-native layersNode-local reusable layer store for user image layersStandard OCI conversion writes commits. Remote overlaybd-native configs point dir here for runtime population. No unified GC today.
OCI conversion index<image.cache.root_dir>/indexes/{source-digest}/...jsonMapping from OCI source layer/context to overlaybd commit digest and sizeSkips repeated layer conversion when converted commits existWritten after successful standard OCI conversion. No unified GC today.
Temporary OCI pull/conversion workprocess temp dirOCI layout and per-layer conversion workspaceIntermediate input for standard OCI conversionOwned by TempDir; removed after conversion scope exits.

Snapshot Repository

Owned by src/snapshot/repository/* and src/snapshot/types/*.

ArtifactLocationContentsPurposeLifecycleRebuildable
Snapshot recordsPOSIX: <snapshot_store>/repository/catalog/records/{id}.json; OSS: catalog/records/{id}.jsonSnapshot ID, alias, source, resources, build status, committed logical metadataDurable user-visible snapshot/template metadataCreated before template build or at publish. Updated when committed or errored. Deleted by snapshot delete.No.
Snapshot aliasesPOSIX: <snapshot_store>/repository/catalog/aliases/{alias}; OSS: catalog/aliases/{alias}.jsonAlias-to-snapshot bindingName lookup for templates/snapshotsBound during create/publish with conflict checks. Deleted with record cleanup.Partially, from records if aliases are still recorded.
Firecracker manifestPOSIX: <snapshot_store>/repository/snapshots/{id}/firecracker-manifest.json; OSS: artifacts/{id}/firecracker-manifest.jsonFirecracker snapshot shape, virtual sizes, attached-drive metadata; path fields are hydrated at runtimeRuntime manifest template for launching committed snapshotsPersisted during publish. Removed with per-snapshot artifacts.Partially, but kept as durable artifact.
VM statePOSIX: <snapshot_store>/repository/snapshots/{id}/vm_state.bin; OSS: artifacts/{id}/vm_state.binFirecracker VM state snapshotRequired to resume committed snapshotsCopied/uploaded during publish. Removed with per-snapshot artifacts.No.
Managed snapshot layersPOSIX: <snapshot_store>/repository/managed-layers/{digest}.overlaybd.commit; OSS: managed-layers/{digest}Content-addressed rootfs, attached-drive, and memory overlaybd commit layersShared immutable layer storage for committed snapshotsImported during publish by descriptor or by hashing local descriptor-less layers. Usually not removed with a single snapshot.Not from metadata alone; can be re-fetched only if source still exists.
Source-registry publicationsSnapshotRecord.committed.disk_publications plus remote OCI registry objectsPublished rootfs/attached-drive image refs and manifest digestsLets compatible snapshot deltas live in their source registryCreated during OSS publish when image publishing is enabled. Rolled back on failure or delete when possible.Registry-owned; record is required to locate.

Repository records are the logical source of truth for committed snapshots. Build-time and runtime image.json files should not become committed truth unless they contain data that cannot be derived from committed metadata.

Snapshot Runtime Resolution

Owned by src/snapshot/artifact_cache.rs, src/snapshot/runtime_support.rs, and backend runtime resolvers.

ArtifactLocationContentsPurposeLifecycleRebuildable
Runtime rootfs config<snapshot_local_cache_path>/runtime/{snapshot_id}/rootfs/image.jsonNode-local overlaybd config for committed rootfs layersLaunch committed snapshot on the current nodeMaterialized during snapshot resolve and pinned by RunnableSnapshot lease. LRU-evictable after unpinned.Yes.
Runtime memory config<snapshot_local_cache_path>/runtime/{snapshot_id}/memory/image.jsonNode-local overlaybd config for committed memory layersProvides memory backend image to Firecracker resumeMaterialized during snapshot resolve and pinned by lease. LRU-evictable after unpinned.Yes.
Runtime attached-drive configs<snapshot_local_cache_path>/runtime/{snapshot_id}/drives/{drive_id}/image.jsonNode-local overlaybd configs for attached drivesLaunch committed snapshot with attached drivesMaterialized during snapshot resolve and pinned by lease. LRU-evictable after unpinned.Yes.
OSS cached VM state<snapshot_local_cache_path>/artifacts/{id}/vm_state.binDownloaded VM state objectAvoids repeated object-store download while pinned/cachedDownloaded by OSS resolver through LocalArtifactCache. LRU-evictable after unpinned.Yes, by downloading again.
POSIX VM state referenceRepository vm_state.bin pathDirect path into POSIX repositoryAvoids copying VM state into local runtime cacheChecked during resolve. Lifetime follows repository artifact.No; repository artifact is source.

LocalArtifactCache owns pinning, in-flight materialization deduplication, and LRU eviction for files it manages. It does not own the durable snapshot repository.

Orchestrator Persistence

Owned by src/orchestrator/persistence/*.

ArtifactLocationContentsPurposeLifecycle
Paused sandbox record DB<persisted_sandbox_store_path>/records.dbRocksDB keyed by sandbox ID; values are compact JSON records containing version, lifecycle, sandbox metadata, artifact root, and backend stateRestores paused sandboxes after server restartRecord written after pause succeeds. Marked resuming before resume. Rolled back on resume failure. Deleted on resume/delete.
Paused sandbox artifact generation<persisted_sandbox_store_path>/artifacts/{sandbox_id}/{uuid}/...Firecracker snapshot artifacts generated by pause_to_dirDurable artifacts for one paused sandbox generationAllocated before pause, populated by backend, referenced by paused record. Removed during explicit delete or load_all orphan cleanup.

Paused sandbox artifacts are not committed snapshot repository artifacts. They are owned by the sandbox persister and should not be shared as snapshot truth.

P2P Artifact Transport

Owned by src/p2p/*.

ArtifactLocationContentsPurposeLifecycle
Iroh blob store<p2p.store_dir>/irohiroh-blobs content-addressed data and internal metadataLocal store for published artifacts and cached fetchesCreated on P2P transport init, grows on publish and successful remote fetch. These blobs are collected by GC after unpublish removes those tags.
P2P catalog DB<p2p.store_dir>/iroh/catalog.dbRocksDB keyed by artifact key; values are compact JSON artifact descriptorsLets peers resolve stable keys into descriptors for this nodeLoaded on startup. Individual entries are upserted on publish and after successful remote fetch, and deleted on unpublish.

Snapshot publication writes best-effort P2P catalog entries after repository commit:

  • snapshot/v1/artifacts/{snapshot_id}/vm_state.bin
  • snapshot/v1/artifacts/{snapshot_id}/firecracker-manifest.json
  • overlaybd-layer/v1/sha256:<digest> for referenced rootfs, memory, and attached-drive overlaybd commit layers

Those P2P entries are optional copies, not committed snapshot truth. Clearing <p2p.store_dir> can reduce peer-to-peer availability and force peers back to OSS or origin-registry reads, but it must not make a committed snapshot invalid by itself.

Ublk Daemon Runtime

Owned by storage/ublk-daemon/* and src/sandbox/ublk/*.

ArtifactLocationContentsPurposeLifecycleRebuildable
Overlaybd runtime image configcaller-provided runtime dir image.jsonRewritten overlaybd config with runtime-relative lower and upper pathsOpens ublk overlaybd targetMaterialized during CreateOverlaybdRuntimeDevice. Removed during rollback or work dir cleanup.Yes from source image config while not running.
Runtime upper dataruntime dir upper.dataWritable overlaybd upper data fileStores live writes for writable devicesCreated for writable runtime if source config has no existing upper. Restacked into snapshot layer on pause/snapshot.No while running.
Runtime upper indexruntime dir upper.indexLog-structured upper indexResolves writes in upper.dataCreated with log-structured writable upper. Restacked into sealed snapshot layer.No while running.
Runtime result fileruntime dir result.txtOverlaybd result file pathOverlaybd runtime conventionCreated/used by overlaybd runtime. Removed during cleanup.Yes.
Ublk daemon socketdefault $AENV_RUNTIME/ublk-daemon.sockUnix socketIPC between AgentENV server and ublk daemonCreated when daemon starts; removed/replaced by process lifecycle.Yes.
Ublk daemon logconfigured ublk.daemon_log_path, default $AENV_HOME/logs/ublk-daemon.logDaemon logsDebuggingAppended by the daemon; the deployment owns rotation and retention.No, but disposable.

Overlaybd Storage

Owned by storage/overlaybd/*.

ArtifactLocationContentsPurposeLifecycleRebuildable
Remote block cacheconfigured cacheConfig.cacheDir, derived from <image.cache.root_dir>/remote-blocksCached registryfs_v2 block rangesSpeeds remote overlaybd-native layer readsManaged by overlaybd cache settings.Yes.
Premerged index cachecacheConfig.cacheDir/premerged-index/*.pmidxSerialized merged read-only lower indexSpeeds opening repeated lower stacksWritten asynchronously on read-only open. Pruned by size limit derived from cache size.Yes.
Sealed overlaybd commit filesVarious owner paths: image cache, snapshot dirs, repository managed layersOverlaybd layer data and index trailerImmutable lower layers for block devices and memory imagesLifecycle is owned by the module that stores the file. Overlaybd only defines the format and open/merge behavior.Depends on owner.

Ownership Rules

  • Snapshot repository artifacts are durable user-visible state. Do not delete them from node-local GC code.
  • Paused sandbox artifacts are durable only for the paused sandbox that owns them. Do not treat them as committed snapshots.
  • Runtime image.json files under snapshot local cache or ublk runtime dirs are derived artifacts. They should be rebuildable from committed metadata or source image configs.
  • Node-local image-cache artifacts are disposable cache, but content-addressed commits may be expensive to regenerate. The metadata-backed GC only reclaims commits no longer rooted by on-disk source configs, held by image-cache leases, or referenced by the in-process running set. Committed snapshots are durable SnapshotRepository state and do not pin ImageCache commits. See [image.cache.gc] in the configuration reference for scheduling.
  • P2P store contents are node-local and optional. Unpublish removes the local catalog entry and related blobs; clearing the store only affects peer-to-peer sharing and may require republishing or refetching artifacts.
  • Logs and dependency downloads are operational artifacts. They are not part of sandbox or snapshot correctness, but may require separate retention policy outside image-cache GC.