Support for DPKG local caching#3292
Support for DPKG local caching#3292Kalimuthu-Velappan wants to merge 3 commits intosonic-net:masterfrom
Conversation
|
can you add full description of what you have done? how you verified? |
Added full description for design note and verification of the patch |
|
I am not sure I fully understand the idea. I think we should discuss this in a community meeting. can you book a community meeting to discuss this? |
0055bc3 to
b943612
Compare
|
is there any update on this PR? |
|
Hi lguohan ,
We have added more enhancements to PR to cover the caching for docker
images along with Debian packages and submitted the code changes for
internal code review. We are working on the HLD update for this feature and
will share it with you once it is ready.
We have planned to run the caching framework internally for a few weeks to
make sure that any missing dependency to be captured.
Once everything is stable, we will update the PR for upstream.
Thanks
Kals
…On Tue, Dec 3, 2019 at 6:50 AM lguohan ***@***.***> wrote:
is there any update on this PR?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3292>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM2UC2RSLKTNLSJFEV665ZDQWWX4BANCNFSM4IJVS7BQ>
.
--
Thanks
- Kals
|
|
retest vsimage please |
| mv $(addprefix $($*_SRC_PATH)/../, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS)) $(DEBS_PATH) $(LOG) | ||
|
|
||
| # Save the target deb into DPKG cache | ||
| $(if $(and $(filter-out none,$(SONIC_DPKG_CACHE_METHOD)),$($*_CACHE_MODE)), $(call SAVE_CACHE,$*,$@)) |
There was a problem hiding this comment.
can check the alignment here?
| if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi | ||
|
|
||
| # Save the target deb into DPKG cache | ||
| $(if $(and $(filter-out none,$(SONIC_DPKG_CACHE_METHOD)),$($*_CACHE_MODE)), $(call SAVE_CACHE,$*,$@)) |
There was a problem hiding this comment.
check you check the alignment here?
| SMPATH=$(SRC_PATH)/sonic-linux-kernel/ | ||
| SM_DEP_LIST := Makefile | ||
| SM_DEP_LIST += patch/* | ||
| SM_DEP_LIST += patch/preconfig/* |
There was a problem hiding this comment.
why do we have only rule for linux-kernel? We should have rules for other source code?
|
|
||
|
|
||
| SMPATH=$(SRC_PATH)/sonic-linux-kernel/ | ||
| SM_DEP_LIST := Makefile |
There was a problem hiding this comment.
what does this SM stand for?
There was a problem hiding this comment.
SM stands for Sub Module in the sonic repo
Initially, the DPKG caching framework is supported only for the Linux submodule, later, we have enhanced the DPKG caching framework to cover all the sub modules and Debian packages in the sonic repro.
We will close this one and will raise a new pull request for the enhanced version of the DPKG caching framework.
…atically (#18977) #### Why I did it src/sonic-utilities ``` * 2d557ff9 - (HEAD -> 202311, origin/202311) Update sonic-utilities to support new SKU Mellanox-SN5600-O128 (#3236) (31 hours ago) [Stephen Sun] * 60a0db88 - [chassis][midplane] Add notification to Supervisor when LC is graceful reboot (#3292) (31 hours ago) [Marty Y. Lok] ``` #### How I did it #### How to verify it #### Description for the changelog
- What I did
DPKG caching framework provides the infrastructure to cache the sonic module/target .deb files into a local cache by tracking the target dependency files.SONIC build infrastructure is designed as a plugin framework where any new source code can be easily integrated into sonic as a module and that generates output as a .deb file. The source code compilation of a module is completely independent of other modules compilation. Inter module dependency is resolved through build artifacts like header files, libraries, and binaries in the form of Debian packages. For example module A depends on module B. While module A is being built, it uses B's .deb file to install it in the build docker.
The DPKG caching framework provides an infrastructure which caches a module's deb package and restores it back to the build directory if its dependency files are not modified. When a module is compiled for the first time, generated deb package is stored at the DPKG cache location. On the subsequent build, first, it checks the module dependency file modification. If none of the dependent files is changed, it copies the deb package from the cache location, otherwise, it goes for local compilation and generates the deb package. The modified files should be checked-in to get the newer cache deb package.
This provides a huge improvement in build time and also supports the true incremental build by tracking the dependency files.
- How I did it
It takes two global arguments to enable the DPKG caching, the first one indicates the caching method and the second one describes the location of the cache.
SONIC_DPKG_CACHE_METHOD=cache
SONIC_DPKG_CACHE_SOURCE=
Dependency file tracking:
Dependency files are tracked for each target in two levels.
1. Common make infrastructure files - rules/config, rules/functions, slave.mk etc.
2. Per module files - files which are specific to modules, Makefile, debian/rules, patch files, etc.
Cache file tracking:
The Cache file is a compressed TAR ball of a module's target DEB file and its derived-target DEB files.
The cache filename is formed with the following format
Target Specific rules:
Caching can be enabled/disabled on a global level and also on the per-target level.
- How to verify it
- Description for the changelog
The DPKG caching framework provides the infrastructure to save the module-specific deb file to be cached by tracking the module's dependency files.
If the module's dependency files are not changed, it restores the module deb files from the cache storage.
- A picture of a cute animal (not mandatory but encouraged)