-
Notifications
You must be signed in to change notification settings - Fork 151
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
Show KServe defaultDeploymentMode in DSC status #1465
Merged
openshift-merge-bot
merged 1 commit into
opendatahub-io:main
from
grdryn:RHOAIENG-16240_status
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package kserve | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
) | ||
|
||
// ConfigMap Keys. | ||
const ( | ||
DeployConfigName = "deploy" | ||
IngressConfigKeyName = "ingress" | ||
) | ||
|
||
type DeployConfig struct { | ||
DefaultDeploymentMode string `json:"defaultDeploymentMode,omitempty"` | ||
} | ||
|
||
func getDeployConfig(cm *corev1.ConfigMap) (*DeployConfig, error) { | ||
deployConfig := DeployConfig{} | ||
if err := json.Unmarshal([]byte(cm.Data[DeployConfigName]), &deployConfig); err != nil { | ||
return nil, fmt.Errorf("error retrieving value for key '%s' from ConfigMap %s. %w", DeployConfigName, cm.Name, err) | ||
} | ||
return &deployConfig, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can the update function be done in UpdateDSCStatus() https://github.com/opendatahub-io/opendatahub-operator/blob/b0a5efa5db3c0d9379720fdfc52f14580f91003c/controllers/components/kserve/kserve.go#L87C31-L87C49 or have to create a new setStatusFields() ?
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.
Hmm, I'm not sure 🤔 it looks like that will get called only during the reconciliation in the DSC controller, right? I think we should also have this set in the Kserve CR status for consistency, and to do that I think it needs to be updated here. WDYT?
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.
hmmmmmm, why we do not add the "set status" in customizeKserveConfigMap() directly?
e.g after
inferenceServiceConfigMap.Data[DeployConfigName] = string(deployDataBytes)
then we can have a default value "Serverless" for defaultDeploymentMode , only
if deployData.DefaultDeploymentMode != string(defaultmode) {
it sets a different value.--
tbh, i am not fond of setting component's status in DSC.
if possible, it should only be in the kserve CR 's .status. or we are duplicating all things in both places.
e.g modelreg namespace is only in the DSC .spec and ModelReg CR .spec , but not DSC .status.
it would be good for dashboard to check component CR to get each's .status.
but this is out of the scope for this PR, if the requirment is to get it done in DSC .status.
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.
The main reason that I chose to keep this separate, and after the deploy action, is that we want to read the ConfigMap from the cluster rather than relying on it from the resources list, because the user may decide to manage it themselves, and change the value from what the operator would have set it to (the value that would be in the resources list). Doing it after the deploy action should mean that the ConfigMap at least always exists on the cluster at this point. If there wasn't that edge case of unmanaged configmap, then it would make sense to do it in customizeKserveConfigMap().
Yeah maybe, I'm not sure what's best there. 🤔 @lburgazzoli do you have any thoughts on this?
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.
let me get back from PTO :)
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.
@lburgazzoli ah apologies 🙈 in any case I think this is not a blocking conversation 🙂
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.
don't worry 😉