Project

Profile

Help

Story #3401

closed

Create content models for pulp_docker 4.0

Added by bizhang over 6 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 42
Quarter:

Description

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=)

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.)


Related issues

Has duplicate Container Support - Task #3950: Tag modelCLOSED - CURRENTRELEASE

Actions
Blocked by Container Support - Task #3398: Make pulp_docker/4.0-dev branch ready for plugin developmentCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions
Blocks Container Support - Story #3989: Create content model serializers and viewsets for pulp_docker 4.0CLOSED - CURRENTRELEASEamacdona@redhat.com

Actions

Also available in: Atom PDF