-
Notifications
You must be signed in to change notification settings - Fork 883
[RFC] define fetch behavior between rkt fetch
and rkt run/prepare
#1196
Comments
@sgotti Thanks for the proposal! There is some back-forth discussion, made me lost...
For the kubernetes case, I don't think this solves But refrencing kubernetes's image policy is a good point, this makes me lean against my old idea: Would like to hear feedback on this :) |
Sorry for the confusion.
For the
so a will be always fetched while b only if not present. The problem arises with
Do you mean keeping the actual implementation and adding
just a note: fetching from the local disk is not just checking the URL in the remote store table. Before there's also image discovery for image strings (
This one of the reasons to remove |
After out of band talk with @yifan-gu we converged that having different behaviors for I'll try to summarize with a matrix the proposed idea from @yifan-gu (please correct me if there's something wrong): For
Implementation details related to provided image
Apply the above logic recursively to image dependencies. kubernets
|
@sgotti Thank you very much for the summary! This looks great and much clearer than our current state :) |
What happens with the |
@iaguis about the latest case (for both ACIs name string and for docker url) I'm on the fence if differentiating it from other docker tags/ACIs labels. With the current proposal the logic doesn't considers the latest value and behave identically for latest/non-latest images. But you can force fetch with --force-fetch. Considering also the latest value will add an additional behavior. These are my considerations on the "latest" case: Actually latest is populated differently based on the passed image argument:
Plus, also if it's probably a less common case, also other docker tags can be moved to different images and for ACI URLs the same URL can contain an updated file (in the actual proposal, the default behavior (first disk, then remote) will use http caching info if available). Given this I'm not sure if latest should be really considered a special case. |
FWIW, in docker it seems to fetch the digest of the image no matter what the tag is. I am thinking that we could fetch the signature/digest, do comparison in our default behavior (the local then remote case). |
Is that only for v2 registries? docker2aci doesn't support them yet |
@yifan-gu @iaguis for docker v1 we can probably save the docker imageID somewhere (not sure if in the remote table, in an new docker_remote table, or save and read it in the converted image manifest metadata) and compare it with the one provided by the server. If it's different then the tag was assigned to a different image that should be downloaded. Docker does this check only on As in the current proposal fetch/run/prepare should have the same behavior (not like docker) I have some doubts on what I wrote in the table:
I'm thinking on changing the logic in the table to avoid any remote call in the default behavior and make --force-fetch handle caching data. This will make it clearer and with less corner cases based on the provided image string. |
Given the various suggestions/comments I tried to rework it again. Thank for the patience! This makes the overall behavior IMHO clearer.
In this way, in the default behavior, if an image for a predefined URL is found in the store, no http/docker caching check is done and no remote call is done. If someone wants to check if an updated image is provided for a specified URL should use this is IMHO cleaner and removes a lot of corner cases and additional doubts like mine in the above comment. Here it is: For
behavior details related to provided image
Apply the above logic recursively to image dependencies. kubernets
|
@sgotti This looks good to me. Thanks! |
@jonboulle @vcaputo @alban @iaguis @yifan-gu If you don't have any comments/objections I'd like to start working on it in the next days. |
@xaduha If you're interested the implementing PR and additional discussion are in #1353. If I correctly understand your question, the signature verification behavior is the same as the current one. An image in the store means that it was previously imported via file, http, docker URLs and, in the applicable cases, the signature was already verified. |
I'm going to close this because #1353 has been merged! |
#1087 (comment) initially proposed two different behaviors between
rkt fetch
andrkt run/prepare
:For rkt fetch, always bypass the on-disk store.
but it wasn't implemented in the PR.The implementation in #1087 probably tries to make
rkt fetch/run/prepare
mimic the kubernetes containerimagePullPolicy
behavior.This is going to create some problems trying to control when an image should be fetched from a remote and when it should be firstly searched in the store.
For example, before #1181, if in the docker remote repository a tag (different than latest) is assigned from an already fetched image to another image it won't be noticed as the image is already in the store and this makes impossible to fetch the new image having that tag without removing the actual image from the store. After #1181, adding cache control and etags, the special docker:// scheme doesn't have these properties so the image is downloaded every time. Both behaviors are not optimal.
The same applies with ACI urls on servers not supporting ETag or Cache-Control max age.
One way to get both behavior will be to make
rkt fetch
always try to fetch an image, whilerkt run/prepare
to always try to use store images and fetch if not available.In this way:
rkt fetch
imagePullPolicy
:Always
calling firstrkt fetch
IfNotPresent
callingrkt run/prepare
Never
callingrkt run/prepare --nofetch
Proposal
I'm going to propose two different behaviors for
rkt fetch
vsrkt run/prepare
and the removal of the--local
option in favor of a--nofetch
option forrun/prepare
:rkt fetch
will always fetch whilerkt run/prepare
will always try to use the local store and fetch only when the image is not in the store (and when--nofetch=false
as by default). As an ACI has the concept of image's dependencies, this logic will be applied also to them.A little explanation of this proposal:
rkt supports different kind of image strings for fetching:
file://
http://
https://
docker://
)coreos.com/etcd:2.0.11
)For URLs the image is fetched from that URL.
For ACI image strings the URL must be retrieved with the image discovery process.
Internally to
rkt
, a docker image is considered an URL with schemedocker://
, this URL is passed to docker2aci that does the docker image fetching, squashing and conversion to an ACI. So, with docker images there's no image discovery to find the download URL as available with an ACI image name.In a next step (going to open a new issue) I think it will be good (if possible) to make docker images much more like ACIs, removing the special
docker://
scheme, introducing a docker image discovery and caching using docker registry apis.Additionally for
run/prepare
there's the--local
options that:This is probably creating more confusion than providing some benefits.
IMHO I think that differentiating the behavior between fetch and run/prepare should be useful for different cases like the previously explained.
Trying to sum it up:
fetch
(if--nofetch=false
)Note: every step is done also for every image's dependency.
/cc @jonboulle @yifan-gu
The text was updated successfully, but these errors were encountered: