Caches and upload sources¶
Builders keep layer history, upload results, and URL-download metadata in one
Store. Helpers and direct builders accept store=. Tree kinds
separate reusable records from user sessions. Node data contains JSON values.
See Build a Docker image, Tree stores, and Reuse uploads and retain their sources for retention,
connection scope, and upload provenance.
Upload reuse through the public file-transfer and store contracts.
- class contree_sdk.upload_cache.AsyncCachedFileTransfer(transfer, store, *, scope, ttl, sources=None)[source]¶
Cache content uploads; apply permissions from each current request.
ttl is required and measured from upload completion. Hits do not renew it. Concurrent misses may upload the same content. The caller owns all components.
- async download_file(image_uuid, path, destination)¶
Atomically save streamed content.
- Return type:
int- Returns:
The number of downloaded bytes.
- class contree_sdk.upload_cache.CachedFileTransfer(transfer, store, *, scope, ttl, sources=None)[source]¶
Cache content uploads; apply permissions from each current request.
ttl is required and measured from upload completion. Hits do not renew it. Concurrent misses may upload the same content. The caller owns all components.
- download_file(image_uuid, path, destination)¶
Atomically save streamed content.
- Return type:
int- Returns:
The number of downloaded bytes.
Source records kept in a separate namespace from upload store entries.
- class contree_sdk.file_sources.AsyncFileSources(store, scope, *, clock=<built-in function time>)[source]¶
Source registry backed by records with implementation-defined retention in a caller-owned store.
Upload invalidation does not remove source records. A source is provenance, not proof that the remote upload still exists or that the local file is unchanged.
- class contree_sdk.file_sources.SyncFileSources(store, scope, *, clock=<built-in function time>)[source]¶
Source registry backed by records with implementation-defined retention in a caller-owned store.
Upload invalidation does not remove source records. A source is provenance, not proof that the remote upload still exists or that the local file is unchanged.
Bind cache namespaces to a server and an authorization context.
- class contree_sdk.scope.StoreScope(digest)[source]¶
A non-secret digest separating endpoint, project, credential, and profile.