This repository has been archived by the owner on Aug 14, 2020. It is now read-only.
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.
I tried to implement, also to see possible problems, the @mpasternacki proposal of image tags #575 (comment)
I'm not sure if this is going to create too much complexity. For sure it'll add some complexity on managing them inside rkt to fit its needs to cache data locally and to obtain the same images that will be obtained doing discovery.
But it'll also fix some of the problems reported in #575 and other issues.
Probably it'll break some current behaviours but I can't find a way to make it completely backward compatible (or perhaps these behaviours will be broken just because they aren't correct).
Doing this I met (again) the need to finally define the image string format (#479), but I left it for the future.
Probably the wording in the spec can be vastly improved. I just tried to trigger an initial discussion.
This patch introduces the concept of image tags.
Since many ACEs (like rkt) wants to implement local caching I tried to
define Image Tags considering this as a primary requirement.
While an image is static since its labels are written in its manifest and
changing them will change the image id, image tags are dynamic.
In short words it adds another file that contains a map to convert a tag
to another tag (alias) and/or expand a tag to a set of labels.
It practically adds a layer above current image discovery used to obtain
the final set of labels to use to calcultae
ac-discovery
URLs.Image Tags are defined to be per image name. This is needed to satisfy
the need to locally cache them (since they should be cached and retrieved
using a key and this key is the image name).
This will be useful to fix different issues and enhancements.
This patch:
additional step)
value after the ":" as a Tag instead of the version label.
by an ACE). As a fallback, if no image tags data is provided, the
version label will be set from the tag value.
(like done for an ACI).
Docker compatibility
Actually docker2aci converts a docker image (squashing it) to an ACI and
sets the version label to the image tag. This is a fast but not
consistent way to use docker tags since they can be dynamically changed.
With this proposal an idea will be to convert docker tags to an
Image Tags file (using the docker APIs). Docker tags are per
repository and a repository is mapped to an ACI image name. So this should match the proposal that defines imagetags per image.
Docker images don't have a version label but can have a label
representing the docker image ID. So an image tag can point to that
"dockerimageid" label.
rkt related work
For rkt, the changes to implement to satisfy image tags should be:
rkt image list
shouldn't showapp:$version
butapp,version=$version
. Or better, since this can be confusing, just split them and use a column for app name and a column for all the ACI labels.Some open points:
rkt image list
thereshould be something like
rkt imagetags list
)rkt --no-store fetch imagename
, but this will also fetch an image). Tojust fetch/update ImageTags something like
rkt imagetags --no-store fetch {IMAGENAME|file|URL}
should be added. Providing and image name will use discovery, while the other will
just fetch it from the provided file/URL.
won't carry Image Tags information. So a successive attemp to run an
image by its image string can use a different image than the one that
will be run using an image discovery returning Image Tags data (due to
the fallback of setting the version label value to tag if no image tag
data is available). So a command like the above
rkt imagetags fetch
isneeded also for this reason.