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

Automated workspace pruning/cleaning #35

Merged
merged 32 commits into from
Jul 15, 2024

Conversation

wangpatrick57
Copy link
Member

@wangpatrick57 wangpatrick57 commented Jul 8, 2024

Summary: A command to find and remove unneeded files from the workspace directory.

Demo:
Passing 25 unit tests with many edge cases which create files/directories, call clean_workspace(), and then verify its contents.
Screenshot 2024-07-07 at 17 05 07

Details

  • "Aggressive" mode removes all task_runs/*/ directories that are not directly pointed to by a symlink in symlinks/.
  • "Safe" mode also keeps task_runs/*/ directories which are indirectly pointed to by a symlink. This can happen if a symlink points to a task_runs/*/ directory which has a symlink in it that points to another task_runs/*/ directory.
  • I chose to write so many unit tests because this operation must be bug-free.

@wangpatrick57 wangpatrick57 requested a review from lmwnshn July 8, 2024 00:08
@wangpatrick57 wangpatrick57 changed the title Clean workspace directory Automated workspace pruning/cleaning Jul 9, 2024
manage/cli.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@lmwnshn lmwnshn left a comment

Choose a reason for hiding this comment

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

LGTM

@wangpatrick57 wangpatrick57 merged commit 3245aab into cmu-db:main Jul 15, 2024
1 check passed
@wangpatrick57 wangpatrick57 deleted the clean-workspace branch July 18, 2024 00:30
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