-
Notifications
You must be signed in to change notification settings - Fork 159
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: Enhance VFolder mount with additional explicit and verbose options #1838
Conversation
.feature.md -> 1838.feature.md
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.
Generally LGTM!
Just let's trafaret-fy MountTypes
and MountPermission
in the API IV checks.
rror(\'{0: DataError(\\\'value should be None\\\'), 1: DataError(\\\'{\\\\\\\'pipeline-0-YynSBt\\\\\\\': DataError(\\\\\\\'{\\\\\\\\\\\\\\\'value\\\\\\\\\\\\\\\': DataError(\\\\\\\\\\\\\\\'{\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'permission\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\': DataError("{0: DataError(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'value should be None\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'), 1: DataError(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'value is not a valid member of MountPermission\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\')}")}\\\\\\\\\\\\\\\')}\\\\\\\')}\\\')}\')}') |
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 new vfolder mount argument format should be also recognized by the backend.ai session create
command as well!
def prepare_mount_arg( | ||
mount_args: Optional[Sequence[str]], | ||
mount_args: Optional[Sequence[str]] = None, | ||
) -> Tuple[Sequence[str], Mapping[str, str]]: | ||
""" | ||
Parse the list of mount arguments into a list of | ||
vfolder name and in-container mount path pairs. | ||
|
||
:param mount_args: A list of mount arguments such as | ||
[ | ||
"vf-5194d5d8", | ||
"vf-70b99ea5=/home/work/abc", | ||
"vf-cd6c0b91:/home/work/zxc", | ||
] |
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.
When would be the case of this old prepare_mount_arg()
being utilized on the new code base? I am in doubt of leaving old function on a new code.
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 was considering keeping the old one for potential use cases. However, it would be reasonable to remove it since the new one (prepare_mount_arg_v2()
) supersedes its functionality.
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.
Yes removing old one looks ideal. Please update the PR accordingly.
This PR resolves #1836 by introducing a new handler,
prepare_mount_arg_v2()
.For instance, users can now use the following formats with two VFolders:
test-folder-808
withREAD_WRITE
permission andtest-folder-809
withREAD_ONLY
permission.NAME[=PATH]
orNAME[:PATH]
, as shown below:Each field separated by commas is optional, except for the
source
field, which is mandatory. Ifpermission
is ungiven, it will follow the permittedVFolderPermission
.For client, a new parameter
mount_options
has been added:Checklist: (if applicable)
ai.backend.test
docs
directory