-
Notifications
You must be signed in to change notification settings - Fork 710
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
Fix read permission denied on train script when run as non-root #2373
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Pull Request Test Coverage Report for Build 12695578194Details
💛 - Coveralls |
printf "%s" \"$SCRIPT\" > \"$program_path\"/\"{func_file}\" | ||
{entrypoint} \"$program_path\"/\"{func_file}\"""" |
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.
If we create this file under HOME
directory, will it still fail for non-root containers ?
I intentionally write the script into the same file, so the file system between users' workspace and Kubernetes Pod is the same. Which means users can use standard Python imports while developing ML training code. Similar to how we showcase at KubeCon demo: https://youtu.be/Lgy4ir1AhYw?t=446
Related: #2347.
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.
With the stricter security policy, containers are run with random UID with no fixed HOME
directory.
I need to research a bit more what could be the other possible options and get back to you.
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.
I've given this another cycle and it doesn't seem possible to change the working directory permissions easily.
On the other hand, mounting an emptyDir
volume as the /workspace
directory in the training runtime works as expected with the stricter security policy.
My understanding is this approach aligns well with the initializer and worker pods coordinating via PVCs. The default emptyDir
fits with the initializers being currently run as init containers, but this can be adapted to mount a PVC when they'll run as separate Jobs.
Signed-off-by: Antonin Stefanutti <[email protected]>
What this PR does / why we need it:
This PR writes the train function script into a tmp directory so it can be read when TrainJob containers run as non-root.
Which issue(s) this PR fixes (optional, in
Fixes #<issue number>, #<issue number>, ...
format, will close the issue(s) when PR gets merged):Fixes #2372.
Checklist: