| 1 |
package cacheimport |
| 2 |
|
| 3 |
// Distributable build cache |
| 4 |
// |
| 5 |
// Main manifest is OCI image index |
| 6 |
// https://github.com/opencontainers/image-spec/blob/master/image-index.md . |
| 7 |
// Manifests array contains descriptors to the cache layers and one instance of |
| 8 |
// build cache config with media type application/vnd.buildkit.cacheconfig.v0 . |
| 9 |
// The cache layer descriptors need to have an annotation with uncompressed digest |
| 10 |
// to allow deduplication on extraction and optionally "buildkit/createdat" |
| 11 |
// annotation to support maintaining original timestamps. |
| 12 |
// |
| 13 |
// Cache config file layout: |
| 14 |
// |
| 15 |
//{ |
| 16 |
// "layers": [ <- layers contains references to blobs |
| 17 |
// { |
| 18 |
// "blob": "sha256:deadbeef", <- digest of layer blob in index |
| 19 |
// "parent": -1 <- index of parent layer, -1 if no parent |
| 20 |
// }, |
| 21 |
// { |
| 22 |
// "blob": "sha256:deadbeef", |
| 23 |
// "parent": 0 |
| 24 |
// } |
| 25 |
// ], |
| 26 |
// |
| 27 |
// "records": [ <- records contains chains of cache keys |
| 28 |
// { |
| 29 |
// "digest": "sha256:deadbeef", <- base digest for the record |
| 30 |
// }, |
| 31 |
// { |
| 32 |
// "digest": "sha256:deadbeef", |
| 33 |
// "layers": [ <- optional array of layer pointers |
| 34 |
// { |
| 35 |
// "createdat": "", |
| 36 |
// "layer": 1, <- index to the layers array, layer is loaded with all of its parents |
| 37 |
// } |
| 38 |
// ], |
| 39 |
// "chains": [ <- optional array of layer pointer lists |
| 40 |
// { |
| 41 |
// "createdat": "", |
| 42 |
// "layers": [1], <- indexes to the layers array, all layers are loaded in specified order without parents |
| 43 |
// } |
| 44 |
// ], |
| 45 |
// "inputs": [ <- dependant records, this is how cache keys are linked together |
| 46 |
// [ <- index of the dependency (0) |
| 47 |
// { |
| 48 |
// "selector": "sel", <- optional selector |
| 49 |
// "link": 0, <- index to the dependant record |
| 50 |
// } |
| 51 |
// ] |
| 52 |
// ] |
| 53 |
// } |
| 54 |
// ] |
| 55 |
// } |