Story #3401
Updated by jortel@redhat.com about 6 years ago
*Manifest(Content)* models a docker manifest:
* digest: CharField(255, db_index=True, unique=True)
* schema_version: IntegerField()
* media_type: CharField(choices=)
media_type choices:
* application/vnd.docker.distribution.manifest.v1+json
* application/vnd.docker.distribution.manifest.v2+json
---
*ManifestBlob(Content)* models the relationship between Manifests and Blobs. Each blob is stored as an _Artifact_ and is related by _ContentArtifact_.
* digest: CharField(max_length=255, db_index=True, unique=True)
* manifest: ForeignKey(Manifest, related_name='blobs', on_delete=CASCADE)
* media_type: CharField(choices=)
* size: IntegerField()
media_type choices:
* application/vnd.docker.container.image.v1+json - Container config json represented as a blob
* application/vnd.docker.image.rootfs.diff.tar.gzip - Regular blob
* application/vnd.docker.image.rootfs.foreign.diff.tar.gzip - Foreign blob ( we do not intend to store foreign blobs. Docker client during pull will fetch it from the remote location)
---
*ManifestList(Content)* models a docker manifest-list.
* digest: CharField(max_length=255, db_index=True, unique=True)
* schema_version: IntegerField()
* manifests: ManyToManyField('Manifest', through='ManifestListManifest')
* media_type: CharField(choices=)
media_type choices:
* application/vnd.docker.distribution.manifest.list.v2+json
---
*ManifestListManifest* - models the many-to-many relationship between Manifest and ManifestList.
* manifest: ForeignKey(Manifest, related_name='manifests', on_delete=CASCADE)
* manifest_list: ForeignKey(ManifestList, related_name='manifest_lists', on_delete=CASCADE)
* architecture: CharField(255)
* os: CharField(255)
* os_version: charField(255)
* os_features: TextField()
* variant: CharField(255)
* features: TextField()
---
*Tag(Content)*
* name CharField(255, db_index=True)
* manifest ForeignKey(Manifest, null=True, related_name='tags', on_delete=CASCADE)
* manifest_list ForeignKey(ManifestList, null=True, related_name='tags', on_delete=CASCADE)
unique_together = (name, manifest)
unique_together = (name, manifest_list)
Design assumptions:
* Pre-save validation on the model ensures that one-of but not both _manifest_ and _manifest_list_ are set.
* Tag name uniqueness and referential integrity{1} will be enforced by the plugin. During sync, this happens in the task logic. For content add/remove API calls, this happens in the (docker specific) view. Both can re-use the same code.
*[1]* Tag referential integrity is ensuring that when a manifest or manifest_list is removed from a repository, referencing tags are also removed. Also, when a tag is added to a repository, referenced manifest or manifest_list are also added.
---
This story will be complete when CRUD is possible for Manifests (for this story, the metadata is not expected to be extracted from the file, but provided by the user in the request body.)