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

ci-operator: expose ephemeral cluster versions based on parents #1098

Conversation

stevekuznetsov
Copy link
Contributor

When we import a release from a stream that's configured to have a name
and be released in some way, we can piggy-back off of that name to
create a name for our release that clearly labels us as a derivative
while also uniquely identifying the test configuration that is running.
All of this is best-effort and will no-op if no release config is
present, allowing us to still mark the cluster version as one udner test
but not identifying the parent release.

Signed-off-by: Steve Kuznetsov skuznets@redhat.com

/assign @petr-muller @smarterclayton

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 11, 2020
When we import a release from a stream that's configured to have a name
and be released in some way, we can piggy-back off of that name to
create a name for our release that clearly labels us as a derivative
while also uniquely identifying the test configuration that is running.
All of this is best-effort and will no-op if no release config is
present, allowing us to still mark the cluster version as one udner test
but not identifying the parent release.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
@stevekuznetsov
Copy link
Contributor Author

/test e2e

@stevekuznetsov
Copy link
Contributor Author

Weird registry flake?

error: some steps failed:
  * could not run steps: step [release:custom] failed: release "release-images-custom" failed: the pod ci-op-lhj964qb/release-images-custom failed after 8s (failed containers: release): ContainerFailed one or more containers exited

Container release exited with code 1, reason Error
---
info: Using registry public hostname default-route-openshift-image-registry.apps.build01.ci.devcluster.openshift.com
Saved credentials for default-route-openshift-image-registry.apps.build01.ci.devcluster.openshift.com
error: unable to read image registry.svc.ci.openshift.org/ocp/release@sha256:48680a39e6cbd4f9532c773df2f7aaa565c8632ba26f1fcc9dd37d0dad161323: unauthorized: authentication required
---

@@ -175,6 +176,21 @@ func (s *assembleReleaseStep) run(ctx context.Context) error {
return results.ForReason("missing_release").WithError(err).Errorf("could not resolve imagestream %s: %v", streamName, err)
}

// we want to expose the release payload as a CI version that looks just like
// the release versions for nightlies and CI release candidates
prefix := "0.0.1-0"
Copy link

Choose a reason for hiding this comment

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

So, now the prefix would be 0.0.1-0 instead of 4. ?

Copy link
Member

Choose a reason for hiding this comment

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

Only for the cases where we cannot determine the version, it's a fallback.

Copy link

Choose a reason for hiding this comment

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

oh, somehow I missed that. Thanks!

Copy link
Member

@petr-muller petr-muller left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -175,6 +176,21 @@ func (s *assembleReleaseStep) run(ctx context.Context) error {
return results.ForReason("missing_release").WithError(err).Errorf("could not resolve imagestream %s: %v", streamName, err)
}

// we want to expose the release payload as a CI version that looks just like
// the release versions for nightlies and CI release candidates
prefix := "0.0.1-0"
Copy link
Member

Choose a reason for hiding this comment

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

Only for the cases where we cannot determine the version, it's a fallback.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller, stevekuznetsov

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:
  • OWNERS [petr-muller,stevekuznetsov]

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

@petr-muller
Copy link
Member

/hold

e2e are broken now, holding to prevent the bot to go crazy with retests

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 12, 2020
Copy link

@JAORMX JAORMX left a comment

Choose a reason for hiding this comment

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

the solution lgtm

@petr-muller
Copy link
Member

/test e2e
/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 12, 2020
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit 57a728d into openshift:master Aug 12, 2020
wking added a commit to wking/ci-tools that referenced this pull request Mar 30, 2023
…e annotation

bee450b (ci-operator: expose ephemeral cluster versions based on
parents, 2020-08-11, openshift#1098) taught assembleReleaseStep to consume the
release.openshift.io/config annotation on an ImageStream to find a
version prefix that actually reflects the 4.y release branch (instead
of using 0.0.1-0 as the prefix).  Those annotations are set on the
app.ci ImageStreams, for example:

  $ oc whoami -c
  default/api-ci-l2s4-p1-openshiftapps-com:6443/wking
  $ oc -n ocp get -o json imagestream 4.13 | jq -r '.metadata.annotations["release.openshift.io/config"] | fromjson | .name'
  4.13.0-0.ci

But they are not set in ImageStreams contained within release images:

  $ oc adm release info -o json registry.ci.openshift.org/ocp/release:4.13.0-0.ci-2023-03-29-224346 | jq '.references | {kind, metadata}'
  {
    "kind": "ImageStream",
    "metadata": {
      "name": "4.13.0-0.ci-2023-03-29-224346",
      "creationTimestamp": "2023-03-29T22:52:54Z",
      "annotations": {
        "release.openshift.io/from-image-stream": "ocp/4.13-2023-03-29-224346"
      }
    }
  }

With this commit, I'm taking the name out of the imported release
ImageStream and trying to parse it as a Semantic Version.  If it
parses, I'm constructing a release.openshift.io/config annotation to
set just the 'name' property to the MAJOR.MINOR.SPEC from that parsed
name.  This should allow cluster-bot runs like:

  launch 4.13.0-0.ci,openshift/cluster-version-operator#918,openshift/hypershift#2318 hypershift-hosted

to build releases named 4.13.0-0-... instead of their current
0.0.1-0-...:

  $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880/artifacts/release/artifacts/release-payload-latest/image-references | jq -r .metadata.name
  0.0.1-0.test-2023-03-30-043404-ci-ln-h9dwcbk-latest

which is failing to run with [1]:

  Release image is not valid: {
    "lastTransitionTime": "2023-03-30T04:36:29Z",
    "message": "releases before 4.8 are not supported",
    "observedGeneration": 3,
    "reason": "InvalidImage",
    "status": "False",
    "type": "ValidReleaseImage"
  }

[1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880#1:build-log.txt%3A203-210
wking added a commit to wking/ci-tools that referenced this pull request Mar 30, 2023
…e annotation

bee450b (ci-operator: expose ephemeral cluster versions based on
parents, 2020-08-11, openshift#1098) taught assembleReleaseStep to consume the
release.openshift.io/config annotation on an ImageStream to find a
version prefix that actually reflects the 4.y release branch (instead
of using 0.0.1-0 as the prefix).  Those annotations are set on the
app.ci ImageStreams, for example:

  $ oc whoami -c
  default/api-ci-l2s4-p1-openshiftapps-com:6443/wking
  $ oc -n ocp get -o json imagestream 4.13 | jq -r '.metadata.annotations["release.openshift.io/config"] | fromjson | .name'
  4.13.0-0.ci

But they are not set in ImageStreams contained within release images:

  $ oc adm release info -o json registry.ci.openshift.org/ocp/release:4.13.0-0.ci-2023-03-29-224346 | jq '.references | {kind, metadata}'
  {
    "kind": "ImageStream",
    "metadata": {
      "name": "4.13.0-0.ci-2023-03-29-224346",
      "creationTimestamp": "2023-03-29T22:52:54Z",
      "annotations": {
        "release.openshift.io/from-image-stream": "ocp/4.13-2023-03-29-224346"
      }
    }
  }

With this commit, I'm taking the name out of the imported release
ImageStream and trying to parse it as a Semantic Version.  If it
parses, I'm constructing a release.openshift.io/config annotation to
set just the 'name' property to the MAJOR.MINOR.PATCH from that parsed
name.  This should allow cluster-bot runs like:

  launch 4.13.0-0.ci,openshift/cluster-version-operator#918,openshift/hypershift#2318 hypershift-hosted

to build releases named 4.13.0-0-... instead of their current
0.0.1-0-...:

  $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880/artifacts/release/artifacts/release-payload-latest/image-references | jq -r .metadata.name
  0.0.1-0.test-2023-03-30-043404-ci-ln-h9dwcbk-latest

which is failing to run with [1]:

  Release image is not valid: {
    "lastTransitionTime": "2023-03-30T04:36:29Z",
    "message": "releases before 4.8 are not supported",
    "observedGeneration": 3,
    "reason": "InvalidImage",
    "status": "False",
    "type": "ValidReleaseImage"
  }

[1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880#1:build-log.txt%3A203-210
wking added a commit to wking/ci-tools that referenced this pull request Mar 30, 2023
…e annotation

bee450b (ci-operator: expose ephemeral cluster versions based on
parents, 2020-08-11, openshift#1098) taught assembleReleaseStep to consume the
release.openshift.io/config annotation on an ImageStream to find a
version prefix that actually reflects the 4.y release branch (instead
of using 0.0.1-0 as the prefix).  Those annotations are set on the
app.ci ImageStreams, for example:

  $ oc whoami -c
  default/api-ci-l2s4-p1-openshiftapps-com:6443/wking
  $ oc -n ocp get -o json imagestream 4.13 | jq -r '.metadata.annotations["release.openshift.io/config"] | fromjson | .name'
  4.13.0-0.ci

But they are not set in ImageStreams contained within release images:

  $ oc adm release info -o json registry.ci.openshift.org/ocp/release:4.13.0-0.ci-2023-03-29-224346 | jq '.references | {kind, metadata}'
  {
    "kind": "ImageStream",
    "metadata": {
      "name": "4.13.0-0.ci-2023-03-29-224346",
      "creationTimestamp": "2023-03-29T22:52:54Z",
      "annotations": {
        "release.openshift.io/from-image-stream": "ocp/4.13-2023-03-29-224346"
      }
    }
  }

With this commit, I'm taking the name out of the imported release
ImageStream and trying to parse it as a Semantic Version.  If it
parses, I'm constructing a release.openshift.io/config annotation to
set just the 'name' property to the MAJOR.MINOR.PATCH from that parsed
name.  This should allow cluster-bot runs like:

  launch 4.13.0-0.ci,openshift/cluster-version-operator#918,openshift/hypershift#2318 hypershift-hosted

to build releases named 4.13.0-0-... instead of their current
0.0.1-0-...:

  $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880/artifacts/release/artifacts/release-payload-latest/image-references | jq -r .metadata.name
  0.0.1-0.test-2023-03-30-043404-ci-ln-h9dwcbk-latest

which is failing to run with [1]:

  Release image is not valid: {
    "lastTransitionTime": "2023-03-30T04:36:29Z",
    "message": "releases before 4.8 are not supported",
    "observedGeneration": 3,
    "reason": "InvalidImage",
    "status": "False",
    "type": "ValidReleaseImage"
  }

[1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/release-openshift-origin-installer-launch-hypershift-hosted/1641294936391290880#1:build-log.txt%3A203-210
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.

None yet

7 participants