fix: Add securityContext to RHOAI runtimes for volume mount permissio…#24
fix: Add securityContext to RHOAI runtimes for volume mount permissio…#24abhijeet-dhumal wants to merge 1 commit intoopendatahub-io:mainfrom
Conversation
…ns compatibility Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| spec: | ||
| template: | ||
| spec: | ||
| securityContext: |
There was a problem hiding this comment.
We should try to avoid changing the security context.
My understanding is that it can be avoided by mounting an empty / tmp dir as workspace or changing the workspace directory
11:48
My understanding is that it can be avoided by mounting an empty / tmp dir as workspace or changing the workspace directory
There was a problem hiding this comment.
Ah I see, so user should always opt for the directories like a /tmp dir always writable by any user ?
There was a problem hiding this comment.
Please correct me here but, the purpose of podTemplateOverrides with volume mounts was to allow users to mount PVCs at any configurable path they choose (like /workspace, /data, /models, etc.)
But without securityContext specified, User will always get permission denied error because:
- when user mount a PVC at an arbitrary path, container will run as a user 1001 (or whatever the image defaults to)
- PVC is usually owned by root (UID 0) or some other UID
…ns compatibility
What this PR does / why we need it:
Set runAsUser=1000 and fsGroup=1000 in torch runtime manifests to fix volume mount permission errors when mounting volumes via podTemplateOverrides.
Related issues tracked upstream : kubeflow/issues/2992
Training Example : https://github.com/abhijeet-dhumal/sdk/blob/add-progression-example/examples/transformers-text-classification.ipynb
Checklist: