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

[Storage Cleaner] Move 1 entry within a run directory #494

Merged
merged 8 commits into from
Apr 4, 2024

Conversation

2015aroras
Copy link
Collaborator

This PR adds the option to move a single entry (file or directory) from a run to another location. This can be run in parallel for all entries run to get higher throughput.

@2015aroras 2015aroras requested a review from epwalsh March 9, 2024 00:49
Copy link
Member

@epwalsh epwalsh left a comment

Choose a reason for hiding this comment

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

LGTM, just minor comments

move_parser.add_argument(
"--entry",
default=None,
help="If provided, moving is restricted to this entry of the run.",
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a few words here to describe how an --entry should be specified. For example it looks it should be given as a filename without any other path components?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

src_dest_pairs = [
src_dest_pair
for src_dest_pair in src_dest_pairs
if Path(src_dest_pair[0]).name == config.entry.rstrip("/")
Copy link
Member

Choose a reason for hiding this comment

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

This seems a little bit brittle, what about:

Suggested change
if Path(src_dest_pair[0]).name == config.entry.rstrip("/")
if str(Path(src_dest_pair[0])).endswith(str(Path(config.entry)))

Do we warn anywhere if this list comes up empty?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

6f56700 I found Path.match and it seems more robust (it won't match test123 when config.entry is 123, for example).

b926841 Made empty list an error.

@2015aroras 2015aroras merged commit 657a55e into main Apr 4, 2024
10 checks passed
@2015aroras 2015aroras deleted the shanea/storage-cleaner-move-entry branch April 4, 2024 23:27
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.

2 participants