-
Notifications
You must be signed in to change notification settings - Fork 212
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
feat(*): add publishing from an archive #700
Conversation
b42474a
to
fbab719
Compare
964c8fe
to
c77fa83
Compare
c77fa83
to
79068bd
Compare
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.
LGTM
pkg/porter/publish.go
Outdated
return err | ||
} | ||
|
||
digest, err := p.Registry.Copy(img, newImg) |
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.
So when we publish an archived bundle, the contents of the bundle don't really matter (the referenced images). We use the tags from where the images were originally published, and rely on being able to copy from there to the new location. We don't copy from the archive itself. Am I understanding that right?
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.
Good clarification -- indeed, this is the current approach.
As I understand it, the functionality for importing images from an OCI Image layout (i.e., images in the /artifacts
dir of the archive) into the Docker daemon is not yet available (see cnabio/cnab-go#136)
Should I add a note/comment in-line mentioning this? Would it be prudent to add a ticket in our backlog to revisit this area, If/when the aforementioned functionality is available? (To import images straight from the archive into the local daemon and then re-tag/push.)
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.
So how does this work with the offline scenario where the bundle is on an air-gapped network?
I think we need to use the Pivotal relocation library here and copy FROM the archive up to a new registry. Loading things into the local docker daemon is nice, but for any case that involves a registry, it is kind of irrelevant isn't it?
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.
Mmm good point. I'll work on the layout relocation approach directly from the archive and update.
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.
Ok @carolynvs & @jeremyrickard , updated logic to use the relocation lib to parse extracted OCI Layout and push renamed imgs directly from the archived images (same digests). Did find one issue which I'll raise in the image-relocation repo, but I don't think it is a blocker (and I believe the fix would be in this dependency, anyhow). edit: added comment to pre-existing issue in pivotal/image-relocation
beaef16
to
94a8186
Compare
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.
LGTM, let's merge this and play around with it for a while.
@vdice do we have issues to update cnab-go, I see you're refing a branch of your cnab-go fork?
- add --archive and --tag flags to porter publish - defer to tag when publishing bundle (from archive or not) - wire up archive importer/loader and publish bundle once loaded
94a8186
to
8a3d1bb
Compare
What does this change
--archive
and--tag
flags toporter publish
--tag
valueTODO:
TODO
s--tag
or add new--registry
flag, etc.?What issue does it fix
Towards #545
Notes for the reviewer
deislabs/cnab-go
dep currently using branch w/ DeepCopy() functionality in: feat(bundle.go): add DeepCopy for InvocationImage/BaseImage/Image cnabio/cnab-go#143Checklist