Skip to content
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

composition support #561

Merged
merged 30 commits into from
Nov 8, 2023
Merged

Conversation

mandelsoft
Copy link
Contributor

@mandelsoft mandelsoft commented Oct 28, 2023

Description

This PR introduces the composition repository. It is a memory based repository
using the referenz feature of blobs to keep blob accesses in memory and keep
external resources as long as the blob is still in use by the repository.

This feature is used to support memory based composition component versions
existing without a backing storage like an OCI registry.

The AddVersion methods on repositories are extended to work with any
component version, not only the ones, which are backed by the same repository.
This allows copying component versions directly with the core API without
the need of transferring it. This requires some simple transfer login
in the core api. The generic component view wrapper now implements
the transfer of local blobs when adding a component version from another repository.
Therefore it uses the traditional StoreBlob method also used by the transfer tool.

A Resource/SourceAccess can now be added directly to a component version.
The access spec/method provided by those accesses is now optional, but always
the BlobAccessmthod must implemented. The new SetResource/SourceAccess.
implicitly add a local blob if there is no access spec provided, or local access spec.
Otherwise the access spec is used.

This makes it possible to provide implementations of a ResourceAccess and SourceAccess
without a backing component version, which either specifies an access spec or blob
based content. This is used by the new package elements, which provides option based
builders for Resource/Source Access implementation describing technology-specific
blob-based and access-base instances, which can the be added to a component version.

Additionally, there lots of fixes to solve problems, which occurred during the introduction
of the new elements.

To continue with the cleanup of the package structure some packages are moved to up
and the old functions/methods are deprecated.

FInally, there is a complete example for an end-to-end scenario for providing and publishing
a component version and consuming this version is a target environment with transport,
localization and deployment.

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

  • Related Issue # (issue)
  • Closes # (issue)
  • Fixes # (issue)

Remove if not applicable

Screenshots

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🙅 no documentation needed

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

eliminate the hybrid handling for access methods:
- as provided by the access type: non-dup
- explicit method view interface with dup and
  wrapper introducing the dup.

Now, the cosumer view is just the AccessMethos interface
providing ref counting and Dup.

The old interface is just the implementation interface
AccessMethodImpl, now. It must be wrapped ba an access method provider
using a cpi function into a regular AccessMethod object before
returning it to the consumer.

ATTENTION: for regular consumers of the intreface, this is transparent,
but type casts to the implementation type is not possible anymore.
If there is internal coding urgently requiring access to the
implementation, there is a cpi function GetAccessMethodImplementation.
fabianburth
fabianburth previously approved these changes Nov 6, 2023
fabianburth
fabianburth previously approved these changes Nov 7, 2023
fabianburth
fabianburth previously approved these changes Nov 7, 2023
@mandelsoft mandelsoft merged commit dcaa66f into open-component-model:main Nov 8, 2023
20 checks passed
@mandelsoft mandelsoft deleted the compose branch November 8, 2023 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants