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

Add local fetch caching to cvd fetch #542

Merged
merged 1 commit into from
May 17, 2024

Conversation

cjreynol
Copy link
Collaborator

@cjreynol cjreynol commented May 4, 2024

IFF the --target_directory and /tmp/cvd/<user_id>/cache can be
hardlinked, repeated cvd fetch commands on the same build+target will
reference cached files and hardlink the files to the target directory
for use.

The extract and renaming steps still occur every time, this is only
caching for downloads against AB.

This new behavior is on by default (--enable_caching=true).

Test: cvd fetch --target_directory=/tmp/cvd/fetch_test
--default_build=11801630
Test: ls
/tmp/cvd/<user_id>/cache/11801630/aosp_cf_x86_64_phone-trunk_staging-userdebug/
Test: # repeat fetch command and review fetch.log to see the archive
downloads do not happen

@cjreynol cjreynol force-pushed the local-fetch-caching branch 4 times, most recently from 8a02ea0 to c2d35db Compare May 7, 2024 23:37
@cjreynol cjreynol added the kokoro:run Run e2e tests. label May 7, 2024
@cjreynol
Copy link
Collaborator Author

cjreynol commented May 7, 2024

The first commit with files.h/cpp helper functions will be committed in aosp/3077287 and copied over to keep things in sync.

@cjreynol cjreynol marked this pull request as ready for review May 7, 2024 23:57
@cjreynol
Copy link
Collaborator Author

cjreynol commented May 8, 2024

@jemoreira please review when you have a chance :)

@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label May 8, 2024
@cjreynol cjreynol force-pushed the local-fetch-caching branch 9 times, most recently from 6f86966 to 2948b62 Compare May 16, 2024 05:55
@cjreynol cjreynol added the kokoro:run Run e2e tests. label May 16, 2024
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label May 16, 2024
IFF the `--target_directory` and `/tmp/cvd/<user_id>/cache` can be
hardlinked, repeated `cvd fetch` commands on the same build+target will
reference cached files and hardlink the files to the target directory
for use.

The extract and renaming steps still occur every time, this is only
caching for downloads against AB.

This new behavior is on by default (`--enable_caching=true`).

Test: cvd fetch --target_directory=/tmp/cvd/fetch_test
--default_build=11801630
Test: ls
/tmp/cvd/<user_id>/cache/11801630/aosp_cf_x86_64_phone-trunk_staging-userdebug/
Test: # repeat fetch command and review `fetch.log` to see the archive
downloads do not happen
@cjreynol cjreynol added the kokoro:run Run e2e tests. label May 17, 2024
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label May 17, 2024
@cjreynol cjreynol merged commit 0857046 into google:main May 17, 2024
6 checks passed
jrguzman-ms pushed a commit to msft-mirror-aosp/device.google.cuttlefish that referenced this pull request May 29, 2024
Tested over in google/android-cuttlefish#542,
but committing here for the eventual migration.

Bug: 337940247
Test: m

Change-Id: Id5adbb6a82a530722ee6e411a186e07d54399dee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants