Skip to content

Commit

Permalink
add nydus image artifact
Browse files Browse the repository at this point in the history
Artifact manifest is a nice way to offer the ability of enhancing
registry as well as applying minimum modifications to client tools.

Nydus image is an alternative representation of container image,
providing benefits like making starting containers as fast as
possible.

We'd like to have nydus image persist as a new artifact like helm
charts.

Note that we uses loose "reference" for the ociv1 image because our
assumption is that a Nydus image can be stored and used without the
ociv1 image's help.

Signed-off-by: Peng Tao <<tao.peng@linux.alibaba.com>>
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
  • Loading branch information
liubogithub committed Feb 25, 2021
1 parent a56aaad commit aa0bdb8
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions artifact-manifest/artifact-manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ A CNAB may also be persisted with configuration information, along with a refere

![Wordpress CNAB](media/wordpress-cnab.svg)

### Nydus Image

A Nydus image is an alternative representation of container image, providing benefits like lazy-loading of images, etc. Since it can be stored independently or along with the OCI image, their references are loose references.

## Supported Scenarios

The main scenarios include:
Expand Down Expand Up @@ -474,6 +478,95 @@ As the `oci-reg copy` command is executed, the graph of references are expanded.
]
}
```

#### Nydus Image Reference

> **OPTION A**
```json
{
"schemaVersion": 1,
"mediaType": "application/vnd.oci.artifact.manifest.v1+json",
"artifactType": "application/vnd.cncf.nydus.v1",
"config": {
"mediaType": "application/vnd.oci.image.manifest.config.v1+json",
"digest": "sha256:9e988712154fcc2ceda5602eb1d98c1f28299ba6fbf0be49d3717c35a2d76674",
"size": 1102
},
"blobs": [
{
"mediaType": "application/vnd.cncf.nydus.bootstrap.v1.tar+gzip",
"digest": "sha256:f6bb0822fe567c98959bb87aa316a565eb1ae059c46fa8bba65b573b4489b44d",
"size": 32654
},
{
"mediaType": "application/vnd.cncf.nydus.blob.v1",
"digest": "sha256:f6bb0822fe567c98959bb87aa316a565eb1ae059c46fa8bba65b573b4489b44d",
"size": 72832
},
{
"mediaType": "application/vnd.cncf.nydus.blob.v1",
"digest": "sha256:f6bb0822fe567c98959bb87aa316a565eb1ae059c46fa8bba65b573b4489b44d",
"size": 928324
}
],
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.config.v1+json",
"digest": "sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b",
"size": 16724
"annotations": {
"oci.distribution.relationship": "references",
"oci.distribution.artifact": "mysql:8"
}
}
]
}
```

> **OPTION B**
```json
{
"schemaVersion": 1,
"mediaType": "application/vnd.oci.artifact.manifest.v1+json",
"artifactType": "application/vnd.cncf.nydus.v1",
"config": {
"mediaType": "application/vnd.oci.image.manifest.config.v1+json",
"digest": "sha256:9e988712154fcc2ceda5602eb1d98c1f28299ba6fbf0be49d3717c35a2d76674",
"size": 1102
},
"blobs": [
{
"mediaType": "application/vnd.cncf.nydus.bootstrap.v1.tar+gzip",
"digest": "sha256:f6bb0822fe567c98959bb87aa316a565eb1ae059c46fa8bba65b573b4489b44d",
"size": 32654
},
{
"mediaType": "application/vnd.cncf.nydus.blob.v1",
"digest": "sha256:f6bb0822fe567c98959bb87aa316a565eb1ae059c46fa8bba65b573b4489b44d",
"size": 72832
},
{
"mediaType": "application/vnd.cncf.nydus.blob.v1",
"digest": "sha256:f6bb0822fe567c98959bb87aa316a565eb1ae059c46fa8bba65b573b4489b44d",
"size": 928324
}
],
"manifests": [],
"references": [
{
"mediaType": "application/vnd.oci.image.manifest.config.v1+json",
"digest": "sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b",
"size": 16724
"annotations": {
"oci.distribution.artifact": "mysql:8"
}
}
]
}
```

### Deletion

Distribution-spec APIs will provide standard delete operations, including options for deleting referenced artifacts, or blocking a delete as the artifact is referenced by other artifacts. The `oci.artifact.manifest` collection will provide the information, as defined by the artifact author` for how an artifact should be handled for delete operations. The registry, nor the `oci-reg` cli would need to know about specific artifact implementations.
Expand Down Expand Up @@ -530,6 +623,7 @@ Examples include:
- A helm chart referencing container images
- A CNAB referencing Helm charts or other artifacts the CNAB may need to complete it's operation
- A WASM that may reference other packages that may be stored in a registry.
- A nydus image referencing the container image from which it can be converted.

References are collections of OCI Artifact Content Descriptors.

Expand Down
Binary file added artifact-manifest/media/nydus_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aa0bdb8

Please sign in to comment.