-
Notifications
You must be signed in to change notification settings - Fork 178
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
Config map nim model name fetch #3276
Config map nim model name fetch #3276
Conversation
Signed-off-by: Olga Lavtar <olavtar@redhat.com>
… name to avoid waiting for resource termination after deletion Signed-off-by: Olga Lavtar <olavtar@redhat.com>
Hi @olavtar. Thanks for your PR. I'm waiting for a opendatahub-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3276 +/- ##
==========================================
- Coverage 84.87% 84.81% -0.06%
==========================================
Files 1306 1306
Lines 29196 29207 +11
Branches 7885 7890 +5
==========================================
- Hits 24780 24773 -7
- Misses 4416 4434 +18
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
/ok-to-test |
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.
None of these are critical blockers. Your dodge a typescript issue because Secrets & Configmaps are very close in structure.
I'm going to approve this to start updating downstream. Please fire up another PR and fix this in main asap.
@@ -32,7 +32,7 @@ const NIMModelListSection: React.FC<NIMModelListSectionProps> = ({ | |||
useEffect(() => { | |||
const getModelNames = async () => { | |||
try { | |||
const modelInfos = await fetchNIMModelNames(dashboardNamespace); | |||
const modelInfos = await fetchNIMModelNames(); |
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.
Your hook still has dashboardNamespace
as a dependency... I think you're no longer using it in the hook... so please remove it.
@@ -9,9 +9,9 @@ const NIM_NGC_SECRET_NAME = 'nvidia-nim-image-pull'; | |||
export const getNGCSecretType = (isNGC: boolean): string => | |||
isNGC ? 'kubernetes.io/dockerconfigjson' : 'Opaque'; | |||
|
|||
const getNIMSecretData = async (secretName: string): Promise<SecretKind> => { | |||
export const getNIMResource = async (resourceName: string): Promise<SecretKind> => { |
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.
Not just a SecretKind
anymore
export const getNIMResource = async (resourceName: string): Promise<SecretKind> => { | |
export const getNIMResource = async <T extends K8sResourceCommon = SecretKind>(resourceName: string): Promise<T> => { |
In your one location you call this, you'll want to call it like:
const configMap = await getNIMResource<ConfigMapKind>(NIM_CONFIGMAP_NAME);
See my next comment.
): Promise<ModelInfo[] | undefined> => { | ||
const configMap = await getConfigMap(dashboardNamespace, NIM_CONFIGMAP_NAME); | ||
export const fetchNIMModelNames = async (): Promise<ModelInfo[] | undefined> => { | ||
const configMap = await getNIMResource(NIM_CONFIGMAP_NAME); |
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.
const configMap = await getNIMResource(NIM_CONFIGMAP_NAME); | |
const configMap = await getNIMResource<ConfigMapKind>(NIM_CONFIGMAP_NAME); |
@@ -171,8 +181,33 @@ export const assembleServingRuntime = ( | |||
volumes.push(getshmVolume('2Gi')); | |||
} | |||
|
|||
updatedServingRuntime.spec.volumes = volumes; | |||
if (nimPVCName) { |
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.
This code should never have been here -- you folks need to work on lowering your points of contact when fixing a blocker fix. You snuck this PVC thing into a high trafficked area for 2 other flows you're not touching instead of just adding this to your serving runtime template before ever calling this flow.
This change has already been tested and I'm going to let it in. But please do not sneak more "nice to have" code in when you need to fix critical blocking issues.
@@ -242,6 +277,7 @@ export const updateServingRuntime = (options: { | |||
initialAcceleratorProfile?: AcceleratorProfileState; | |||
selectedAcceleratorProfile?: AcceleratorProfileSelectFieldState; | |||
isModelMesh?: boolean; | |||
nimPVCName?: string; |
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.
This was unnecessary -- you don't support edit, updating the serving runtime is not done currently.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne 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 |
* fix: retrieve ConfigMap using service account Signed-off-by: Olga Lavtar <olavtar@redhat.com> * fix: retrieve ConfigMap using service account and added ${uid} to PVC name to avoid waiting for resource termination after deletion Signed-off-by: Olga Lavtar <olavtar@redhat.com> --------- Signed-off-by: Olga Lavtar <olavtar@redhat.com>
* fix: retrieve ConfigMap using service account * fix: retrieve ConfigMap using service account and added ${uid} to PVC name to avoid waiting for resource termination after deletion --------- Signed-off-by: Olga Lavtar <olavtar@redhat.com> Co-authored-by: olavtar <94576904+olavtar@users.noreply.github.com>
Config map nim model name fetch (opendatahub-io#3276) (opendatahub-io#3290)
Description
Retrieving ConfigMap using service account and added ${uid} to PVC name to avoid waiting for resource termination after deletion
How Has This Been Tested?
Tested locally.
Test Impact
Deployed a NIM model, deleted it, and deployed another model while the PVC was still in the 'Terminating' state.
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main