Story #3401
Updated by jortel@redhat.com almost 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) * media_type: CharField(choices=) * size: IntegerField() Some fields on this model appears to be redundant to the fields found on the Manifest Model, but they are necessary because the provided json for a ManfiestList is not guaranteed to match the reality of a manifest. media_type choices: * application/vnd.docker.distribution.manifest.v1+json * application/vnd.docker.distribution.manifest.v2+json --- *Platform* models a platform and its 1-1 relationship to a manifest contained within a manifest-list. * manifest_list_manifest: OneToOne(ManifestListManifest, on_delete=CASCADE) * architecture: CharField(255) * os: CharField(255) * os_version: charField(255) * os_features: TextField() JSONField() * variant: CharField(255) * features: TextField() Still need to decide how to model the feature lists. JSONField() --- 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.)