Skip to content
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

UPSTREAM: <carry>: openshift-hack/images/os/Dockerfile: Add io.openshift.build.versions, etc. #963

Merged

Conversation

wking
Copy link
Member

@wking wking commented Sep 16, 2021

For example, consider the current 4.10 RHCOS:

$ oc image info -o json registry.ci.openshift.org/ocp/4.10:machine-os-content | jq -r '.config.config.Labels | to_entries[] | .key + ": " + .value' | grep '^io\.k8s\|^io\.openshift'
io.k8s.description: The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.
io.k8s.display-name: Red Hat Universal Base Image 8
io.openshift.build.version-display-names: machine-os=Red Hat Enterprise Linux CoreOS
io.openshift.build.versions: machine-os=49.84.202109102026-0
io.openshift.expose-services:
io.openshift.tags: base rhel8

A bunch of those seem to be inherited from the UBI base image, so we can leave them alone. But the io.openshift.build.* entries are RHCOS-specific, and are consumed by oc adm release new ... and
friends to answer questions like "which RHCOS is in this release?":

$ oc adm release info -o json quay.io/openshift-release-dev/ocp-release:4.8.12-x86_64 | jq .displayVersions
{
  "kubernetes": {
    "Version": "1.21.1",
    "DisplayName": ""
  },
  "machine-os": {
    "Version": "48.84.202109100857-0",
    "DisplayName": "Red Hat Enterprise Linux CoreOS"
  }
}

Setting this label will avoid failures when consumers like driver-toolkit's version consumer:

name: 0.0.1-snapshot-machine-os

bump into ci-tools-built machine-os-content images that lack the io.openshift.build.versions declaration of machine-os version:

error: unable to create a release: unknown version reference "machine-os"

I've gone with generic testing values, so hopefully this is not something that local maintainers need to remember to bump for each OpenShift z stream.

@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Sep 16, 2021
@openshift-ci-robot
Copy link

@wking: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

@openshift-ci openshift-ci bot requested review from deads2k and sttts September 16, 2021 18:20
@wking wking force-pushed the declare-machine-os-version branch from 52a62a0 to df59e4c Compare September 16, 2021 18:25
@openshift-ci-robot
Copy link

@wking: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

@wking wking changed the title openshift-hack/images/os/Dockerfile: Add io.openshift.build.versions, etc. UPSTREAM: <carry>: openshift-hack/images/os/Dockerfile: Add io.openshift.build.versions, etc. Sep 16, 2021
@wking
Copy link
Member Author

wking commented Sep 16, 2021

I've added UPSTREAM: <carry>, but let me know if there's something better to get this into the next rebase's analog of 3667714.

@cgwalters
Copy link
Member

linking openshift/os#498 here as it would avoid this issue

@@ -21,3 +21,5 @@ RUN set -x && yum install -y ostree rpm-ostree yum-utils selinux-policy-targeted

FROM scratch
COPY --from=build /srv/ /srv/
LABEL io.openshift.build.version-display-names="machine-os=Red Hat Enterprise Linux CoreOS (testing)" \
io.openshift.build.versions="machine-os=1.2.3-testing-machine-os"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support for SemVer values here, so my string being SemVer means shouldn't break any in-cluster assumptions.
And the fact that it's clearly a dummy/test value will hopefully keep human readers from assuming that the resulting build-for-CI images are official RHCOS releases.

@wking
Copy link
Member Author

wking commented Sep 16, 2021

images looks promising:

$ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_kubernetes/963/pull-ci-openshift-kubernetes-master-images/1438569890804928512/artifacts/build-logs/machine-os-content.log | grep machine-os=
2021-09-16T18:56:56.520435642Z STEP 8: LABEL io.openshift.build.version-display-names="machine-os=Red Hat Enterprise Linux CoreOS (testing)"       io.openshift.build.versions="machine-os=1.2.3-testing-machine-os"

@wking
Copy link
Member Author

wking commented Sep 16, 2021

e2e-gcp failed on quota, but the release ImageStream looks good:

$ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_kubernetes/963/pull-ci-openshift-kubernetes-master-e2e-gcp/1438569886631596032/artifacts/release/artifacts/release-payload-latest/image-references | jq '.spec.tags[] | select(.name == "machine-os-content").annotations'
{
  "io.openshift.build.commit.id": "",
  "io.openshift.build.commit.ref": "",
  "io.openshift.build.source-location": "",
  "io.openshift.build.version-display-names": "machine-os=Red Hat Enterprise Linux CoreOS (testing)",
  "io.openshift.build.versions": "machine-os=1.2.3-testing-machine-os"
}

@wking wking force-pushed the declare-machine-os-version branch from df59e4c to 7d4d193 Compare September 16, 2021 20:25
@openshift-ci-robot
Copy link

@wking: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

@wking wking force-pushed the declare-machine-os-version branch from 7d4d193 to 8814255 Compare September 16, 2021 20:26
@openshift-ci-robot
Copy link

@wking: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

@deads2k
Copy link

deads2k commented Sep 16, 2021

/lgtm

@deads2k deads2k removed the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Sep 16, 2021
@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 16, 2021
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

7 similar comments
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@wking wking force-pushed the declare-machine-os-version branch from 8814255 to d5e636d Compare September 17, 2021 14:46
@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Sep 17, 2021
@openshift-ci-robot
Copy link

@wking: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 17, 2021
@@ -21,3 +21,6 @@ RUN set -x && yum install -y ostree rpm-ostree yum-utils selinux-policy-targeted

FROM scratch
COPY --from=build /srv/ /srv/

LABEL io.openshift.build.version-display-names="machine-os=rhcos image for testing openshift kubernetes kubelet only. If you see this outside of PR runs for openshift kubernetes- you found an urgent blocker bug" \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using a - instead of a , to avoid:

...must only be alphanumerics, spaces, and symbols in [():-]

@p0lyn0mial
Copy link

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 17, 2021
@soltysh soltysh removed the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Sep 17, 2021
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

…ift.build.versions, etc.

For example, consider the current 4.10 RHCOS:

  $ oc image info -o json registry.ci.openshift.org/ocp/4.10:machine-os-content | jq -r '.config.config.Labels | to_entries[] | .key + ": " + .value' | grep '^io\.k8s\|^io\.openshift'
  io.k8s.description: The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.
  io.k8s.display-name: Red Hat Universal Base Image 8
  io.openshift.build.version-display-names: machine-os=Red Hat Enterprise Linux CoreOS
  io.openshift.build.versions: machine-os=49.84.202109102026-0
  io.openshift.expose-services:
  io.openshift.tags: base rhel8

A bunch of those seem to be inherited from the UBI base image, so we
can leave them alone.  But the io.openshift.build.* entries are
RHCOS-specific, and are consumed by 'oc adm release new ...' [1,2] and
friends to answer questions like "which RHCOS is in this release?":

  $ oc adm release info -o json quay.io/openshift-release-dev/ocp-release:4.8.12-x86_64 | jq .displayVersions
  {
    "kubernetes": {
      "Version": "1.21.1",
      "DisplayName": ""
    },
    "machine-os": {
      "Version": "48.84.202109100857-0",
      "DisplayName": "Red Hat Enterprise Linux CoreOS"
    }
  }

Setting this label will avoid failures when consumers like
driver-toolkit's version consumer [3]:

  name: 0.0.1-snapshot-machine-os

bump into ci-tools-built machine-os-content images that lack the
io.openshift.build.versions declaration of machine-os version [4]:

  error: unable to create a release: unknown version reference "machine-os"

I've gone with generic testing values, so hopefully this is not
something that local maintainers need to remember to bump for each
OpenShift z stream.

[1]: https://github.com/openshift/oc/blob/f94afb52dc8a3185b3b9eacaf92ec34d80f8708d/pkg/cli/admin/release/image_mapper.go#L328-L334
[2]: https://github.com/openshift/oc/blob/f94afb52dc8a3185b3b9eacaf92ec34d80f8708d/pkg/cli/admin/release/annotations.go#L19-L28
[3]: openshift/driver-toolkit@464acca#diff-4caed9b2b966a8fa7a016ae28976634a2d3d1b635c4e820d5c038b2305d6af53R18
[4]: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_kubernetes/959/pull-ci-openshift-kubernetes-master-images/1438398678602616832#1:build-log.txt%3A97
@wking wking force-pushed the declare-machine-os-version branch from d5e636d to 2b79d49 Compare September 17, 2021 15:53
@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Sep 17, 2021
@openshift-ci-robot
Copy link

@wking: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 17, 2021
@wking
Copy link
Member Author

wking commented Sep 17, 2021

/retest

Copy link

@soltysh soltysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@soltysh
Copy link

soltysh commented Sep 20, 2021

/retest

@soltysh soltysh removed the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Sep 20, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2021
@openshift-ci
Copy link

openshift-ci bot commented Sep 20, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, deads2k, p0lyn0mial, soltysh, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit d2641dd into openshift:master Sep 20, 2021
@wking wking deleted the declare-machine-os-version branch September 20, 2021 15:08
@dagrayvid
Copy link

/cherry-pick release-4.9

@openshift-cherrypick-robot

@dagrayvid: new pull request created: #983

In response to this:

/cherry-pick release-4.9

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants