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

OCPBUGS-15941: ABI - Validate release image arch, add cpu_architectures to RELEASE_IMAGES #7349

Merged
merged 5 commits into from Mar 23, 2024

Conversation

jeffdyoung
Copy link
Contributor

@jeffdyoung jeffdyoung commented Jul 20, 2023

Adding additional validation to check that the release payload architecture matches the cluster's architecture.
Also fixes OCPBUGS-27787 - single arch ABI installs w/multi payload, adding cpu_architectures to RELEASE_IMAGES

RELEASE_IMAGES:
Single arch -

'[{"openshift_version":"4.15","cpu_architecture":"x86_64","cpu_architectures":["x86_64"],"url":"quay.io/openshift-release-dev/ocp-release:4.15.0-rc.4-x86_64","support_level":"beta","version":"4.15.0-rc.4"}]

Multi -

[{"openshift_version":"4.15-multi","cpu_architecture":"multi","cpu_architectures":["x86_64","arm64","ppc64le","s390x"],"url":"quay.io/openshift-release-dev/ocp-release:4.15.0-rc.4-multi","support_level":"beta","version":"4.15.0-rc.4-multi"}]'

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 20, 2023
@openshift-ci-robot
Copy link
Contributor

@jeffdyoung: This pull request references Jira Issue OCPBUGS-15941, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Adding additional validation to check that the release payload architecture matches the cluster's architecture. Will also throw an error if the 'multi' payload is detected.

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.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jul 20, 2023
@jeffdyoung
Copy link
Contributor Author

This will also undo the work done in #7276
because this test is creating an agent.aarch64.iso with the default x86 payload

@jeffdyoung
Copy link
Contributor Author

/retest

1 similar comment
@jeffdyoung
Copy link
Contributor Author

/retest

@jeffdyoung
Copy link
Contributor Author

/assign @zaneb

hack/go-lint.sh Outdated Show resolved Hide resolved
@jeffdyoung
Copy link
Contributor Author

/retest

3 similar comments
@jeffdyoung
Copy link
Contributor Author

/retest

@jeffdyoung
Copy link
Contributor Author

/retest

@jeffdyoung
Copy link
Contributor Author

/retest

Copy link
Contributor

@pawanpinjarkar pawanpinjarkar left a comment

Choose a reason for hiding this comment

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

PTAL

Copy link
Contributor

@pawanpinjarkar pawanpinjarkar left a comment

Choose a reason for hiding this comment

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

Minor changes

pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
@pawanpinjarkar
Copy link
Contributor

/retest-required

pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/oc.go Outdated Show resolved Hide resolved
@jeffdyoung jeffdyoung changed the title OCPBUGS-15941: Validate release image arch when creating agent.iso WIP OCPBUGS-15941: Validate release image arch when creating agent.iso Aug 17, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 17, 2023
@jeffdyoung jeffdyoung changed the title WIP OCPBUGS-15941: Validate release image arch when creating agent.iso [WIP] OCPBUGS-15941: Validate release image arch when creating agent.iso Aug 17, 2023
@@ -33,6 +33,7 @@ func releaseImageFromPullSpec(pullSpec, arch string) (releaseImage, error) {
return releaseImage{
ReleaseVersion: versionString,
Arch: arch,
Archs: archs,
Copy link
Contributor

Choose a reason for hiding this comment

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

@jeffdyoung this point it's not clear to me. What's the requirement to have separate fields Archs and Arch? Would make sense to have just one field Archs to cover all the cases?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's just because Archs was added later.
openshift/assisted-service#4248

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like we'll need both for now:

level=fatal msg="failed to create Versions handlers" func=main.main.func1 file="/src/cmd/main.go:237" error="Missing value in ReleaseImage for 'cpu_architecture' field"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@zaneb zaneb left a comment

Choose a reason for hiding this comment

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

This would be easier to review (and faster to re-review) if the logically separate changes were in separate commits. I can see at least these 5 logical changes:

  • Use more realistic pull secret in unit tests
  • Refactor execute() function to not do arg splitting
  • Move execute() function to a common location
  • Support multi-arch payload in releaseImage data
  • Validate release arch when possible

@@ -33,6 +33,7 @@ func releaseImageFromPullSpec(pullSpec, arch string) (releaseImage, error) {
return releaseImage{
ReleaseVersion: versionString,
Arch: arch,
Archs: archs,
Copy link
Member

Choose a reason for hiding this comment

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

I think it's just because Archs was added later.
openshift/assisted-service#4248

pkg/asset/agent/image/releaseextract.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/ignition.go Outdated Show resolved Hide resolved
pullSpec,
templateFilter,
}
releaseArch, err := ExecuteOC(pullSecret, getReleaseArch)
Copy link
Member

Choose a reason for hiding this comment

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

This is ok for this PR, but particularly with the heterogeneous cluster support coming in I'd like to see a follow-up switching to direct docker client calls as suggested in #7349 (comment).
I think validation of the release payload arch is going to be critical for heterogeneous clusters in particular.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zaneb I agree, that something* needs to be done to validate the release image(s) for all IPI/assisted/agent installs. Not sure how that suggestion will work with sparse manifest list? But yeah, want to figure this out for heterogeneous in future releases.

pkg/asset/agent/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/oc.go Outdated Show resolved Hide resolved
pkg/asset/agent/image/ignition.go Show resolved Hide resolved
Copy link
Member

@zaneb zaneb left a comment

Choose a reason for hiding this comment

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

/approve

pkg/asset/agent/oc.go Outdated Show resolved Hide resolved
Copy link
Contributor

openshift-ci bot commented Feb 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zaneb

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 29, 2024
@jeffdyoung
Copy link
Contributor Author

/retest

4 similar comments
@jeffdyoung
Copy link
Contributor Author

/retest

@jeffdyoung
Copy link
Contributor Author

/retest

@jeffdyoung
Copy link
Contributor Author

/retest

@jeffdyoung
Copy link
Contributor Author

/retest

@jeffdyoung
Copy link
Contributor Author

/retest

2 similar comments
@jeffdyoung
Copy link
Contributor Author

/retest

@jeffdyoung
Copy link
Contributor Author

/retest

@andfasano
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 14, 2024
Copy link
Contributor

openshift-ci bot commented Mar 14, 2024

@jeffdyoung: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-agent-sno-ipv6 e421b24 link false /test okd-scos-e2e-agent-sno-ipv6
ci/prow/okd-scos-e2e-agent-compact-ipv4 e421b24 link false /test okd-scos-e2e-agent-compact-ipv4
ci/prow/okd-e2e-aws-ovn-upgrade e421b24 link false /test okd-e2e-aws-ovn-upgrade
ci/prow/okd-scos-e2e-aws-ovn e421b24 link false /test okd-scos-e2e-aws-ovn
ci/prow/okd-e2e-aws-ovn e421b24 link false /test okd-e2e-aws-ovn
ci/prow/terraform-verify-vendor e421b24 link true /test terraform-verify-vendor
ci/prow/terraform-images e421b24 link true /test terraform-images
ci/prow/okd-e2e-agent-compact-ipv4 19f298a link false /test okd-e2e-agent-compact-ipv4

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 8710137 into openshift:master Mar 23, 2024
29 of 30 checks passed
@openshift-ci-robot
Copy link
Contributor

@jeffdyoung: Jira Issue OCPBUGS-15941: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-15941 has been moved to the MODIFIED state.

In response to this:

Adding additional validation to check that the release payload architecture matches the cluster's architecture.
Also fixes OCPBUGS-27787 - single arch ABI installs w/multi payload, adding cpu_architectures to RELEASE_IMAGES

RELEASE_IMAGES:
Single arch -

'[{"openshift_version":"4.15","cpu_architecture":"x86_64","cpu_architectures":["x86_64"],"url":"quay.io/openshift-release-dev/ocp-release:4.15.0-rc.4-x86_64","support_level":"beta","version":"4.15.0-rc.4"}]

Multi -

[{"openshift_version":"4.15-multi","cpu_architecture":"multi","cpu_architectures":["x86_64","arm64","ppc64le","s390x"],"url":"quay.io/openshift-release-dev/ocp-release:4.15.0-rc.4-multi","support_level":"beta","version":"4.15.0-rc.4-multi"}]'

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 openshift-eng/jira-lifecycle-plugin 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. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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

8 participants