-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ocm-lib introduction #367
base: main
Are you sure you want to change the base?
ocm-lib introduction #367
Conversation
that has a corresponding _Type Registry_ is considered an extension point implementation (in the previous | ||
examples, the _simplemessage package_ and the _complexmessage package_ are extension points as they | ||
implement the _Message_ interface and there is a _Message Type Registry_). | ||
**Settings:** On a conceptual level, settings are values that may be set for specific objects or passed to specific |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Settings:** On a conceptual level, settings are values that may be set for specific objects or passed to specific | |
**Settings:** Settings are values that may be set for specific objects or passed to specific |
Again, within the ocm-lib, there are multiple implementations of this interface. But most importantly, the package | ||
[`genericocireg`](../../pkg/contexts/ocm/repositories/genericocireg) provides an implementation of the _OCM Repository | ||
interface_ that is based on the _OCI Repository interface_. In other words, this package provides a mapping of the | ||
_OCM Repository_ functionility to the _OCI Repository_ functionality. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_OCM Repository_ functionility to the _OCI Repository_ functionality. The | |
_OCM Repository_ functionality to the _OCI Repository_ functionality. The |
Thus, as there is an **oci** _repository type_ `OCIRegistry`, there is also an **ocm** _repository type_ `OCIRegistry`, | ||
as there is an **oci** _repository type_ `CommonTransportFormat`, there is also an **ocm** _repository type_ | ||
`CommonTransportFormat`. | ||
Within the ocm-lib this is implemented through an **addition to the factory-based type registry** concept. In case the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a word is missing here after "In case the ... "
(called `defaultdecoder`). For the OCM Repository Type Registry, this _fallback factory_ is usually | ||
[initialized](../../pkg/contexts/ocm/builder.go) with a Type Registry itself, the | ||
[`DefaultDelegationRegistry`](../../pkg/contexts/ocm/repositories/genericocireg/type.go) which is based on the | ||
[`delegationRegistry`](../../pkg/contexts/ocm/internal/delegation.go). This Type Registry's iterates through all its |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[`delegationRegistry`](../../pkg/contexts/ocm/internal/delegation.go). This Type Registry's iterates through all its | |
[`delegationRegistry`](../../pkg/contexts/ocm/internal/delegation.go). This Type Registry iterates through all its |
[initialized](../../pkg/contexts/ocm/builder.go) with a Type Registry itself, the | ||
[`DefaultDelegationRegistry`](../../pkg/contexts/ocm/repositories/genericocireg/type.go) which is based on the | ||
[`delegationRegistry`](../../pkg/contexts/ocm/internal/delegation.go). This Type Registry's iterates through all its | ||
factories and checks whether they knew that type. Currently, the only factory known by this _fallback Type Registry_ is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
factories and checks whether they knew that type. Currently, the only factory known by this _fallback Type Registry_ is | |
factories and checks whether one of them know that type. Currently, the only factory known by this _fallback Type Registry_ is |
|
||
**Other Repository Types:** | ||
Besides _OCM_ and _OCI Repository Types_, there currently also exist a number of | ||
[_Credential Repository Types_](../../pkg/contexts/credentials/repositories) that have to implement the following |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite get this: If these Credential Repo Types already exist, what is then meant with "that have to implement the following interface" ? If they do exist, wouldn't that mean they have already implemented the interface ?
a specific configuration for dealing with this _access type (= model type)_. | ||
|
||
From the perspective of the ocm-lib, any _go type_ that implements the following | ||
[interface](../../pkg/contexts/ocm/internal/accesstypes.go) can be considered an _OCI Repository_: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can the existence of a go type implementing this AccessMethod interface be considered a OCI repository ? Below, an implementation for S3 or GitHub are mentioned as examples, which is not an OCI repositories, so maybe rather "OCM Repository" is meant here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a copy-paste mistake. It should be ...can be considered an Access Method.
a triple of _RepositoryType_ (e.g. `OCIRegistry`, `CommonTransportFormat`, ...), _ArtifactType_ (e.g. `OCIArtifact`, | ||
`ociImage`, ...) and _MimeType_ (e.g. `text/plain`, `application/gzip`, ...). The upload logic passes the current | ||
contextual information about the underlying _storage repository type_ and the _artifact_ and _mime type_ at hand to the | ||
_Lookup Handler_ method a _Constraint Registry_, which eventually returns a number of _Handlers_ fulfilling the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_Lookup Handler_ method a _Constraint Registry_, which eventually returns a number of _Handlers_ fulfilling the | |
_Lookup Handler_ method of a _Constraint Registry_, which eventually returns a number of _Handlers_ fulfilling the |
|
||
### Section 3.3 - Constraint Registries aka. Handler Registries (and Handler-Registration Handler Registries) | ||
|
||
**Constraint Registries aka. Handler Registries** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these called CONSTRAINT Registries ? That term seems a bit unintuitive, no ?
} | ||
``` | ||
|
||
Thus, a `HandlerRegistrationHandlerRegistry` also is itself also a `HandlerRegistrationHandler`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thus, a `HandlerRegistrationHandlerRegistry` also is itself also a `HandlerRegistrationHandler`. | |
Thus, a `HandlerRegistrationHandlerRegistry` is itself also a `HandlerRegistrationHandler`. |
`BlobHandlerRegistry` by calling the BlobHandlerRegistry's _Register_ method (e.g. in an | ||
[init](../../pkg/contexts/ocm/blobhandler/oci/ocirepo/blobhandler.go) function to register that implementation in a | ||
DefaultRegistry). Thereby, you have to pass an object of that handler implementation to the _Register_ method. | ||
But imagine you are working with the _ocm-cli_ and you want to register either a predefined `BlobHandler` (in other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But imagine you are working with the _ocm-cli_ and you want to register either a predefined `BlobHandler` (in other | |
But imagine you are working with the _ocm-cli_ and you want to register a predefined `BlobHandler` (in other |
`BlobHandlerRegistry` by calling the BlobHandlerRegistry's _Register_ method (e.g. in an | ||
[init](../../pkg/contexts/ocm/blobhandler/oci/ocirepo/blobhandler.go) function to register that implementation in a | ||
DefaultRegistry). Thereby, you have to pass an object of that handler implementation to the _Register_ method. | ||
But imagine you are working with the _ocm-cli_ and you want to register either a predefined `BlobHandler` (in other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be a usecase for registering such a predefined Handler ? Why is this a necessary feature to have , making things rather complex ? I would like to see some real-world example here, which could really help to motivate the reader to understand this complex stuff ...
} | ||
``` | ||
|
||
A `RepositorySpecHandlers` Registry **is not** also a `HandlerRegistrationHandlerRegistry`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to state this so explicitly here ? And if it is necessary, some reasoning why this is not the case should be provided.
These decisions can be made within BlobHandlers. The `StoreBlob` method has to return an `AccessSpec` that can then be | ||
inserted into the corresponding new _Component Descriptor_. | ||
|
||
A `BlobHanderRegistry` **is** also a `HandlerRegistrationHandlerRegistry`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: If it is necessary to state this here so explicitly, then some reasoning would be nice.
Here, the different _Contexts_ shown in the overview are explained. | ||
|
||
A context object is the _entry point_ for using dedicated functional areas. It bundles all _settings_ and | ||
_extensions point implementations_ for this area. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_extensions point implementations_ for this area. | |
_extension point implementations_ for this area. |
@fabianburth @mandelsoft What should happen with this issue? |
What this PR does / why we need it:
It provides an introduction and overview of the ocm-lib to help other developers to get started.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release Notes: