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

[Build] Fix sonic-config low dpkg hit rate issue #12244

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

xumia
Copy link
Collaborator

@xumia xumia commented Sep 30, 2022

Why I did it

When sending a PR only CI change, as expected, the target target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl should be from the cache, because the depended files were not changed, but it rebuilt.

See log in PR: #12240

2022-09-30T07:16:16.9270567Z [ building ] [ target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl ] 
2022-09-30T07:17:52.6637892Z [ finished ] [ target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl ] 

Comparing the dpkg dep file sonic_config_engine-1.0-py3-none-any.whl.dep with the official build, the depended files are in different order, it leads to the different hash value.

The cache hit rate of the last 30 days was 11.9%, lower than expected, all the targets that depended on the targets were rebuilt.

AzurePipelineBuildLogs
| where startTime > ago(30d)
| where type contains "task"
| where reason contains "pullRequest"
| where content contains "[ target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl ]"
| summarize CachedCount = dcountif(buildId, content contains "[ cached ] [ target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl ]"), noneCachedCount=dcountif(buildId,content contains "[ finished ] [ target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl ]")
| project CachedCount/toreal(CachedCount + noneCachedCount)

How I did it

Sort the files by name.

How to verify it

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

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

@xumia
Copy link
Collaborator Author

xumia commented Oct 4, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xumia xumia merged commit 1f0699f into sonic-net:master Oct 5, 2022
@xumia xumia deleted the fix-sonic-config-dpkg-cache-issue branch October 5, 2022 00:10
yxieca pushed a commit that referenced this pull request Oct 6, 2022
Why I did it
When sending a PR only CI change, as expected, the target target/python-wheels/buster/sonic_config_engine-1.0-py2-none-any.whl should be from the cache, because the depended files were not changed, but it rebuilt.

How I did it
Sort the files by name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants