[DO NOT MERGE] Naive push + pull implementation #307
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds push and pull implementation for CNAB bundles using
coras
(which is using a combination ofdeislabs/oras
andpivotal/image-relocation
to push all referenced images to a new OCI repository, then store the actual bundle file).This is not intended for mainstream use, but to explore how Porter would interact with OCI registries (currently regardless of actual implementation), and this PR adds
porter bundle push [input bundle file] [target registry]
andporter bundle pull [output bundle file] [target registry]
.This has been tested with Azure Container Registries and the upstream
registry
image, and the easiest way to test is to start a container with that image:Then, create a new project / use an existing one, update the invocation image field from
porter.yaml
to a registry with push access, in order to build the image (it doesn't have to be the same registry you intent to actually push the bundle, as long as you can build the bundle using Porter). For simplicity, you can use the same instance of registry started earlier:Then, build and push the bundle:
This relocates all container images referenced in the bundle to the target repository, then uploads the updated bundle file (with the new image references) to the registry, using
oras
.At this point, you can pull the bundle:
Note that the current UX around these operations is extremely rough, and a major reason for opening this PR so early is to get some feedback around how this should be handled, directly integrated with
porter install
, or any other ideas that make sense.Thanks!
cc @carolynvs @jeremyrickard