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

Bug 1796078: Filter OLM operators by architecture #3887

Conversation

benjaminapetersen
Copy link
Contributor

@benjaminapetersen benjaminapetersen commented Jan 8, 2020

4.4 bug https://bugzilla.redhat.com/show_bug.cgi?id=1796078
4.3 clone https://bugzilla.redhat.com/show_bug.cgi?id=1796079
4.2 clone https://bugzilla.redhat.com/show_bug.cgi?id=1796080

https://issues.redhat.com/browse/CONSOLE-2004

Based on the following proposal: operator-framework/olm-book#29
OLM implementation coming here: operator-framework/operator-lifecycle-manager#1220

  • Gets the architecture & passes it to the front end via window.SERVER_FLAGS.clusterArchitecture
  • TODO: filter operators on OLM installation page based on architecture + annotation

The filtering portion of this may come as a separate PR, depending on complexity. We will need 4.3 & (likely) 4.2 backports.

Labels will look like the following:

labels:
    operatorframework.io/arch.<GOARCH>: supported
    operatorframework.io/os.<GOOS>: supported

specifically:

labels:
    operatorframework.io/os.windows: supported
    operatorframework.io/os.linux: supported

Furthermore, rules are as follows:

labels:
    # if no OS label, then treat it as if the following:
    operatorframework.io/os.linux: supported
labels:
    # if no arch label, treat it as the following:
    operatorframework.io/arch.amd64: supported

Simple Empty State if there are no operators that pass the filter:
Screen Shot 2020-01-28 at 10 44 10 PM

/assign @spadgett @TheRealJon

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 8, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2020
@benjaminapetersen benjaminapetersen changed the title Filter OLM operators by architecture [WIP] Filter OLM operators by architecture Jan 8, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 8, 2020
@openshift-ci-robot openshift-ci-robot added component/backend Related to backend component/core Related to console core functionality labels Jan 8, 2020
@benjaminapetersen benjaminapetersen force-pushed the JIRA/console-2004/olm/filter-by-architecture branch from 6188e2c to bcc84f6 Compare January 21, 2020 03:03
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. component/olm Related to OLM needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 23, 2020
@benjaminapetersen benjaminapetersen force-pushed the JIRA/console-2004/olm/filter-by-architecture branch from 850ac94 to eff3eee Compare January 24, 2020 05:36
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 24, 2020
@benjaminapetersen benjaminapetersen changed the title [WIP] Filter OLM operators by architecture Filter OLM operators by architecture Jan 24, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 24, 2020
@benjaminapetersen benjaminapetersen force-pushed the JIRA/console-2004/olm/filter-by-architecture branch 3 times, most recently from 1caf3f3 to af9940e Compare January 29, 2020 04:45
@benjaminapetersen
Copy link
Contributor Author

@spadgett @TheRealJon updated per feedback.

@benjaminapetersen
Copy link
Contributor Author

/cherry-pick release-4.3
/cherry-pick release-4.2

@openshift-cherrypick-robot

@benjaminapetersen: once the present PR merges, I will cherry-pick it on top of release-4.3 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.3
/cherry-pick release-4.2

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.

@benjaminapetersen benjaminapetersen changed the title Filter OLM operators by architecture Bug 1796078: Filter OLM operators by architecture Jan 29, 2020
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2020
@spadgett
Copy link
Member

@benjaminapetersen ping, do you mind rebasing?

@spadgett spadgett modified the milestones: v4.4, v4.5 Feb 19, 2020
@spadgett
Copy link
Member

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@spadgett: This pull request references Bugzilla bug 1796078, which is valid.

In response to this:

/bugzilla refresh

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.

@spadgett
Copy link
Member

/cherry-pick release-4.4

@openshift-cherrypick-robot

@spadgett: once the present PR merges, I will cherry-pick it on top of release-4.4 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.4

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.

- Server side passing of GOOS and GOARCH via SERVER_FLAGS
- Defaulting of Operators to:
  - operatorframework.io/arch.amd64
  - operatorframework.io/os.linux
- No filtering for off-cluster/dev mode
@benjaminapetersen benjaminapetersen force-pushed the JIRA/console-2004/olm/filter-by-architecture branch from 6bb1a88 to e9adf08 Compare March 3, 2020 02:52
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 3, 2020
@benjaminapetersen
Copy link
Contributor Author

/retest

FAILURE: Main vendor bundle is larger than the 2.5 MiB limit.
If you haven't added a new dependency, an import might have accidentally pulled an existing dependency into the main vendor bundle.
If adding a large dependency, consider lazy loading the component with AsyncComponent.

no change to vendor bundle.

@benjaminapetersen
Copy link
Contributor Author

/retest


2020/03/03 15:53:01 waiting for importing pipeline:root ...
2020/03/03 15:58:01 could not resolve tag root in imagestream pipeline: timed out waiting for the condition
2020/03/03 15:58:01 No custom metadata found and prow metadata already exists. Not updating the metadata.
2020/03/03 15:58:02 Ran for 5m1s
2020/03/03 15:58:03 Submitted failure event to sentry (id=a644f704644840599f3bbdf07e33a588)
error: could not run steps: step [input:root] failed: timed out waiting for the condition 

@benjaminapetersen
Copy link
Contributor Author

/retest

 error: failed to load configuration: Response from configresolver == 503 (Service Unavailable) 

@@ -332,10 +388,28 @@ export const OperatorHubTileView: React.FC<OperatorHubTileViewProps> = (props) =
detailsItem &&
`/k8s/ns/${detailsItem.subscription.metadata.namespace}/${SubscriptionModel.plural}/${detailsItem.subscription.metadata.name}?showDelete=true`;

if (_.isEmpty(filteredItems)) {
return (
<>
Copy link
Member

Choose a reason for hiding this comment

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

Don't need fragment here since you're returning a single top level component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also good, will make a note for a follow.

Copy link
Member

@jcaianirh jcaianirh left a comment

Choose a reason for hiding this comment

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

@benjaminapetersen small nit on EmptyState return. lgtm otherwise.

Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

/lgtm

Just one minor performance nit.

@@ -233,12 +287,14 @@ export const OperatorHubTileView: React.FC<OperatorHubTileViewProps> = (props) =
const [detailsItem, setDetailsItem] = React.useState(null);
const [showDetails, setShowDetails] = React.useState(false);

const filteredItems = filterByArchAndOS(props.items);
Copy link
Member

Choose a reason for hiding this comment

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

nit: this should probably be memoized so that it doesn't get recalculated on every render.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, that would be a good optimization. I'll make a note for a follow.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 4, 2020
@jcaianirh
Copy link
Member

/lgtm

@benjaminapetersen
Copy link
Contributor Author

+1 thx for the review! Would be good to get for 4.4.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benjaminapetersen, jcaianirh, TheRealJon

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 de3233c into openshift:master Mar 4, 2020
@openshift-ci-robot
Copy link
Contributor

@benjaminapetersen: All pull requests linked via external trackers have merged. Bugzilla bug 1796078 has been moved to the MODIFIED state.

In response to this:

Bug 1796078: Filter OLM operators by architecture

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-cherrypick-robot

@benjaminapetersen: #3887 failed to apply on top of branch "release-4.3":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	cmd/bridge/main.go
M	frontend/packages/operator-lifecycle-manager/src/components/operator-hub/operator-hub-items.tsx
M	frontend/public/declarations.d.ts
M	pkg/server/server.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/server/server.go
CONFLICT (content): Merge conflict in pkg/server/server.go
Auto-merging frontend/public/declarations.d.ts
Auto-merging frontend/packages/operator-lifecycle-manager/src/components/operator-hub/operator-hub-items.tsx
CONFLICT (content): Merge conflict in frontend/packages/operator-lifecycle-manager/src/components/operator-hub/operator-hub-items.tsx
Auto-merging cmd/bridge/main.go
Patch failed at 0001 Support OS and Arch filtering of Operators in OperatorHub

In response to this:

/cherry-pick release-4.3
/cherry-pick release-4.2

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-cherrypick-robot

@spadgett: new pull request created: #4630

In response to this:

/cherry-pick release-4.4

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.

@benjaminapetersen benjaminapetersen deleted the JIRA/console-2004/olm/filter-by-architecture branch March 19, 2020 03:00
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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/backend Related to backend component/core Related to console core functionality component/olm Related to OLM lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants