-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STONEBLD-1831 If a parent image is built by Konflux, the sources introduced by it may duplicate with prefetched sources gathered during the local source build. Through the deduplicate process, comparing the parent sources and local build sources layer by layer. Once two layers have the same blob file and artifact name, they are treated as same, then the layer is removed from local source build. The same layer introduced by the parent will be merged into the source container image eventually. Major changes: * Add a new class BSILayer that wraps Layer to handle the layer archive generated by BuildSourceImage and implements a few methods for duplication check. * Add a new method to dedpulicate the sources. * Tests are updated with real tar archives. * Shared code by tests are moved to test_utils.py specifically. This file intends to have shared code only and not include any test code. Side effect: * Same extra source tar archive names remain potentially. For instance, parent sources have extra-src-[0-3].tar and local source build has extra-src-[01].tar. When extra-src-1.tar duplicates the parent source extra-src-2.tar and is removed, then the final source image will have two layers including extra-src-0.tar. Whether this is a real problem in practice depends on how the sources are extracted. It should work well for extracting sources one after another. For the parallel extraction, separate working directory per layer should also work. Signed-off-by: Chenxiong Qi <[email protected]>
- Loading branch information
Showing
4 changed files
with
729 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.