appc / spec

App Container Specification and Tooling (archived, see https://github.com/rkt/rkt/issues/4024)
Apache License 2.0
1.26k stars 146 forks source link

Document best practices for version label usage? #582

Open krobertson opened 8 years ago

krobertson commented 8 years ago

Wanted to have a short discussion on what some thoughts were about "best practices" for version label usage in ACI images.

In the spec, version is just a label, and label values are just strings. However, the version label is also a special one in that it plays a more prominent role in the discovery process than other labels.

In particular, looking at version settings and practices around prefixing the version string, such as with a v. Other fields within AppC that enforce version semantics like the acVersion field focus on prefixes, and are simply 0.7.4. JSON examples for the ACI format include version labels with 1.0.0 as the value. However, actual usage wise, the etcd ACI image uses v2.3.0 as the value.

Although agree with labels generally be freeform strings and don't want strict settings around the version label, being too undefined here does have end-user implications. Someone using a container engine that supports AppC could end up getting whether the app they're wanting to use is prefixing versions or not. This is something that also exists in the Docker ecosystem with no clear guidelines.

So instead of a strict requirement, thinking it may make sense to have some written best practices to help guide image authors.

I think it'd also be good to look at some common ways in which the version label could be used, since version itself could be rather ambiguous.

Some common usages may be:

Any others?

Personally, I'm sort of torn on "to v or not to v". Some examples:

@iaguis @jonboulle @philips

sgotti commented 8 years ago

@krobertson If you leave the version label as any other label (free form string) then you can do any suggestion but it'll remain a suggestion. There'll be no implications on the discovery logic or some implied behaviours. An user can continue to use anything.

If you make it special and enforce its usage (for example semver type) then you should also defines the impact that this will have on the current specification (discovery, dependency matching etc...).

Additionally discovery can be based on anything other than the version label and/or additional labels (ex build etc...) can be used.

Regarding to "latest" behavior I opened various issues.

The main problem is on how to implement latest. I opened #575 trying to clarify an actual hidden behavior and proposed two PR to remove this and make a pure meta tag based "latest" pattern #580 #581.

Then @mpasternacki made a good proposal to decouple image labels (that are fixed) from image tags (that are dynamic). Based on it I opened #584 for RFC.