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

Refactors for automatic cache pruning #848

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

cjreynol
Copy link
Collaborator

@cjreynol cjreynol commented Jan 14, 2025

Clean up the boundary between CvdFetchCommandHandler/FetchCvdMain and make cache logic available for use in the fetch handler.

The main changes are around the FetchCvdMain parameters. Everything else should be a move or rename.

Test: cvd fetch --target_directory=/tmp/cvd
--default_build=aosp-main/aosp_cf_x86_64_phone-trunk_staging-userdebug
Test: cvd fetch --help
Test: cvd help fetch
Test: cvd cache info
Test: cvd cache prune
Test: cvd cache empty

@cjreynol cjreynol self-assigned this Jan 14, 2025
@cjreynol cjreynol requested a review from jemoreira January 14, 2025 02:52
@cjreynol cjreynol force-pushed the auto_cache_prune_prep branch from 7e715da to 7448680 Compare January 14, 2025 19:41
@cjreynol cjreynol marked this pull request as ready for review January 14, 2025 19:44
@cjreynol cjreynol added the kokoro:run Run e2e tests. label Jan 14, 2025
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Jan 14, 2025
@cjreynol cjreynol force-pushed the auto_cache_prune_prep branch from 7448680 to d116c61 Compare January 15, 2025 18:57
@cjreynol cjreynol added the kokoro:run Run e2e tests. label Jan 15, 2025
@cjreynol cjreynol enabled auto-merge January 15, 2025 19:03
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Jan 15, 2025
The previous signature was a relic from the `fetch_cvd` stand-alone
executable.  Now that `fetch` is only a `cvd` subcommand there is no
more need for the compatibility conversion.

Test: cvd fetch --target_directory=/tmp/cvd
--default_build=aosp-main/aosp_cf_x86_64_phone-trunk_staging-userdebug
The main motivation is that we want the flag values (specifically
`enable_caching`) to be available in the fetch command so we can use it
as a signal to trigger the cache pruning logic.

This change also has the benefit of removing non-fetch logic from
`FetchCvdMain`.

Test: cvd fetch --target_directory=/tmp/cvd/fetch_test
--default_build=aosp-main/aosp_cf_x86_64_phone-trunk_staging-userdebug
Test: cvd fetch --help
Test: cvd help fetch
For the automatic cache management, rather than call `cvd cache`
directly we will call `RunPrune` and bypass the `CommandHandler`.

Test: cvd cache info
Test: cvd cache prune
Test: cvd cache empty
@cjreynol cjreynol force-pushed the auto_cache_prune_prep branch from d116c61 to 49d526b Compare January 15, 2025 19:35
@cjreynol cjreynol added the kokoro:run Run e2e tests. label Jan 15, 2025
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Jan 15, 2025
@cjreynol cjreynol added this pull request to the merge queue Jan 16, 2025
Merged via the queue into google:main with commit 40fd1fd Jan 16, 2025
11 checks passed
@cjreynol cjreynol deleted the auto_cache_prune_prep branch January 16, 2025 04:44
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