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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

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 81.73%. Comparing base (019ca54) to head (7d79d76).
Report is 2 commits behind head on main.

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   81.47%   81.73%   +0.26%     
==========================================
  Files          13       13              
  Lines         815      876      +61     
==========================================
+ Hits          664      716      +52     
- Misses        151      160       +9     
Files with missing lines Coverage Δ
vec_inf/client/api.py 78.46% <100.00%> (+3.91%) ⬆️
vec_inf/cli/_cli.py 77.44% <86.36%> (+1.76%) ⬆️
vec_inf/client/_utils.py 81.51% <79.31%> (-0.71%) ⬇️

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.

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.

3 participants