Skip to content

Commit 4909a90

Browse files
Fricounetimeoer
authored andcommitted
[nydusify] Bump acceleration-service to build manifests with artifactType
Nydus images built using `nydusify convert --merge-platform` will now use the `artifactType` field in the index to identify the nydus manifest. This replaces the former `os.features: "nydus.remoteimage.v1"` because using it was proving to be difficult on some registries like ECR which do not accept this field. The SOCI snapshotter actually also use this field so if any registry doesn't support `artifactType` in the future, they will have more pressure to support this. Signed-off-by: Baptiste Girard-Carrabin <[email protected]>
1 parent c5d2944 commit 4909a90

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

contrib/nydusify/examples/manifest/index.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
"size": 1367,
1717
"platform": {
1818
"architecture": "amd64",
19-
"os": "linux",
20-
"os.features": [
21-
"nydus.remoteimage.v1"
22-
]
23-
}
19+
"os": "linux"
20+
},
21+
"artifactType": "application/vnd.nydus.image.manifest.v1+json"
2422
}
2523
]
2624
}

contrib/nydusify/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/distribution/reference v0.6.0
2121
github.com/docker/cli v28.1.1+incompatible
2222
github.com/dustin/go-humanize v1.0.1
23-
github.com/goharbor/acceleration-service v0.2.18
23+
github.com/goharbor/acceleration-service v0.2.19
2424
github.com/google/uuid v1.6.0
2525
github.com/hashicorp/go-hclog v1.6.2
2626
github.com/hashicorp/go-plugin v1.6.0

contrib/nydusify/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
125125
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
126126
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
127127
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
128-
github.com/goharbor/acceleration-service v0.2.18 h1:xI1U/2AoH+1m5uV2QmwHPBPxxBTTPr0m7QvbU0HAQoY=
129-
github.com/goharbor/acceleration-service v0.2.18/go.mod h1:REj3y6AJjrOZbH0K904W/7QYojkiFECdLomJCyXOgxk=
128+
github.com/goharbor/acceleration-service v0.2.19 h1:pZ1iBaUUAZiQReqWHvYMM9f1M/HB2kLeXKmgDdMyCdk=
129+
github.com/goharbor/acceleration-service v0.2.19/go.mod h1:REj3y6AJjrOZbH0K904W/7QYojkiFECdLomJCyXOgxk=
130130
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
131131
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
132132
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=

docs/nydus-design.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Rafs is a filesystem image containing a separated metadata blob and several data
6868
| | | |
6969
+------------+-----------+-------------------------------------------------+
7070
```
71-
71+
7272
## 3. Integrity Validation
7373
### 3.1 Metadata Integrity Validation
7474
Firstly, Nydus does basic verification of metadata values, looking for values that are in range (and hence not detected by automated verification checks) but are not correct.
@@ -185,9 +185,9 @@ pub struct OndiskInodeWrapper<'a> {
185185
pub inode: &'a OndiskInode,
186186
}
187187
```
188-
188+
189189
The OndiskInode struct size is padded to 128 bytes.
190-
190+
191191
* If it's a directory, all its children are indexed contiguously in `inode table`, and `i_child_index` is the index of the first child and `i_child_count` is the amount of its children.
192192
* If it's a file, `i_child_index` is not used.
193193
*`i_name_size` is the length of its name.
@@ -248,7 +248,7 @@ pub struct OndiskXAttrs {
248248
}
249249
```
250250

251-
A list of `OndiskChunkInfo` is also stored after xattr if the inode contains file data. Each chunk info tells us where to find data in blob file, it contains
251+
A list of `OndiskChunkInfo` is also stored after xattr if the inode contains file data. Each chunk info tells us where to find data in blob file, it contains
252252
- the hash value `block_id` calculated from the chunk data,
253253
- the blob file it belongs to,
254254
- whether the chunk is compressed,
@@ -323,7 +323,7 @@ pub struct OndiskBlobTable {
323323
Nydus manifest is designed to be fully compatible with OCI image spec and distribution spec by adding an extra manifest file to store the pointers of nydus bootstrap (i.e. metadata) and blobfile (i.e. data).
324324

325325
## 1. Image Index
326-
A typical image index enabling nydus points to two manifest files, one is the traditional OCI v1 image manifest, the other is the nydus manifest that takes advantage of `platform` and puts `os.features: ["nydus.remoteimage.v1"]` field under `platform`.
326+
A typical image index enabling nydus points to two manifest files, one is the traditional OCI v1 image manifest, the other is the nydus manifest that takes advantage of `artifactType` and puts `application/vnd.nydus.image.manifest.v1+json` as a value to identify the nydus image.
327327

328328
```json
329329
{
@@ -345,10 +345,8 @@ A typical image index enabling nydus points to two manifest files, one is the tr
345345
"platform": {
346346
"architecture": "amd64",
347347
"os": "linux",
348-
"os.features": [
349-
"nydus.remoteimage.v1"
350-
]
351-
}
348+
},
349+
"artifactType": "application/vnd.nydus.image.manifest.v1+json"
352350
}
353351
]
354352
}

0 commit comments

Comments
 (0)