Skip to content
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

vine: set file mode for all transmitted file types #3761

Open
btovar opened this issue Apr 11, 2024 · 3 comments
Open

vine: set file mode for all transmitted file types #3761

btovar opened this issue Apr 11, 2024 · 3 comments

Comments

@btovar
Copy link
Member

btovar commented Apr 11, 2024

Currently local files in taskvine are copied to the workers with the same permissions they have in the machine running the manager. For coffea-casa some files need to be chmod to 0600.

This sounds like a mount option, however, the mode is kept in the file structure; thus it would be easier to add a set_mod to the vine_file. This is specially true for the dask executor, as users only have access to files, but not mounts when specifying extra_files.

@btovar
Copy link
Member Author

btovar commented Apr 11, 2024

Actually the mode is not kept in vine_file, but it is read from stat every time the file is transferred.

@btovar
Copy link
Member Author

btovar commented Apr 11, 2024

A workaround with minitasks:

local_token = m.declare_file("token", cache=True)
do_chmod = vine.Task("chmod 0600 input_file")
do_chmod.add_input(local_token, "input_file")

f = m.declare_minitask(do_chmod, "input_file", cache=True, peer_transfer=True)

t = vine.Task("stat access_token")
t.add_input(f, "access_token")

@dthain
Copy link
Member

dthain commented Jun 12, 2024

Interestingly, the worker and the manager-worker protocol all support the notion that the file mode is carried over the network and applied at the worker. We are just missing the opportunity to set the mode appropriately through the API. For a normal file, it can come from the file source. But buffers, urls, and other files sources don't have an obvious way. For example:

/* XXX The API does not allow the user to choose the mode bits of the target file, so we make it permissive

Suggest that what we do is add a new file method something like this:

vine_file_set_mode( file, mode );

And then use that saved info throughout vine_manager_put.

@dthain dthain changed the title vine: set mod for files when declaring/mounting vine: set file mode for all transmitted file types Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants