Local asset management

This page covers the local asset daemon, OCI artifact builds, package inventory, tagging, and cleanup. The released lab executable contains the complete local store; Docker is not required.

List and inspect

Use an independent directory to try the commands. --cache-dir selects the same resource store, containing content-addressed blobs and local catalog metadata.

lab pull hub.sciol.ac.cn/scienceol/elevrail-1-5m-v1-5167d813ec@sha256:2f5734742ca8694602faead5517ef6cf68f0db399ea9bb0e9c160d58f2efc1f2 --cache-dir ./lab-store
lab asset list --cache-dir ./lab-store --json
lab asset inspect hub.sciol.ac.cn/scienceol/elevrail-1-5m-v1-5167d813ec@sha256:2f5734742ca8694602faead5517ef6cf68f0db399ea9bb0e9c160d58f2efc1f2 --cache-dir ./lab-store --json
lab images --cache-dir ./lab-store --json

list shows admitted packages, versions, references, and logical package sizes. Shared blobs do not occupy disk space twice. inspect additionally verifies the cached package. Without a directory override, the resource store lives in the current user's platform persistent state directory.

The inventory does not automatically import the previous CLI download cache. Pull assets again or import an existing OCI layout on first use; old-format references are not an implicit source for the new catalog.

Reuse one store through LAB_ASSET_CACHE; the explicit option wins for a one-off directory:

export LAB_ASSET_CACHE="$PWD/lab-store"
lab daemon start
lab images --json

lab daemon start keeps the content-addressed store available across CLI processes. lab daemon status --json checks its loopback endpoint and lab daemon stop shuts it down. Commands fall back to direct local access if the daemon is not running. An unresponsive daemon is an error. Shutdown drains accepted operations, and diagnostics are stored in daemon.log. The installer does not register a boot service.

Build and split

Build a directory into the local OCI artifact store and assign a tag in one step:

lab build ./asset --tag localhost/demo/elevrail:1.0.0 --cache-dir ./lab-store
lab images --json --cache-dir ./lab-store

For an OpenUSD scene, extract explicit component prims into child asset directories. The children carry a parent digest and must be validated and built independently:

lab split ./asset --output ./components \
  --part arm=/Robot/Geometry/Arm \
  --part base=/Robot/Geometry/Base
lab validate ./components/arm
lab build ./components/arm --tag localhost/demo/elevrail-arm:1.0.0

lab split requires the OpenUSD Python runtime, resolves exact prim paths and relationship targets, copies/rebases texture dependencies, and publishes all children together. A failure leaves the output absent. Children record parent digest lineage and clear inherited runtime declarations. Names use lowercase letters, digits and interior hyphens. All dependencies must be inside the source asset. The parent preview and thumbnail are inherited; replace them before publishing a component-specific preview. Semantic components are explicitly mapped.

Import and tag

Import an existing OCI layout directly. A tag is a local reference and does not upload the package to that address:

lab asset import ./layout --tag localhost/demo/elevrail:dev --cache-dir ./lab-store
lab asset tag localhost/demo/elevrail:dev localhost/demo/elevrail:review --cache-dir ./lab-store
lab asset inspect localhost/demo/elevrail:review --json --cache-dir ./lab-store

Create ./layout with lab pack. You can also use a complete sha256:... digest as the source selector for a cached package. Retagging changes that local reference; an existing instance retains its creation-time digest.

Remove and reclaim

lab asset remove localhost/demo/elevrail:review --cache-dir ./lab-store
lab asset prune --dry-run --json --cache-dir ./lab-store

Removing a reference does not immediately delete package bytes. prune --dry-run lists reclaimable packages, blobs, and actual byte counts. Once you have confirmed that this isolated store contains no needed unreferenced content, run:

lab asset prune --json --cache-dir ./lab-store

Pruning handles unreferenced, unoccupied packages and preserves shared blobs used by other packages. Digest-based removal also checks occupation. Retained runtime instances must be removed first; stopping an instance does not release its package.