Skip to content

Refactor backend storage layout to meet new requirements (addresses #25, #46) - #64

Merged
stevvooe merged 3 commits into
distribution:masterfrom
stevvooe:separate-signature-storage
Jan 15, 2015
Merged

stevvooe merged 3 commits into
distribution:masterfrom
stevvooe:separate-signature-storage

Conversation

@stevvooe

Copy link
Copy Markdown
Collaborator

Several requirements for storing registry data have been compiled and the backend layout has been refactored to comply. Specifically, we now store most data as blobs that are linked from repositories. All data access is traversed through repositories. Manifest updates are no longer destructive and support references by digest or tag. Signatures for manifests are now stored externally to the manifest payload to allow merging of signatures posted at different time.

The design is detailed in the documentation for pathMapper.

This change refactors the storage backend to use the new path layout. To facilitate this, manifest storage has been separated into a revision store and tag store, supported by a more general blob store. The blob store is a hybrid object, effectively providing both small object access, keyed by content address, as well as methods that can be used to manage and traverse links to underlying blobs. This covers common operations used in the revision store and tag store, such as linking and traversal. The blob store can also be updated to better support layer reading but this refactoring has been left for another day.

The revision store and tag store support the manifest store's compound view of data. These underlying stores provide facilities for richer access models, such as content-addressable access and a richer tagging model. The highlight of this change is the ability to sign a manifest from different hosts and have the registry merge and serve those signatures as part of the manifest package.

Various other items, such as the delegate layer handler, were updated to more directly use the blob store or other mechanism to fit with the changes.

Detecting tar files then falling back for calculating digests turned out to be fairly unreliable. Likely, the implementation was broken for content that was not a tarfile. Also, for the use case of the registry, it is really not needed. This functionality has been removed in FromReader and FromBytes. FromTarArchive has been added for convenience.

This work supports #25 and #46. This PR is dependent on docker-archive-public/docker.libtrust#49, which may need some discussion before merging.

Detecting tar files then falling back for calculating digests turned out to be
fairly unreliable. Likely, the implementation was broken for content that was
not a tarfile. Also, for the use case of the registry, it is really not needed.
This functionality has been removed in FromReader and FromBytes. FromTarArchive
has been added for convenience.

Signed-off-by: Stephen J Day <[email protected]>
Several requirements for storing registry data have been compiled and the
backend layout has been refactored to comply. Specifically, we now store most
data as blobs that are linked from repositories. All data access is traversed
through repositories. Manifest updates are no longer destructive and support
references by digest or tag. Signatures for manifests are now stored externally
to the manifest payload to allow merging of signatures posted at different
time.

The design is detailed in the documentation for pathMapper.

Signed-off-by: Stephen J Day <[email protected]>
@stevvooe stevvooe added this to the Registry/Beta milestone Jan 14, 2015
@stevvooe

Copy link
Copy Markdown
Collaborator Author

@dmp42

dmp42 commented Jan 14, 2015

Copy link
Copy Markdown
Contributor

LGTM

1 similar comment
@jessfraz

Copy link
Copy Markdown
Contributor

LGTM

@stevvooe stevvooe changed the title Refactor backend storage layout to meet new requirements Refactor backend storage layout to meet new requirements (address #25, #46) Jan 14, 2015
@stevvooe stevvooe changed the title Refactor backend storage layout to meet new requirements (address #25, #46) Refactor backend storage layout to meet new requirements (addresses #25, #46) Jan 14, 2015
Comment thread storage/paths.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-picky, but this should technically be "current", "link" as two separate arguments.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combining these saves two string headers in memory and an extra slice header to hold them. :)

This code could use some reorganization to reduce to reflect the actual mapping. Arguably, "link" is a specific object in the mapping but the mapper does not reflect that. We could take the to refactor this into the notion of "resources" that understand where they sit in the filesystem. One of those resources would be a blob "link".

@BrianBland

Copy link
Copy Markdown
Contributor

Added some minor comments, but LGTM

@stevvooe
stevvooe force-pushed the separate-signature-storage branch from 65dcc44 to a63b4b9 Compare January 15, 2015 18:30
This change refactors the storage backend to use the new path layout. To
facilitate this, manifest storage has been separated into a revision store and
tag store, supported by a more general blob store. The blob store is a hybrid
object, effectively providing both small object access, keyed by content
address, as well as methods that can be used to manage and traverse links to
underlying blobs. This covers common operations used in the revision store and
tag store, such as linking and traversal. The blob store can also be updated to
better support layer reading but this refactoring has been left for another
day.

The revision store and tag store support the manifest store's compound view of
data. These underlying stores provide facilities for richer access models, such
as content-addressable access and a richer tagging model. The highlight of this
change is the ability to sign a manifest from different hosts and have the
registry merge and serve those signatures as part of the manifest package.

Various other items, such as the delegate layer handler, were updated to more
directly use the blob store or other mechanism to fit with the changes.

Signed-off-by: Stephen J Day <[email protected]>
@stevvooe
stevvooe force-pushed the separate-signature-storage branch from a63b4b9 to 83d6262 Compare January 15, 2015 18:32
stevvooe added a commit that referenced this pull request Jan 15, 2015
Refactor backend storage layout to meet new requirements (addresses #25, #46)
@stevvooe
stevvooe merged commit e5f0622 into distribution:master Jan 15, 2015
@stevvooe
stevvooe deleted the separate-signature-storage branch January 15, 2015 21:33
@stevvooe stevvooe modified the milestones: Registry/2.0.0-beta, Registry/2.0 Mar 31, 2015
@stevvooe stevvooe removed this from the Registry/2.0.0-beta milestone Mar 31, 2015
jbpratt pushed a commit to jbpratt/openshift-docker-distribution that referenced this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants