Skip to content

Conversation

@Databean
Copy link
Member

@Databean Databean commented Nov 3, 2025

Wraps standard download operations with cross-cutting concerns:

  • Tracing long-running operations with time used.
  • Tracking the source build of created files.
  • Placing files under the right target directory.
  • Desparsing images.

File paths for return values and argument values are relative to the target directory.

By hiding the target directory from direct access, IO operations are funneled through an instance of this type, which guarantees none of the cross-cutting concerns are missed. Additionally, this could be replaced with a fake implementation later to support unit testing the business logic.

Bug: b/457520264

Databean added a commit to Databean/android-cuttlefish that referenced this pull request Nov 4, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2025
@Databean Databean requested a review from jemoreira November 5, 2025 03:26
@Databean
Copy link
Member Author

Databean commented Nov 5, 2025

Changed the new API surface. A relevant behavioral change is that now extracting img.zip and otatools.zip files goes through libzip rather than bsdtar.

Wraps standard download operations with cross-cutting concerns:
- Tracing long-running operations with time used.
- Tracking the source build of created files.
- Placing files under the right target directory.
- Desparsing images.

File paths for return values and argument values are relative to the target
directory.

By hiding the target directory from direct access, IO operations are funneled
through an instance of this type, which guarantees none of the cross-cutting
concerns are missed. Additionally, this could be replaced with a fake
implementation later to support unit testing the business logic.

Bug: b/457520264
These have been folded into the logic for fetching default and system
builds.

Bug: b/457520264
@Databean Databean added the kokoro:run Run e2e tests. label Nov 6, 2025
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Nov 6, 2025
@Databean Databean added this pull request to the merge queue Nov 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 6, 2025
@Databean Databean added this pull request to the merge queue Nov 6, 2025
Merged via the queue into google:main with commit 00e6e67 Nov 6, 2025
22 checks passed
Databean added a commit to Databean/android-cuttlefish that referenced this pull request Nov 26, 2025
google#1762 added
automatic fetch trace logging for each individual file extracted from a
`.zip` file. Many of these operations are very fast, especially for
`otatools.zip` and take many lines of logs. These should be condensed
since they don't contribute much to the overall time and make the trace
harder to read.

Sample new output:
```
Performance stats:
PreFetch actions:
 started: 2025-11-25 15:52:13, duration: 1 s
 - GetBuilds: 1 s
Host Package:
 started: 2025-11-25 15:52:14, duration: 3 m 13 s
 - Download: 3 m 6 s, 851 MiB
 - Extract: 6 s
 - 2 operations omitted with a combined duration of 12 ms.
Default:
 started: 2025-11-25 15:52:14, duration: 7 m 33 s
 - Downloaded 'misc_info.txt': 1 s, 9000 B
 - Downloaded 'aosp_cf_x86_64_only_phone-img-14496483.zip': 7 m 23 s, 1135 MiB
 - Extracted 'super.img' from 'aosp_cf_x86_64_only_phone-img-14496483.zip': 7 s, 1339 MiB
 - Desparsed [/super.img]: 933 ms, 8192 MiB
 - 22 operations omitted with a combined duration of 549 ms.
Kernel:
 started: 2025-11-25 15:59:47, duration: 8 ms
 - 4 operations omitted with a combined duration of 8 ms.
OTA Tools:
 started: 2025-11-25 15:59:47, duration: 1 m 54 s
 - Downloaded 'otatools.zip': 1 m 51 s, 486 MiB
 - 14653 operations omitted with a combined duration of 3 s.
```

Bug: b/463765667
github-merge-queue bot pushed a commit that referenced this pull request Nov 26, 2025
#1762 added
automatic fetch trace logging for each individual file extracted from a
`.zip` file. Many of these operations are very fast, especially for
`otatools.zip` and take many lines of logs. These should be condensed
since they don't contribute much to the overall time and make the trace
harder to read.

Sample new output:
```
Performance stats:
PreFetch actions:
 started: 2025-11-25 15:52:13, duration: 1 s
 - GetBuilds: 1 s
Host Package:
 started: 2025-11-25 15:52:14, duration: 3 m 13 s
 - Download: 3 m 6 s, 851 MiB
 - Extract: 6 s
 - 2 operations omitted with a combined duration of 12 ms.
Default:
 started: 2025-11-25 15:52:14, duration: 7 m 33 s
 - Downloaded 'misc_info.txt': 1 s, 9000 B
 - Downloaded 'aosp_cf_x86_64_only_phone-img-14496483.zip': 7 m 23 s, 1135 MiB
 - Extracted 'super.img' from 'aosp_cf_x86_64_only_phone-img-14496483.zip': 7 s, 1339 MiB
 - Desparsed [/super.img]: 933 ms, 8192 MiB
 - 22 operations omitted with a combined duration of 549 ms.
Kernel:
 started: 2025-11-25 15:59:47, duration: 8 ms
 - 4 operations omitted with a combined duration of 8 ms.
OTA Tools:
 started: 2025-11-25 15:59:47, duration: 1 m 54 s
 - Downloaded 'otatools.zip': 1 m 51 s, 486 MiB
 - 14653 operations omitted with a combined duration of 3 s.
```

Bug: b/463765667
github-merge-queue bot pushed a commit that referenced this pull request Nov 26, 2025
#1762 added
automatic fetch trace logging for each individual file extracted from a
`.zip` file. Many of these operations are very fast, especially for
`otatools.zip` and take many lines of logs. These should be condensed
since they don't contribute much to the overall time and make the trace
harder to read.

Sample new output:
```
Performance stats:
PreFetch actions:
 started: 2025-11-25 15:52:13, duration: 1 s
 - GetBuilds: 1 s
Host Package:
 started: 2025-11-25 15:52:14, duration: 3 m 13 s
 - Download: 3 m 6 s, 851 MiB
 - Extract: 6 s
 - 2 operations omitted with a combined duration of 12 ms.
Default:
 started: 2025-11-25 15:52:14, duration: 7 m 33 s
 - Downloaded 'misc_info.txt': 1 s, 9000 B
 - Downloaded 'aosp_cf_x86_64_only_phone-img-14496483.zip': 7 m 23 s, 1135 MiB
 - Extracted 'super.img' from 'aosp_cf_x86_64_only_phone-img-14496483.zip': 7 s, 1339 MiB
 - Desparsed [/super.img]: 933 ms, 8192 MiB
 - 22 operations omitted with a combined duration of 549 ms.
Kernel:
 started: 2025-11-25 15:59:47, duration: 8 ms
 - 4 operations omitted with a combined duration of 8 ms.
OTA Tools:
 started: 2025-11-25 15:59:47, duration: 1 m 54 s
 - Downloaded 'otatools.zip': 1 m 51 s, 486 MiB
 - 14653 operations omitted with a combined duration of 3 s.
```

Bug: b/463765667
github-merge-queue bot pushed a commit that referenced this pull request Nov 26, 2025
#1762 added
automatic fetch trace logging for each individual file extracted from a
`.zip` file. Many of these operations are very fast, especially for
`otatools.zip` and take many lines of logs. These should be condensed
since they don't contribute much to the overall time and make the trace
harder to read.

Sample new output:
```
Performance stats:
PreFetch actions:
 started: 2025-11-25 15:52:13, duration: 1 s
 - GetBuilds: 1 s
Host Package:
 started: 2025-11-25 15:52:14, duration: 3 m 13 s
 - Download: 3 m 6 s, 851 MiB
 - Extract: 6 s
 - 2 operations omitted with a combined duration of 12 ms.
Default:
 started: 2025-11-25 15:52:14, duration: 7 m 33 s
 - Downloaded 'misc_info.txt': 1 s, 9000 B
 - Downloaded 'aosp_cf_x86_64_only_phone-img-14496483.zip': 7 m 23 s, 1135 MiB
 - Extracted 'super.img' from 'aosp_cf_x86_64_only_phone-img-14496483.zip': 7 s, 1339 MiB
 - Desparsed [/super.img]: 933 ms, 8192 MiB
 - 22 operations omitted with a combined duration of 549 ms.
Kernel:
 started: 2025-11-25 15:59:47, duration: 8 ms
 - 4 operations omitted with a combined duration of 8 ms.
OTA Tools:
 started: 2025-11-25 15:59:47, duration: 1 m 54 s
 - Downloaded 'otatools.zip': 1 m 51 s, 486 MiB
 - 14653 operations omitted with a combined duration of 3 s.
```

Bug: b/463765667
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