-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Version cache #10613
base: master
Are you sure you want to change the base?
Version cache #10613
Conversation
This pull request introduces 1 alert when merging 0c0f35999358becd3d1b5c60d14c83c1d7455499 into 598ab99 - view on LGTM.com new alerts:
|
4fc95ab
to
0010001
Compare
This pull request introduces 1 alert when merging 0010001239d1846beaf4e01cb25061e388ddb073 into 8b5d908 - view on LGTM.com new alerts:
|
0010001
to
5063102
Compare
This pull request introduces 1 alert when merging 5063102635fd8fe81df671c75c05005856233be0 into 1d84e0d - view on LGTM.com new alerts:
|
5063102
to
8a98c4e
Compare
This pull request introduces 1 alert when merging 8a98c4ee09ad925aad87ccdb4fddb0200edc7bcd into 7c4ee43 - view on LGTM.com new alerts:
|
604ee1f
to
af492ce
Compare
This pull request introduces 1 alert when merging af492ce46684e7a0c0c802b5b4fe5b424aa104a8 into 9ae17e6 - view on LGTM.com new alerts:
|
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Makefile.work
Outdated
{ echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \ | ||
$(DOCKER_BASE_BUILD) ; \ | ||
scripts/collect_docker_version_files.sh $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) target ; } | ||
@$(DOCKER_BUILD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sonic-slave-base-build is different from sonic-slave-build.
Why put them together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it
Makefile.work
Outdated
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \ | ||
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \ | ||
$(DOCKER_BUILD) ; } | ||
@$(DOCKER_BUILD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of Calling DOCKER_BUILD twice, you get this PR checker error:
- docker tag sonic-slave-bullseye:00952e8de3f 00952e8de3f sonicdev-microsoft.azurecr.io/sonic-slave-bullseye:latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your guidance. Fixed it
src/sonic-build-hooks/hooks/apt-get
Outdated
set -x | ||
if [[ "${FORCE_UPDATE}" == Y ]]; then | ||
UPDATE=y | ||
elif $(set -- /var/lib/apt/lists/*_debian_dists_${DISTRO}_InRelease; test -e "$1"); then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"$1" is "update"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, $1 is an update arg which is coming from 'apt-get update'. During apt-get update, it will cache the debian package release files. so that subsequent build will be loaded from cache.
SONIC_OVERRIDE_BUILD_VARS += SONIC_VERSION_CACHE_SOURCE=$(SONIC_VERSION_CACHE_SOURCE) | ||
export SONIC_VERSION_CACHE SONIC_VERSION_CACHE_SOURCE | ||
$(shell test -d $(SONIC_VERSION_CACHE_SOURCE) || \ | ||
mkdir -p $(SONIC_VERSION_CACHE_SOURCE) && chmod -f 777 $(SONIC_VERSION_CACHE_SOURCE) 2>/dev/null ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find error log in the PR validation.
mkdir: cannot create directory '/vcache/sonic-slave-bullseye': Permission denied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a merge issue. Fixed it.
[ FAIL LOG END ] [ target/python-wheels/buster/scapy-2.4.5-py2.py3-none-any.whl ] |
Makefile.cache
Outdated
@@ -71,6 +71,8 @@ SONIC_COMMON_FLAGS_LIST := $(CONFIGURED_PLATFORM) \ | |||
$(CONFIGURED_ARCH) \ | |||
$(BLDENV) \ | |||
$(SONIC_DEBUGGING_ON) \ | |||
$(SONIC_VERSION_CONTROL_COMPONENTS) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makefile.cache runs before pip/apt-get. If source code and dependencies not changed, it will copy package from local path. This feature shouldn't change Makefile.cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it.
Makefile.work
Outdated
@@ -294,26 +314,61 @@ endif | |||
|
|||
endif | |||
|
|||
DOCKER_BASE_BUILD = docker build --no-cache \ | |||
DOCKER_AUTH:=docker login -u sonicbrcm -p 4b5d1f28-6f43-41da-a794-88805ee8fc2d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not safe to push to github.
And why we should login to dockerhub using special account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added for the local build, accidentally it got merged into PR code. Just removed it.
89d4361
to
e194e41
Compare
This pull request introduces 1 alert when merging e194e412f0d30751f756e6068fde0872fb6bca38 into 71a515e - view on LGTM.com new alerts:
|
e194e41
to
3027bce
Compare
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
45ef6a2
to
900eb92
Compare
This pull request introduces 1 alert when merging 900eb928251f4bf633b9d87bc4c3c6d26d616810 into b313563 - view on LGTM.com new alerts:
|
build failure blocks the merge. |
During the SONiC build, it downloads and installs packages for multiple build components which includes debian packages, pip modules, python packages, source code packages, git modules and docker images. The package versioning feature provides an infrastructure to select and freeze a particular version of a package. The package version caching feature provides an infrastructure to cache the package with the given version into a local storage, so that subsequent installation will not download from web instead it will load from local cache path. The following variable controls the verion caching feature. By default it is truned off. SONIC_VERSION_CACHE_METHOD = [none/cache] SONIC_VERSION_CACHE_SOURCE = /path/to/local/storage
900eb92
to
f2da2aa
Compare
|
This pull request introduces 1 alert when merging f2da2aa into 45ded68 - view on LGTM.com new alerts:
|
It is better to split this big PR into several little PRs.
|
I agree that it would be better to handle the PR for each functionality. But it is very difficult to split them into multiple PRs as it's all interdependent with each other on the caching framework. It would be easy for tracking and testing the complete framework if it is a single PR. Do you really want to split them into multiple? |
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
I suggest keeping original branch and split them. |
@xumia , please help review. |
As requested, I will try to split into multiple PRs and raise a separate list of PRs. |
Is the PR splitted? Can you please update the HLD PR with the new code PRs listed? @Kalimuthu-Velappan |
Updated the code PR list in the HLD PR.
sonic-net/SONiC#941
…On Thu, Dec 8, 2022 at 4:32 AM Yanzhao Zhang ***@***.***> wrote:
Is the PR splitted? Can you please update the HLD PR with the new code PRs
listed? @Kalimuthu-Velappan <https://github.com/Kalimuthu-Velappan>
—
Reply to this email directly, view it on GitHub
<#10613 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM2UC2UBFCAPAVLMV74KMODWMEJQJANCNFSM5TYSYRQQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
|
Support for package version caching
During the SONiC build, it downloads and installs packages for
multiple build components which includes debian packages, pip modules,
python packages, source code packages, git modules and docker images.
The package versioning feature provides an infrastructure to select
and freeze a particular version of a package.
The package version caching feature provides an infrastructure to cache
the package with the given version into a local storage, so that
subsequent installation will not download from web instead it will load
from local cache path.
The following variable controls the verion caching feature. By default
it is truned off.
SONIC_VERSION_CACHE_METHOD = [none/cache]
SONIC_VERSION_CACHE_SOURCE = /path/to/local/storage
Why I did it
How I did it
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)