-
Notifications
You must be signed in to change notification settings - Fork 154
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
feat: reworks Feature to be generic data container #1052
feat: reworks Feature to be generic data container #1052
Conversation
Important Deliberately put |
d5f0313
to
d51444a
Compare
a148731
to
6d1ead1
Compare
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.
thanks for this @bartoszmajsak .
6d1ead1
to
1cb8332
Compare
7c5219d
to
5a0c315
Compare
5a0c315
to
573f99e
Compare
I think it's been incubating for long enough, removing |
50d83fc
to
58fc075
Compare
8d2da19
to
0265341
Compare
/retest |
Feature Struct Improvements - Eliminates the `.Spec` field, eliminating a single point of coupling with various domain structs used across the project. - Introduces a generic map to store keys relevant to a given feature, which are utilized in templates and other functions. Feature Builder Changes - Renamed few functions to better reflect their intent - entry builder function `feature.CreateFeature` becomes `feature.Define` - Load() becomes Create() - `.WithData` builder function serves as an entry point to define the contents of a given feature. This chain method allows adding key-values to the feature's context. These values are later used in templates and can also be accessed in pre/post conditions and for programmatic resource creation. Additional Changes - Simplifies and decouples the use of `FeatureHandler`. It is no longer necessary to patss it to the Feature builder to group features together. - Introduces a new `FeatureRegistry` interface, allowing convenient addition of feature sets to the handler via the `FeatureProvider` function. - Introduces a convention for defining `FeatureData` for specific parts of the platform (e.g., Serverless or Service Mesh setup). This approach enhances readability and promotes the reuse of commonly used data entries. - Adds a `README.md` file providing a high-level overview of the `Feature DSL`.
0265341
to
e45dbea
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AjayJagan, israel-hdez, zdtsw 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 |
973ff74
into
opendatahub-io:incubation
With the opendatahub-io#1052 refactoring, the order of features added to the Registry was accidentally changed. It results in failing of metrics collection feature which expects SMCP to be created first, but the creation runs afterwards. The setup is eventually consistent, as the reconcile will retry, so this not a bug per se, but results in unnecassary errors. This fix ensures features are ordered as before and levarages `.EnabledWhen` instead of wrapping features in `if`s.
With the #1052 refactoring, the order of features added to the Registry was accidentally changed. It results in failing of metrics collection feature which expects SMCP to be created first, but the creation runs afterwards. The setup is eventually consistent, as the reconcile will retry, so this not a bug per se, but results in unnecassary errors. This fix ensures features are ordered as before and levarages `.EnabledWhen` instead of wrapping features in `if`s.
If the authorization provider namespace is not specified in the DSCI the default is constructed to be `application-namespace-auth-provider`, e.g. `opendatahub-auth-provider`. With the opendatahub-io#1052 refactoring, the regression has been introduced where the value is directly read from the spec instead of being dynamically constructed based on the rule described above. This is manifested with the following error, as the feature mistakenly waits for pods across all namespaces (because of list option for namespace being `corev1.NamespaceAll == ""`). This obviously rarely is true, especially for large clusters. ```json Failed applying [enable-proxy-injection-in-authorino-deployment]: 1 error occurred: * client rate limiter Wait returned an error: context deadline exceeded ``` leading to failure of reconciling this feature. The fix is to read the namespace from `FeatureData` instead, where the defaulting logic is defined.
If the authorization provider namespace is not specified in the DSCI the default is constructed to be `application-namespace-auth-provider`, e.g. `opendatahub-auth-provider`. With the opendatahub-io#1052 refactoring, the regression has been introduced where the value is directly read from the spec instead of being dynamically constructed based on the rule described above. This is manifested with the following error, as the feature mistakenly waits for pods across all namespaces (because of list option for namespace being `corev1.NamespaceAll == ""`). This obviously rarely is true, especially for large clusters. ```json Failed applying [enable-proxy-injection-in-authorino-deployment]: 1 error occurred: * client rate limiter Wait returned an error: context deadline exceeded ``` leading to failure of reconciling this feature. The fix is to read the namespace from `FeatureData` instead, where the defaulting logic is defined. Fixes https://issues.redhat.com/browse/RHOAIENG-10268
…e value (#1135) * fix: fixes authz patch injection feature precondition If the authorization provider namespace is not specified in the DSCI the default is constructed to be `application-namespace-auth-provider`, e.g. `opendatahub-auth-provider`. With the #1052 refactoring, the regression has been introduced where the value is directly read from the spec instead of being dynamically constructed based on the rule described above. This is manifested with the following error, as the feature mistakenly waits for pods across all namespaces (because of list option for namespace being `corev1.NamespaceAll == ""`). This obviously rarely is true, especially for large clusters. ```json Failed applying [enable-proxy-injection-in-authorino-deployment]: 1 error occurred: * client rate limiter Wait returned an error: context deadline exceeded ``` leading to failure of reconciling this feature. The fix is to read the namespace from `FeatureData` instead, where the defaulting logic is defined. Fixes https://issues.redhat.com/browse/RHOAIENG-10268 * Update controllers/dscinitialization/servicemesh_setup.go Co-authored-by: Wen Zhou <[email protected]> --------- Co-authored-by: Wen Zhou <[email protected]>
Feature Struct Improvements - Eliminates the `.Spec` field, eliminating a single point of coupling with various domain structs used across the project. - Introduces a generic map to store keys relevant to a given feature, which are utilized in templates and other functions. Feature Builder Changes - Renamed few functions to better reflect their intent - entry builder function `feature.CreateFeature` becomes `feature.Define` - Load() becomes Create() - `.WithData` builder function serves as an entry point to define the contents of a given feature. This chain method allows adding key-values to the feature's context. These values are later used in templates and can also be accessed in pre/post conditions and for programmatic resource creation. Additional Changes - Simplifies and decouples the use of `FeatureHandler`. It is no longer necessary to patss it to the Feature builder to group features together. - Introduces a new `FeatureRegistry` interface, allowing convenient addition of feature sets to the handler via the `FeatureProvider` function. - Introduces a convention for defining `FeatureData` for specific parts of the platform (e.g., Serverless or Service Mesh setup). This approach enhances readability and promotes the reuse of commonly used data entries. - Adds a `README.md` file providing a high-level overview of the `Feature DSL`. (cherry picked from commit 973ff74)
…o#1118) With the opendatahub-io#1052 refactoring, the order of features added to the Registry was accidentally changed. It results in failing of metrics collection feature which expects SMCP to be created first, but the creation runs afterwards. The setup is eventually consistent, as the reconcile will retry, so this not a bug per se, but results in unnecassary errors. This fix ensures features are ordered as before and levarages `.EnabledWhen` instead of wrapping features in `if`s. (cherry picked from commit d6f25c7)
…e value (opendatahub-io#1135) * fix: fixes authz patch injection feature precondition If the authorization provider namespace is not specified in the DSCI the default is constructed to be `application-namespace-auth-provider`, e.g. `opendatahub-auth-provider`. With the opendatahub-io#1052 refactoring, the regression has been introduced where the value is directly read from the spec instead of being dynamically constructed based on the rule described above. This is manifested with the following error, as the feature mistakenly waits for pods across all namespaces (because of list option for namespace being `corev1.NamespaceAll == ""`). This obviously rarely is true, especially for large clusters. ```json Failed applying [enable-proxy-injection-in-authorino-deployment]: 1 error occurred: * client rate limiter Wait returned an error: context deadline exceeded ``` leading to failure of reconciling this feature. The fix is to read the namespace from `FeatureData` instead, where the defaulting logic is defined. Fixes https://issues.redhat.com/browse/RHOAIENG-10268 * Update controllers/dscinitialization/servicemesh_setup.go Co-authored-by: Wen Zhou <[email protected]> --------- Co-authored-by: Wen Zhou <[email protected]> (cherry picked from commit 7034768)
Feature Struct Improvements - Eliminates the `.Spec` field, eliminating a single point of coupling with various domain structs used across the project. - Introduces a generic map to store keys relevant to a given feature, which are utilized in templates and other functions. Feature Builder Changes - Renamed few functions to better reflect their intent - entry builder function `feature.CreateFeature` becomes `feature.Define` - Load() becomes Create() - `.WithData` builder function serves as an entry point to define the contents of a given feature. This chain method allows adding key-values to the feature's context. These values are later used in templates and can also be accessed in pre/post conditions and for programmatic resource creation. Additional Changes - Simplifies and decouples the use of `FeatureHandler`. It is no longer necessary to patss it to the Feature builder to group features together. - Introduces a new `FeatureRegistry` interface, allowing convenient addition of feature sets to the handler via the `FeatureProvider` function. - Introduces a convention for defining `FeatureData` for specific parts of the platform (e.g., Serverless or Service Mesh setup). This approach enhances readability and promotes the reuse of commonly used data entries. - Adds a `README.md` file providing a high-level overview of the `Feature DSL`. (cherry picked from commit 973ff74)
…o#1118) With the opendatahub-io#1052 refactoring, the order of features added to the Registry was accidentally changed. It results in failing of metrics collection feature which expects SMCP to be created first, but the creation runs afterwards. The setup is eventually consistent, as the reconcile will retry, so this not a bug per se, but results in unnecassary errors. This fix ensures features are ordered as before and levarages `.EnabledWhen` instead of wrapping features in `if`s. (cherry picked from commit d6f25c7)
…e value (opendatahub-io#1135) * fix: fixes authz patch injection feature precondition If the authorization provider namespace is not specified in the DSCI the default is constructed to be `application-namespace-auth-provider`, e.g. `opendatahub-auth-provider`. With the opendatahub-io#1052 refactoring, the regression has been introduced where the value is directly read from the spec instead of being dynamically constructed based on the rule described above. This is manifested with the following error, as the feature mistakenly waits for pods across all namespaces (because of list option for namespace being `corev1.NamespaceAll == ""`). This obviously rarely is true, especially for large clusters. ```json Failed applying [enable-proxy-injection-in-authorino-deployment]: 1 error occurred: * client rate limiter Wait returned an error: context deadline exceeded ``` leading to failure of reconciling this feature. The fix is to read the namespace from `FeatureData` instead, where the defaulting logic is defined. Fixes https://issues.redhat.com/browse/RHOAIENG-10268 * Update controllers/dscinitialization/servicemesh_setup.go Co-authored-by: Wen Zhou <[email protected]> --------- Co-authored-by: Wen Zhou <[email protected]> (cherry picked from commit 7034768)
Description
Important
For the high-level overview please have a look at
README.md
which is part of this PR. It's a good starting point :)Feature Struct Improvements
.Spec
field which was a single point of coupling with various domain structs used across the project.Feature Builder Changes
Feature Builder Changes
feature.CreateFeature
becomesfeature.Define
Load()
becomesCreate()
.WithData
builder function serves as an entry point to define the contents of a given feature. This chain method allows adding key-values to the feature's context. These values are later used in templates and can also be accessed in pre/post conditions and for programmatic resource creation.Additional Changes
FeatureHandler
. It is no longer necessary to pass it to the Feature builder to group features together.FeatureRegistry
interface, allowing convenient addition of feature sets to the handler via theFeatureProvider
function.FeatureData
for specific parts of the platform (e.g., Serverless or Service Mesh setup). This approach enhances readability and promotes the reuse of commonly used data entries.README.md
file providing a high-level overview of theFeature DSL
.JIRA issue:
https://issues.redhat.com/browse/RHOAIENG-4579
How Has This Been Tested?
Besides automated tests, I enabled KServe component and tested sample ISVC using this script
Warning
There seems to be regression in KServe/ODH Model Controller deployment as described in opendatahub-io/odh-model-controller#233 opendatahub-io/odh-model-controller#234. Follow workarounds to see that it all works as intended.
Merge criteria: