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]: Cherry pick PRs from master to 202106 branch #10590

Merged
merged 4 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .azure-pipelines/azure-pipelines-UpgrateVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ schedules:
displayName: Daily Build
branches:
include:
- 202012
- 20????
exclude:
- 200???
- 201???
- 202006
always: true

resources:
Expand Down
5 changes: 5 additions & 0 deletions .azure-pipelines/azure-pipelines-repd-build-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
variables:
${{ if and(ge(variables['Build.SourceBranchName'], '202012'), le(variables['Build.SourceBranchName'], '299999')) }}:
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
${{ if or(lt(variables['Build.SourceBranchName'], '202012'), gt(variables['Build.SourceBranchName'], '299999')) }}:
VERSION_CONTROL_OPTIONS: ''
1 change: 1 addition & 0 deletions .azure-pipelines/docker-sonic-slave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pr:
- sonic-slave-jessie
- sonic-slave-stretch
- sonic-slave-buster
- src/sonic-build-hooks

parameters:
- name: 'arches'
Expand Down
4 changes: 3 additions & 1 deletion .azure-pipelines/official-build-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ stages:
- stage: Build
pool: sonicbld
variables:
CACHE_MODE: cache
- name: CACHE_MODE
value: cache
- template: azure-pipelines-repd-build-variables.yml
jobs:
- template: azure-pipelines-build.yml
parameters:
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ stages:
- stage: Build
pool: sonicbld
variables:
CACHE_MODE: wcache
${{ if eq(variables['Build.SourceBranchName'], '202012') }}:
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
- name: CACHE_MODE
value: wcache
- template: azure-pipelines-repd-build-variables.yml
jobs:
- template: azure-pipelines-build.yml
parameters:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
- reopened
branches:
- '202012'
- '202[1-9][0-9][0-9]'
- '20[3-9][0-9][0-9][0-9]'
paths:
- 'files/build/versions/**'

Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ stages:
- stage: Build
pool: sonicbld
variables:
CACHE_MODE: rcache
${{ if eq(variables['Build.SourceBranchName'], '202012') }}:
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml
- name: CACHE_MODE
value: rcache
jobs:
- template: .azure-pipelines/azure-pipelines-build.yml
parameters:
Expand Down
6 changes: 5 additions & 1 deletion src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ set_reproducible_mirrors()
expression="s/^deb.*$REPR_MIRROR_URL_PATTERN/#\0/"
fi

local mirrors="/etc/apt/sources.list $(ls /etc/apt/sources.list.d/)"
local mirrors="/etc/apt/sources.list $(find /etc/apt/sources.list.d/ -type f)"
for mirror in $mirrors; do
sed -i "$expression" "$mirror"
done
Expand Down Expand Up @@ -163,6 +163,10 @@ run_pip_command()
elif [[ "$para" == *.whl ]]; then
package_name=$(echo $para | cut -d- -f1 | tr _ .)
sed "/^${package_name}==/d" -i $tmp_version_file
elif [[ "$para" == *==* ]]; then
# fix pip package constraint conflict issue
package_name=$(echo $para | cut -d= -f1)
sed "/^${package_name}==/d" -i $tmp_version_file
fi
done

Expand Down
8 changes: 6 additions & 2 deletions src/sonic-build-hooks/scripts/collect_version_files
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ dpkg-query -W -f '${Package}==${Version}\n' >> "${TARGET_PATH}/versions-deb-${DI

## Print the unique and sorted result
sort -u "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}"
sort -u "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}"
sort -u "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}"
if [ -e "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" ]; then
sort -u "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}"
fi
if [ -e "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" ]; then
sort -u "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}"
fi

exit 0