Skip to content

[Makefile.cache] fix an issue that non-direct dependencies are not ac…#53

Closed
stepanblyschak wants to merge 1 commit intomasterfrom
fix-rpc-docker-cache-issue
Closed

[Makefile.cache] fix an issue that non-direct dependencies are not ac…#53
stepanblyschak wants to merge 1 commit intomasterfrom
fix-rpc-docker-cache-issue

Conversation

@stepanblyschak
Copy link
Owner

…counted in component hash calculation

Signed-off-by: Stepan Blyschak stepanb@nvidia.com

Why I did it

Fixed an issue that changing SDK version leads to cache framework taking cached syncd RPC image rather then rebuilding syncd RPC based on new syncd with new SDK.

Investigation showed that cache framework calculates a component hash based on direct dependencies. Syncd RPC image hash consists of two parts: one is the flags of syncd RPC (platform, ENABLE_SYNCD_RPC) and syncd RPC direct dependencies makefiles. None of the syncd RPC direct dependencies are modified when SDK version changes, so hash is unchanged.

How I did it

To fix this issue, include the hash of dependencies into current component hash calculation, e.g.:

In calcultation of the hash docker-syncd-mlnx-rpc.gz-274dfed3f52f2effa9989fc-39344350436f9b06d28b470.tgz, the hash of syncd is included: docker-syncd-mlnx.gz-48ee88ac54b201e0e107b15-7bbea320025177a2121e440.tgz in which the hash of SDK is included.

How to verify it

Build with cache enabled and check that changing SDK version leads to a different hash of syncd rpc image:

SDK version 4.5.1002:

docker-syncd-mlnx.gz-48ee88ac54b201e0e107b15-7bbea320025177a2121e440.tgz
docker-syncd-mlnx-rpc.gz-274dfed3f52f2effa9989fc-39344350436f9b06d28b470.tgz

SDK version 4.5.1002-005:

docker-syncd-mlnx.gz-18baf952e3e0eda7cda7c3c-e5668f4784390d5dffd55af.tgz
docker-syncd-mlnx-rpc.gz-4a6e59580eda110b5709449-552f76be135deaf750aeab2.tgz

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

…counted in component hash calculation

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
# Include package dependencies hash values into package hash calculation
$(eval $(1)_DEP_PKGS_SHA := $(foreach dfile,$(1)_MOD_DEP_PKGS,$(dfile)_DEP_MOD_SHA $(dfile)_MOD_HASH))

$(eval $(1)_DEP_MOD_SHA := $(shell bash -c "git hash-object $($(1)_DEP_MOD_SHA_FILES) && echo $($(1)_DEP_PKGS_SHA)" \
Copy link

@nazariig nazariig Oct 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stepanblyschak What about submodule dependencies? Do we want to include flags as well? Why do we need to use echo here?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flags are included in $(dfile)_MOD_HASH for dependency.
I use echo to append to the output of git hash-obejcts.
Could you please clarify what is the concern about submodules?

stepanblyschak pushed a commit that referenced this pull request Apr 18, 2022
[202012][sonic-linkmgrd]Submodule update

8507629 Jing Zhang      Mon Apr 4 10:25:22 2022 -0700   Lower unsolicited MUX state change notification log level to WARNING #57
17d217d Longxiang Lyu   Mon Mar 21 12:15:19 2022 +0800  Enhance clang format (#46)
c72fa2a Jing Zhang      Fri Apr 1 12:23:29 2022 -0700   Disable the feature that decreases link probe interval for measuring switch overhead #49 (#54)
256b01b Jing Zhang      Thu Mar 31 16:20:00 2022 -0700  Update link prober metrics posting logics #50 #53
dfd48d0 Jing Zhang      Wed Mar 23 16:27:45 2022 -0700  Decrease link probing interval after switchover to better determine the overhead of a toggle #43 (#48)

sign-off: Jing Zhang zhangjing@microsoft.com
@stepanblyschak stepanblyschak deleted the fix-rpc-docker-cache-issue branch September 23, 2022 13:33
stepanblyschak pushed a commit that referenced this pull request Jan 2, 2025
…ly (sonic-net#21230)

#### Why I did it
src/dhcprelay
```
* b242307 - (HEAD -> master, origin/master, origin/HEAD) Revert "Fail build when test fail (#53)" (#62) (19 hours ago) [Yaqiang Zhu]
* dbaee8b - Fail build when test fail (#53) (6 days ago) [Yaqiang Zhu]
* ef7b972 - [Build] Update to build bookworm debian package (#55) (8 days ago) [Yaqiang Zhu]
* 011066a - Add wait and check ip address check when dhcp6relay init (#52) (11 days ago) [Yaqiang Zhu]
```
#### How I did it
#### How to verify it
#### Description for the changelog
stepanblyschak pushed a commit that referenced this pull request Mar 26, 2025
…ly (sonic-net#22145)

#### Why I did it
src/sonic-stp
```
* 9949755 - (HEAD -> master, origin/master, origin/HEAD) MSTP PTX/PRX state machine APIs (#53) (18 hours ago) [Divya Kumaran Chandralekha]
* 12cb28f - Mstp feature - State machine APIs (#51) (23 hours ago) [Divya Kumaran Chandralekha]
```
#### How I did it
#### How to verify it
#### Description for the changelog
stepanblyschak pushed a commit that referenced this pull request May 20, 2025
…lly (sonic-net#808)

#### Why I did it
src/sonic-swss
```
* 4bd7d81 - (HEAD -> 202412, origin/202412) [code sync] Merge code from sonic-net/sonic-swss:202411 to 202412 (#53) (16 hours ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
stepanblyschak pushed a commit that referenced this pull request Sep 24, 2025
…sonic-net#23964)

#### Why I did it
src/dhcpmon
```
* 4531323 - (HEAD -> master, origin/master, origin/HEAD) [init] Init physical interfaces without portchannel in counter (#53) (2 days ago) [Yaqiang Zhu]
* 84d8d1c - Add a dhcp type validation when increasing cache counter (#52) (4 days ago) [Yanpeng Zhang]
```
#### How I did it
#### How to verify it
#### Description for the changelog
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.

2 participants