Trees
A working tree as a Merkle tree of content digests: which blobs the cell lacks, and how to send and fetch them.
Store small tree blobs
Store small tree blobs from one body.
Request body
blobsblobs[].data_b64blobs[].digest- sha-256 digest as
sha256:<64 hex>
Response
stored
curl -X POST "$CIRESK_API/v1/ci/trees/blobs" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"blobs": [
{
"data_b64": "acme/platform",
"digest": "sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49"
}
]
}'Get a tree's missing manifests
The manifests of a tree that the worker's held trees lack, inline.
Request body
have- the roots the worker's slots of the repository hold; the first
TREE_DELTA_MAX_HAVEcount root- the root digest of a working tree: sha-256 of the root directory manifest
Response
complete- every manifest of
rootoutside thehavetrees is inmanifests; false when the delta passedTREE_DELTA_MAX_MANIFESTSor the cell no longer holds a manifest, and the worker walks the tree level by level manifestsmanifests[].data_b64manifests[].digest- sha-256 digest as
sha256:<64 hex>
curl -X POST "$CIRESK_API/v1/ci/trees/delta" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"have": [
"sha256:0db7fed5a18ebe9d0e3049448d5ec65f6a1ea5a38a77b61105bdd8e14b9bef83"
],
"root": "sha256:4827d3132b09e1cedc07788771ef7bca9c1140b2dff2ac370fc8433a94de43e5"
}'Get tree blob downloads
Presigned downloads for a page of tree blobs.
Request body
cursordigests
Response
blobsblobs[].digest- sha-256 digest as
sha256:<64 hex> blobs[].download- a presigned get
blobs[].download.expires_atblobs[].download.urlblobs[].sizenext_cursor
curl -X POST "$CIRESK_API/v1/ci/trees/download" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"cursor": "eyJOi5k8U45exDKu22IvXLqJ7m7",
"digests": [
"sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49"
]
}'Check which tree blobs are missing
Which of these blobs the tenant's cas lacks, with presigned uploads.
Request body
cursordigestsdigests[].digest- sha-256 digest as
sha256:<64 hex> digests[].size
Response
missingmissing[].digest- sha-256 digest as
sha256:<64 hex> missing[].sizemissing[].upload- how one missing blob gets to the tenant's cas, bound to the tenant and the submitting principal
missing[].upload.mode- One of
chunked missing[].upload.upload- a presigned put
missing[].upload.upload.expires_atmissing[].upload.upload.headersmissing[].upload.upload.methodmissing[].upload.upload.urlmissing[].upload.complete- a presigned put
missing[].upload.complete.expires_atmissing[].upload.complete.headersmissing[].upload.complete.methodmissing[].upload.complete.urlmissing[].upload.partsmissing[].upload.parts[].indexmissing[].upload.parts[].lenmissing[].upload.parts[].offsetmissing[].upload.parts[].upload- a presigned put
missing[].upload.upload_idnext_cursor
curl -X POST "$CIRESK_API/v1/ci/trees/missing" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"cursor": "eyJOi5k8U45exDKu22IvXLqJ7m7",
"digests": [
{
"digest": "sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49",
"size": 18432000
}
]
}'