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

Fix copy local files to remote target folder with sub-folder #6768

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

superstar54
Copy link
Member

Fix #6767 .

@@ -373,7 +373,7 @@ async def _copy_local_files(logger, node, transport, inputs, local_copy_list, wo
# If the source object is a directory, we copy its entire contents
data_node.base.repository.copy_tree(filepath_target, filename_source)
await transport.put_async(
f'{dirpath}/*',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will copy everything inside dirpath to workdir. If filename_target is a out/HP, then the dirpath will have out/HP, then it will copy them into the workdir target out/HP, result folders as reported in #6767

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.13%. Comparing base (f4c55f5) to head (ac6376c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6768      +/-   ##
==========================================
- Coverage   78.15%   78.13%   -0.01%     
==========================================
  Files         564      564              
  Lines       42643    42646       +3     
==========================================
- Hits        33322    33319       -3     
- Misses       9321     9327       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@superstar54 superstar54 requested a review from khsrali February 21, 2025 13:37
@superstar54
Copy link
Member Author

Pining @bastonero , so he is aware of this fix.

@bastonero
Copy link
Contributor

Thanks @superstar54 ! As soon as this is released in a newer version i will update the deps of aiida-hubbard so to support the latest aiida-core version. Thanks a lot again for this hot fix!

Copy link
Contributor

@khsrali khsrali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @superstar54 for your suggestion.
I think this was rahter introduced along with #6447

And this fix can potentially, mix up things.

I ping @mbercx , if he can approve these changes. As he originally wrote that part of the code, so he's the master of it 😉

parent_path = os.path.dirname(path)

if not self.isdir(parent_path):
self.mkdir(parent_path, ignore_existing=True)
Copy link
Contributor

@khsrali khsrali Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please note, we already have this functionality in the same file, search for def makedirs

@mbercx
Copy link
Member

mbercx commented Feb 24, 2025

Thanks for the ping @khsrali! I remember that indeed some of the behaviour of the copy lists was somewhat counter-intuitive, but changing it could potentially break quite a few plugins, so we need to take care. See this PR for a lot more context and discussion:

#6348

I would need some time to work back into this to do a proper review, and that's going to be tricky this week for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CalcJob bug in coping local files to remote folder with sub-folder
4 participants