This repository has been archived by the owner on Aug 14, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 pratically adds a layer above current image discovery used to obtain the final set of labels to use to calculte `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: * Introduce Image Tags format. * Details the discovery process (since there's now an optional additional step) * Add a "tag" inside image dependencies in image manifest. * Change the app string format parsing function. It now defines the value after the ":" as a Tag instead of the version label. * Add code for doing tag resolution and labels merging (that can be used by an ACE). As a fallback, if no image tags data is provided, the version label will be set from the tag value. * The image tags fetching and verification logic is left to the ACE (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 consisten way to 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 their apis). Also in docker tags are per repository and a repository is mapped to an ACI image name. 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: * Image Tags fetching and validation * Labels Merging (calling imageTags.MergeTag providing the starting * labels and tag value) * Caching of Tags Data per app name * Use of imageTags.MergeTag before calling GetACI. * Removal of "latest" column from the store since it was a hack around * current spec default "latest" version. Some open points: * Since there're an additional layer and an additional file there's the need to: * inspect Image Tags data (like the current `rkt image list` there should be something like `rkt imagetags list`) * fetch/update them (they are automatically fetched using `rkt --no-store fetch imagename`, but this will also fetch an image). To just 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. * Since rkt also accept fetching an image from a file or URL, doing this won't carry Image Tags information. So a successive attemps to run an image by it's 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` is needed also for this reason.
- Loading branch information