-
Notifications
You must be signed in to change notification settings - Fork 383
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
Implement sync semantic between source and destination image repository #155
Comments
For manifests, it seems far simpler to just upload them than to do one extra roundtrip to see whether we need to upload them. The data is small, the roundtrip latency should be more noticeable than the data transfer latency. No, |
I want to implement incremental download layers of image which in the same repository from Docker hub to local So that I can incremental import image from |
That’s not how
… I can’t see how not doing copies when saving into |
We can archieve it, make docker daemon incremental load from OCI layout directories:) |
Not quite sure whether this is the right issue, but I am after a sync semantic as well. I'd like to "backup" images from a running Docker daemon to disk. I was thinking of some ostree format. Then on request, I want to sync from disk back to a Docker daemon/registry. To provide some more context, I want to do this in the context of minishift/minishift#143. In the Minishift case we have a Docker daemon running w/i a VM. I'd like to be able to re-create the VM and restore exported images in order to avoid having to download required images over and over again. Can this be done with containers/images? |
@hferentschik Do you just need ordinary copies, or what this issue calls “sync”, i.e. sharing of the common layers among several images? Without sharing creating a separate $backup per image, ( If sharing of common layers is desirable, now (as of rc5) that OCI has an index , something like that should be possible—and is in fact very close to possible: the read path seems to be already implemented. The write path always overwrites the index, but reading and updating the old version should be a quite simple change to |
I would have expected that common layers are saved. If I understand this correctly, using dir, I would need to export each image into its own directory. There would be no sharing of layers. In this case what is really the difference to 'docker save'. I might as well just call 'docker save' for all images. I was hoping to gain something by using container/images. Right now, I can copy an image from the registry to a directory, however, I have several issues which I just temporarily worked around for now (mainly around the fact that there are several Linux specifics in the code preventing me to use this library in a cross platform manner). If there is no way to save images and share layers, I might be barking up the wrong tree. I've seen this presentation - https://fedorapeople.org/~dwalsh/Presentations/ContainersInProduction - and was hoping I could export images into a file based ostree structure. Does this make sense? |
Sure, but what do I gain over a plain docker save/load in this case? |
Nothing for that use. Flexibility in sources/destinations (e.g. that can be copy from a registry to dir:, then later from dir: to daemon). |
Right, containers/image Anyway, that would be something completely separate from the original request above, which mentions |
:-( Got you. I was assuming that all supported "protocols" would be two way.
I guess both are fine for my purposes. Can you give come ETA for this? |
That depends on someone doing the work :) Would you be interested in helping? |
@mtrmac, sorry for the long turn-around on this, but I got side-tracked. However, I would like to take up the discussion again. TBH, I am a bit lost atm, in terms of how the OCI format works and also what's required to make this sync semantic work. So here is some test code I've wrote:
So basically I am copying two versions of busybox into a oci directory. My first question is, how do I get them out again? I see the various layers, but no meta information on what images are in the "store". Am I missing something? And concretely about this sync functionality, what are the missing pieces? |
(Note that with AFAICS (without testing your code in practice, so I may be overlooking something) the only missing piece is that (FWIW see also #294 , though that should not directly impact the work on |
I was kind of assuming that oci:/Users/hardy/tmp-2/oci is the base directory for multiple images and that I could store arbitrary images under the same path. But you seem to imply something like:
How would that layout be able to share layers?
So right, looking at the busybox example again. If I copy two versions of busybox into the same oci directory, I get all the layers, but the index only contains one reference. So really the oci destinations only supports single image copies atm. It is not creating an actual OCI "repository". Correct? |
Sure; but
See
Yes. (Strictly speaking, it is creating a single-image repository.) Storing multiple images is currently unimplemented, and contributions would be welcome. |
Got you.
I really would see this feature, since we would dearly need it for minishift/minishift#952. You seem to think that it is not so hard, but I fear it would take me quite some time to even understand where and how to plug this in and obviously it would need to fit the overall strategy/plan for containers/image. At the very least I think I would need some concrete pointers on what to do. On a different note, while digging around I found https://github.com/sgotti/oci-store which seems a bit what I am after. However this is a single commit repo and dependencies are not part of the repo. Is this repo in any way related to what you guys are doing? |
Is #155 (comment) enough? The minimal version, without cleaning up unreferenced layers, considering the size of |
Ok, I see what I can do. I try to work on this this week... |
@hferentschik If you just want an OCI CAS implementation, take a look at https://github.com/openSUSE/umoci (specifically, |
Signed-off-by: Hardy Ferentschik <[email protected]>
Signed-off-by: Hardy Ferentschik <[email protected]>
Signed-off-by: Hardy Ferentschik <[email protected]>
Signed-off-by: Hardy Ferentschik <[email protected]>
Signed-off-by: Hardy Ferentschik <[email protected]>
Signed-off-by: Hardy Ferentschik <[email protected]>
Issue #155 Making sure existing OCI index gets not overwritten
@hustcat @mtrmac @vrothberg I believe there is still work going on this, or at least there is a sync PR. Are we continuing to work on this? |
This is being tracked in containers/skopeo#524. |
For the record, if you actually read the issue, this is only tangentially related to containers/skopeo#524 , and was actually fixed in #326 . |
copy
semantic in current implementation, all data(include manifest and image layer) in destination will be overwrited by source without to see if it exist.IMO we should implement
sync
semantic between source and destination image repository, if layer in destination is exist, it won't be downloaded repeatedly. This will be more efficient.The text was updated successfully, but these errors were encountered: