-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Support j2 template for debian sources #12557
Conversation
989b275
to
dc38589
Compare
files/apt/sources.list.j2
Outdated
{% if DISTRIBUTION == 'stretch' %} | ||
deb {{ mirror_url }} {{ DISTRIBUTION }}/updates main contrib non-free | ||
deb-src {{ mirror_url }} {{ DISTRIBUTION }}/updates main contrib non-free | ||
{% else %} | ||
deb {{ mirror_url }} {{ DISTRIBUTION }}-security main contrib non-free | ||
deb-src {{ mirror_url }} {{ DISTRIBUTION }}-security main contrib non-free | ||
{% endif %} |
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.
Format was changed in bullseye: https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#security-archive
Buster also has format {{ DISTRIBUTION }}/updates for security mirrors.
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.
@kv-y , fixed, thanks for you comment.
scripts/build_mirror_config.sh
Outdated
TEMPALTE=files/apt/sources.list.j2 | ||
[ -f files/apt/sources.list.$ARCHITECTURE.j2 ] && TEMPALTE=files/apt/sources.list.$ARCHITECTURE.j2 | ||
[ -f $CONFIG_PATH/sources.list.j2 ] && TEMPALTE=$CONFIG_PATH/sources.list.j2 | ||
[ -f $CONFIG_PATH/sources.list.$ARCHITECTURE.j2 ] && TEMPALTE=$CONFIG_PATH/sources.list.$ARCHITECTURE.j2 | ||
|
||
j2 $TEMPALTE > $CONFIG_PATH/sources.list.$ARCHITECTURE |
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.
TEMPALTE
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, thanks.
scripts/build_mirror_config.sh
Outdated
DEFAULT_MIRROR_URLS=http://debian-archive.trafficmanager.net/debian/,http://cdn1.packages.trafficmanager.net/snapshot/debian/latest/ | ||
DEFAULT_MIRROR_SECURITY_URLS=http://debian-archive.trafficmanager.net/debian-security/,http://cdn1.packages.trafficmanager.net/snapshot/debian-security/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.
Need fix for repr build?
Now REPR_MIRROR_URL_PATTERN='http://packages.trafficmanager.net/debian'
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, we need to support repr build, fixed, thanks.
9eb8215
to
d436286
Compare
@kv-y , do you have any more comments? |
@qiluo-msft , could you please help review it? Thanks. |
Could you please retest a customization of Debian mirrors?
I got correct sources.lists for sonic-slaves. I think you forgot to pass these variables from Makefile.work to slave.mk. |
scripts/build_mirror_config.sh
Outdated
# The debian-archive.trafficmanager.net does not support armhf, use debian.org instead | ||
if [ "$ARCHITECTURE" == "armhf" ]; then | ||
DEFAULT_MIRROR_URLS=http://deb.debian.org/debian/,http://packages.trafficmanager.net/debian/debian/ | ||
DEFAULT_MIRROR_SECURITY_URLS=http://security.debian.org/,http://packages.trafficmanager.net/debian/debian-security/ |
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 think we can use here http://deb.debian.org/debian-security/ instead of http://security.debian.org/ for unification.
There are multiple variants:
security.debian.org
security.debian.org/debian-security
deb.debian.org/debian-security
and all work.
Related question: https://unix.stackexchange.com/questions/387006/sources-list-repository-url-for-debian-security-updates-with-or-without-debian
Documentation recommends to use deb.debian.org/debian-security or security.debian.org/debian-security.
Official debian docker images use deb.debian.org/debian-security since buster.
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, "deb.debian.org/debian-security" is better than "security.debian.org".
Using the URLs as below:
http://deb.debian.org/debian/
http://deb.debian.org/debian-security/
Also I tried to test repr build with this patch, but seem like repr build is broken for master. |
Fixed, thanks, missing to pass the variables. |
The repr only works on the release branches, such as 202012, 202111, 202205, etc, not on master branch today, but we have a plan to support it. |
d2d798f
to
50eebf4
Compare
…hanged (#12702) Why I did it After #12557 sources.lists are generated. So we need to recalculate SLAVE_BASE_TAG if mirrors were changed. Also we need to rebuild DPKG cache in this case. How I did it Use generated sources.list for SLAVE_BASE_TAG Add MIRROR_URLS and MIRROR_SECURITY_URLS to SONIC_COMMON_FLAGS_LIST
…hanged (sonic-net#12702) Why I did it After sonic-net#12557 sources.lists are generated. So we need to recalculate SLAVE_BASE_TAG if mirrors were changed. Also we need to rebuild DPKG cache in this case. How I did it Use generated sources.list for SLAVE_BASE_TAG Add MIRROR_URLS and MIRROR_SECURITY_URLS to SONIC_COMMON_FLAGS_LIST
Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: #12523 How I did it How to verify it
Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: sonic-net#12523
Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: sonic-net#12523
commit 69f74304e2c848d4ca4c7767c7b0b228f5351de6 Author: xumia <59720581+xumia@users.noreply.github.com> Date: Wed Nov 9 08:09:53 2022 +0800 [Build] Support j2 template for debian sources (sonic-net#12557) Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: sonic-net#12523
Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: sonic-net#12523
commit 69f74304e2c848d4ca4c7767c7b0b228f5351de6 Author: xumia <59720581+xumia@users.noreply.github.com> Date: Wed Nov 9 08:09:53 2022 +0800 [Build] Support j2 template for debian sources (sonic-net#12557) Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: sonic-net#12523
Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: sonic-net#12523
…lity (#14663) Why I did it Cherry-pick commits from master to support the snapshot based mirror, and fix the code conflicts. ad162ae [Build] Optimize the version control for Debian packages (#14557) 38c5d7f [Build] Support j2 template for debian sources for docker ptf (#13198) 5e4826e [Ci] Support to use the same snapshot for all platform builds (#13913) 8206925 [Build] Change the default mirror version config file (#13786) 5e4a866 [Build] Support Debian snapshot mirror to improve build stability (#13097) ac5d89c [Build] Support j2 template for debian sources (#12557) Work item tracking Microsoft ADO (number only): 18018114 How I did it How to verify it
…lity (#14664) Why I did it Cherry-pick commits from master to support the snapshot based mirror, and fix the code conflicts. ad162ae [Build] Optimize the version control for Debian packages (#14557) 38c5d7f [Build] Support j2 template for debian sources for docker ptf (#13198) 5e4826e [Ci] Support to use the same snapshot for all platform builds (#13913) 8206925 [Build] Change the default mirror version config file (#13786) 5e4a866 [Build] Support Debian snapshot mirror to improve build stability (#13097) ac5d89c [Build] Support j2 template for debian sources (#12557) Work item tracking Microsoft ADO (number only): 18018114 How I did it How to verify it
Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: sonic-net#12523
Why I did it Unify the Debian mirror sources Make easy to upgrade to the next Debian release, not source url code change required. Support to customize the Debian mirror sources during the build Relative issue: sonic-net#12523
…lity (#14558) #### Why I did it Cherry-pick commits from master to support the snapshot based mirror, and fix the code conflicts. And add the last commit to fix the build broken issue according to the mirror change. ad162ae [Build] Optimize the version control for Debian packages (#14557) 38c5d7f [Build] Support j2 template for debian sources for docker ptf (#13198) 5e4826e [Ci] Support to use the same snapshot for all platform builds (#13913) 8206925 [Build] Change the default mirror version config file (#13786) 5e4a866 [Build] Support Debian snapshot mirror to improve build stability (#13097) ac5d89c [Build] Support j2 template for debian sources (#12557)
Why I did it
Relative issue: #12523
How I did it
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. 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)