Skip to content

added cleanup command functionality to cli. #106

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

Merged
merged 6 commits into from
Jun 9, 2025
Merged

added cleanup command functionality to cli. #106

merged 6 commits into from
Jun 9, 2025

Conversation

kohankhaki
Copy link
Contributor

Short Description

This pull request introduces a new cleanup command to the CLI, enabling users to remove old log directories with optional filters. It includes updates to the documentation, CLI interface, and client API to support this functionality.

New cleanup Command Implementation:

  • Added a cleanup command to the CLI in vec_inf/cli/_cli.py. This command allows users to filter and remove log directories based on criteria such as --model-family, --model-name, and --job-id. A --dry-run option is also available to preview deletions without performing them.

  • Implemented the cleanup_logs method in the VecInfClient class in vec_inf/client/api.py. This method handles the logic for finding and deleting log directories, with support for the same filtering options as the CLI command.

  • Added the find_matching_dirs utility function in vec_inf/client/_utils.py to locate directories matching the specified filters. This function is used by the cleanup_logs method to identify directories for deletion.

@kohankhaki kohankhaki requested a review from XkunW May 12, 2025 14:09
@codecov-commenter
Copy link

codecov-commenter commented May 12, 2025

Codecov Report

Attention: Patch coverage is 85.48387% with 9 lines in your changes missing coverage. Please review.

Project coverage is 89.36%. Comparing base (645223b) to head (df4edb8).

Files with missing lines Patch % Lines
vec_inf/client/_utils.py 79.31% 6 Missing ⚠️
vec_inf/cli/_cli.py 86.36% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
- Coverage   89.67%   89.36%   -0.31%     
==========================================
  Files          13       13              
  Lines         823      884      +61     
==========================================
+ Hits          738      790      +52     
- Misses         85       94       +9     
Files with missing lines Coverage Δ
vec_inf/client/api.py 93.84% <100.00%> (+1.11%) ⬆️
vec_inf/cli/_cli.py 78.10% <86.36%> (+1.58%) ⬆️
vec_inf/client/_utils.py 83.19% <79.31%> (-1.26%) ⬇️

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@XkunW
Copy link
Contributor

XkunW commented May 13, 2025

A couple of high level comments:

  • Can you add test cases for the changes you made in test_cli.py, test_api.py, and test_utils.py?
  • Is it possible to add an extra parameter that allows users to remove logs before a certain job ID?

@kohankhaki
Copy link
Contributor Author

@XkunW Added two commits regarding your comment.

Copy link
Contributor

@jwilles jwilles left a comment

Choose a reason for hiding this comment

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

LGTM

@kohankhaki
Copy link
Contributor Author

@XkunW I resolved the conflict with the updated main. Can you please review this again?
It was just missing some new tests.

@XkunW XkunW merged commit e71f314 into main Jun 9, 2025
7 checks passed
@XkunW XkunW deleted the clean_logs branch June 9, 2025 15:02
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.

4 participants