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

Add 'verdi node copyfiles' command #1121

Closed
greschd opened this issue Feb 15, 2018 · 4 comments · Fixed by #3623
Closed

Add 'verdi node copyfiles' command #1121

greschd opened this issue Feb 15, 2018 · 4 comments · Fixed by #3623

Comments

@greschd
Copy link
Member

greschd commented Feb 15, 2018

For inspecting results from the command-line, it would be nice to have an easy way to see output files, especially for SinglefileData or FolderData. What do you think about adding a verdi node gotorepository command, which takes you to the node's repository folder.

Or does this collide with the plans to add an object store backend for the repository? I could also see simply printing something like "This feature is not supported with the object-store repository." in that case.

@giovannipizzi
Copy link
Member

I personally don't like it too much, because it suggests people that it's good to go there (and potentially mess up with files). If really needed, I would just add a command that prints the URI of the repository, and then the user will do what he wants (this will work also with the object store).

However, I'd rather think to improve ways to view the files can be accessed. Suggestions open, but e.g.

  • improve the 'verdi node repo ls' and 'verdi note repo cat' commands, if they are cumbersome to use (make sure tab completion works, make the interface nicer, even have a 'fake shell' where you just have a few commands like cd, cat, less + tab completion (not sure if it's easy/a good idea though, maybe only if there are already libraries that emulate a basic terminal)
  • have a 'verdi node stageout' or similar 'copyfiles' command (or a better different name), that just creates a local copy of the files, and then one accesses them. Anyway, typically you just need to work on a few nodes at a time and this is ok, unless you have huge files. Moreover, it will work (and also make life easier) for the object store.

I think both points above are good and probably easy to do, at least in their basic version.

P.S.: If you didn't know that 'verdi node repo ls/cat' existed, probably it's a lack of documentation/documentation in the wrong place/not intuitive name, any suggestions welcome on how to improve.

@greschd
Copy link
Member Author

greschd commented Feb 16, 2018

I did know that these commands exist, but they don't help much in the case of binary (HDF5, pdf) files. If I remember right I just used tab completion or --help on the node subcommand to find them. So I guess that part of the documentation works as intended.

I totally see your point about not wanting people to meddle in the repository. Copying out the files is absolutely the better idea here.

@giovannipizzi
Copy link
Member

Great! I think it should be pretty straightforward to implement then.
it's just a node.folder.get_abs_path('.') as a parameter of a copy command.
Even better, I would add a new method to the aiida.common.folder.Folder class, called copy or something like this, that implements this (so we abstract it for the future, for the object store), and you just put the logic with os.copy() in there, and then call this method on node.folder.

@ltalirz
Copy link
Member

ltalirz commented May 31, 2019

This feature request resurfaced during the May tutorial

@greschd greschd changed the title Add 'verdi node gotorepository' command Add 'verdi node copyfiles' command Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants