-
Notifications
You must be signed in to change notification settings - Fork 8
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
backup functionality #161
backup functionality #161
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #161 +/- ##
========================================
Coverage 99.89% 99.90%
========================================
Files 9 10 +1
Lines 1896 2066 +170
========================================
+ Hits 1894 2064 +170
Misses 2 2 ☔ View full report in Codecov by Sentry. |
Thanks @eimrek . To me the concept looks fine. I haven't gone in detail over the actual intricacies of the order in which you copy data such that it allows this operation during operation. I think it would be good to document the reasoning at least somewhere (either in the docs or in the docstrings of the backup util functions) to explain why this should be safe. The CLI command help should also explicitly state if it is safe to perform while the OS is being used.
Sure there is duplication now, but if we were to merge the code here and make a release,
This will definitely break, since that is a bash command, which will not run natively on windows. But even if you were to replace this and find a cross-platform solution, you are still using @giovannipizzi thoughts? |
@eimrek let me know if you want me to have a look at this and or have particular questions. Since you marked it as WIP I haven't gone through it yet |
@sphuber sure. i think the main features are there, i just need to add tests. |
Note after discussion with @edan-bainglass : his usecase (mounting a windows folder to a linux container and backing up there) might not support symlinks. At least in my case, where to mount a windows folder to my linux virtual machine doesn't, by default. Therefore, it might make sense to avoid using symlinks altogether. |
9ae21d1
to
3011e59
Compare
Hi @sphuber @giovannipizzi, this PR is in a state where your feedback would be great. the functionality is there and i added main CLI tests. But some notes/comments regarding things i'm not sure about:
|
Alright, this is finally finalized. I changed the design such that there is a "metaclass" Any suggestions welcome :) |
@sphuber @giovannipizzi feel free to submit your review if you have a moment to check. |
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.
Thanks @eimrek . As discussed online, although the cyclic dependency between the manager calling a callback which takes the manager itself seems non-ideal, I also cannot see a much better solution now that would still require the generic functionality to be reused in aiida-core
, so let's keep that for now. The same goes for the exes
functionality which I think is not really the responsibility of this tool, but since it is already there and it works, let's keep it as well.
Only things remaining are minor changes that we should be able to address quickly to get this merged. Thanks a lot!
Co-authored-by: Sebastiaan Huber <[email protected]>
Co-authored-by: Sebastiaan Huber <[email protected]>
for more information, see https://pre-commit.ci
Co-authored-by: Sebastiaan Huber <[email protected]>
Co-authored-by: Sebastiaan Huber <[email protected]>
Co-authored-by: Sebastiaan Huber <[email protected]>
Co-authored-by: Sebastiaan Huber <[email protected]>
Co-authored-by: Sebastiaan Huber <[email protected]>
Co-authored-by: Sebastiaan Huber <[email protected]>
Co-authored-by: Sebastiaan Huber <[email protected]>
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.
Thanks a lot @eimrek
Hi @giovannipizzi @sphuber, as discussed (also in #20), I moved the disk-objectstore backup functionality from aiidateam/aiida-core#6069 to this project.
It works currently, but I added everything currently in a separate file
backup_utils.py
, to keep it a bit decoupled for now. Also requires some polishing (e.g. the logging part).However, there are some issues:
verdi storage backup
aiida-core#6069: i basically added the same utility functions to run commands on local and remote machines & to call rsync. Is this duplication fine or do you have some ideas how to change this design?[ -e <path> ]
to check if a folder exists. I used this so that I could use the same method for both local and remote paths. However, another option is to use python-specific checks for local paths (e.g.pathlib.Path.exists()
for this case) and unix-specific ones for remote ones. This might be a way to keep the windows support, at least if doing backups to a local folder.Any ideas welcome.
If this approach works, i can polish it further and add some tests.