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

Relocate dependent bundles during publish from archive #2669

Open
Tracked by #2671 ...
carolynvs opened this issue Mar 30, 2023 · 0 comments
Open
Tracked by #2671 ...

Relocate dependent bundles during publish from archive #2669

carolynvs opened this issue Mar 30, 2023 · 0 comments
Labels
hmm 🛑🤔 Needs more thinking time. Don't start on it yet, please. pep003-advanced-dependencies Implementation of the Advanced Dependencies proposal placeholder Tracks work that has not yet be fully designed

Comments

@carolynvs
Copy link
Member

carolynvs commented Mar 30, 2023

During porter publish --from-archive, normally the cnab-to-oci library handles relocating referenced images used by a bundle and updating the relocation mapping files. That library does not understand dependencies however. During publish, either in Porter or a fork of cnab-to-oci, we need to push dependencies when they don't exist, and ensure that the relocation mapping file is updated with their new location.

For example:

# porter.yaml
dependencies:
  requires:
    - name: mysql
      bundle:
        reference: example.com/mysql:v1.2.3

When the bundle is published to --registry=localhost:5000, the referenced mysql bundle should be copied to localhost:5000/mysql:v1.2.3 (following porter's existing relocation naming conventions).

The dependency in the final porter.yaml should be rewritten to use the repository digest of the bundle (just like we do with invocation images):

# porter.yaml
dependencies:
  requires:
    - name: mysql
      bundle:
        reference: example.com/mysql@sha256:REPOSTIORY_DIGEST

Then an entry should be added to relocation-mapping.json

{
  "example.com/mysql@sha256:abc123": "localhost:5000/mysql@sha256:RELOCATED_DIGEST"
}

Notes

  • We do not want to relocate dependent bundles during a normal publish, only when we are publishing from an archive, because dependent bundles should be reused and not making copies of its dependencies everywhere. We do want to copy when publishing across an airgap though, since the original dependency bundle will be unreachable.
  • Bundles should be published in reverse dependency order, so that we don't ever push a bundle before its dependencies

Dependencies

ℹ️ Read PEP003 - Advanced Dependencies for context about how dependencies should work, design details, and notes about desired behavior.

@carolynvs carolynvs added hmm 🛑🤔 Needs more thinking time. Don't start on it yet, please. pep003-advanced-dependencies Implementation of the Advanced Dependencies proposal placeholder Tracks work that has not yet be fully designed labels Mar 30, 2023
@carolynvs carolynvs changed the title Relocate dependent bundles during publish Relocate dependent bundles during publish from archive Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hmm 🛑🤔 Needs more thinking time. Don't start on it yet, please. pep003-advanced-dependencies Implementation of the Advanced Dependencies proposal placeholder Tracks work that has not yet be fully designed
Projects
None yet
Development

No branches or pull requests

1 participant