-
Notifications
You must be signed in to change notification settings - Fork 24
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
rules: Drop architecture
and build-date
from required container labels
#100
Conversation
…abels (OCI/Docker) containers have a long history, and Red Hat was there in the early days, before things were standardized as OCI even - and especially before things like manifest lists and also the standard annotation keys: https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys There are two labels this policy requires that duplicate standard metadata. - `architecture`: This is already handled via manifest listing and is part of the config - `build-date`: There's a standard `Created` field As these are basically legacy from old Red Hat build systems we are just cargo culting forward for as far as I know no good reason, let's stop doing that.
I've said this elsewhere but IMO the OpenSUSE base image has a good set of labels, including only using the OCI standard ones, and a well-defined namespacing for their custom ones. The labels on many Red Hat containers today fall short of this:
|
+1 to moving towards the standard labels. I think dropping those two is probably ok. But we also want to make sure nothing else relies on these labels. Not sure what's the safest way to go about that. There's also I vaguely recall that the many |
|
I don't think we should drop those, but we should switch to requiring the OCI standard versions. |
IOW let's treat discussion of keys that are fully redundant and can just be deleted (the ones here) from ones that may need to change separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ralphbean, @arewm, @rhartman93 could you ptal?
I am generally in favor of moving towards accepted standards. I tried to take a look at our requirements in the past to reassess what we should require, but I think that the changes were too large to be easily prioritized: https://docs.google.com/document/d/1MB-b7ldO6J0de_3IajiseUA0aoLma4r9DJtkeogt-BQ/edit?tab=t.0 (internal document). In that, I proposed using |
I'll merge this on Monday if there are no objections (or sooner if I get additional approvals.) |
- name: architecture | ||
description: Architecture the software in the image should target. | ||
- name: build-date | ||
description: Date/Time image was built as RFC 3339 date-time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to remove build date?
It helps with idempotency in the release process.
removing architecture make a sense due to to multiarch (manifest v list)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to remove build date?
I wrote in the commit message - because it's redundant with existing standard metadata. The replacement for it is the created
field in https://github.com/opencontainers/image-spec/blob/main/config.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ skopeo inspect -n docker://registry.access.redhat.com/ubi9/ubi:latest
{
...
"Created": "2025-01-09T06:37:11.783912772Z",
"Labels": {
...
"build-date": "2025-01-09T06:27:16Z",
...
In ubi9 for example the values are off by about 10 seconds (edit: minutes wow...why?) just because they're generated at slightly different times. There's no value in the duplication.
(In fact, if one cares about reproducible builds these types of random timestamps are The Enemy and need to be carefully controlled and considered)
No objection to dropping this from the required list. Note, I do see some special occurrences of build-date in konflux-ci/build-definitions that we'll want to deal with too, although that doesn't block removing this as a requirement. There, the buildah task is setting the |
(OCI/Docker) containers have a long history, and Red Hat was there in the early days, before things were standardized as OCI even - and especially before things like manifest lists and also the standard annotation keys: https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
There are two labels this policy requires that duplicate standard metadata.
architecture
: This is already handled via manifest listing and is part of the configbuild-date
: There's a standardCreated
fieldAs these are basically legacy from old Red Hat build systems we are just cargo culting forward for as far as I know no good reason, let's stop doing that.
Signed-off-by: Colin Walters [email protected]