Skip to content

Commit fde2d68

Browse files
Merge branch 'master' into refactor_dell_sfp
2 parents 19e4b49 + b8eb9f2 commit fde2d68

File tree

540 files changed

+18778
-11738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+18778
-11738
lines changed

.azure-pipelines/azure-pipelines-image-template.yml

+2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ jobs:
5050
postSteps:
5151
- script: cp target -r $(Build.ArtifactStagingDirectory)/
5252
displayName: Copy Artifacts
53+
condition: always()
5354
- publish: $(Build.ArtifactStagingDirectory)
55+
condition: always()
5456
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
5557
displayName: "Archive sonic image"
5658
- ${{ parameters.postSteps }}

.azure-pipelines/azure-pipelines-job-groups.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ parameters:
1919
default: ''
2020
- name: 'timeoutInMinutes'
2121
type: 'number'
22-
default: 720
22+
default: 900
2323
- name: 'jobFilters'
2424
type: object
2525
default: ''
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Starter pipeline
2+
# Start with a minimal pipeline that you can customize to build and deploy your code.
3+
# Add steps that build, run tests, deploy, and more:
4+
# https://aka.ms/yaml
5+
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64
6+
7+
schedules:
8+
- cron: "0 8 * * *"
9+
branches:
10+
include:
11+
- master
12+
- 202012
13+
always: true
14+
15+
trigger: none
16+
pr:
17+
branches:
18+
include:
19+
- master
20+
paths:
21+
include:
22+
- sonic-slave-jessie
23+
- sonic-slave-stretch
24+
- sonic-slave-buster
25+
- sonic-slave-bullseye
26+
27+
parameters:
28+
- name: 'dists'
29+
type: object
30+
default:
31+
- bullseye
32+
- buster
33+
- stretch
34+
35+
stages:
36+
- stage: Build
37+
jobs:
38+
- ${{ each dist in parameters.dists }}:
39+
- ${{ if contains(variables['Build.DefinitionName'], dist) }}:
40+
- template: docker-sonic-slave-template.yml
41+
parameters:
42+
pool: sonicbld-arm64
43+
arch: arm64
44+
dist: ${{ dist }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Starter pipeline
2+
# Start with a minimal pipeline that you can customize to build and deploy your code.
3+
# Add steps that build, run tests, deploy, and more:
4+
# https://aka.ms/yaml
5+
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64
6+
7+
schedules:
8+
- cron: "0 8 * * *"
9+
branches:
10+
include:
11+
- master
12+
- 202012
13+
always: true
14+
15+
trigger: none
16+
pr:
17+
branches:
18+
include:
19+
- master
20+
paths:
21+
include:
22+
- sonic-slave-jessie
23+
- sonic-slave-stretch
24+
- sonic-slave-buster
25+
- sonic-slave-bullseye
26+
27+
parameters:
28+
- name: 'dists'
29+
type: object
30+
default:
31+
- bullseye
32+
- buster
33+
- stretch
34+
35+
stages:
36+
- stage: Build
37+
jobs:
38+
- ${{ each dist in parameters.dists }}:
39+
- ${{ if contains(variables['Build.DefinitionName'], dist) }}:
40+
- template: docker-sonic-slave-template.yml
41+
parameters:
42+
pool: sonicbld-armhf
43+
arch: armhf
44+
dist: ${{ dist }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Starter pipeline
2+
# Start with a minimal pipeline that you can customize to build and deploy your code.
3+
# Add steps that build, run tests, deploy, and more:
4+
# https://aka.ms/yaml
5+
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64
6+
7+
parameters:
8+
- name: arch
9+
type: string
10+
values:
11+
- amd64
12+
- armhf
13+
- arm64
14+
- name: dist
15+
type: string
16+
values:
17+
- bullseye
18+
- buster
19+
- stretch
20+
- jessie
21+
- name: registry_url
22+
type: string
23+
default: sonicdev-microsoft.azurecr.io
24+
- name: registry_conn
25+
type: string
26+
default: sonicdev
27+
- name: pool
28+
type: string
29+
default: sonicbld
30+
values:
31+
- sonicbld
32+
- sonicbld-arm64
33+
- sonicbld-armhf
34+
35+
jobs:
36+
- job: Build_${{ parameters.dist }}_${{ parameters.arch }}
37+
timeoutInMinutes: 360
38+
pool: ${{ parameters.pool }}
39+
steps:
40+
- template: cleanup.yml
41+
- checkout: self
42+
clean: true
43+
submodules: recursive
44+
- bash: |
45+
set -ex
46+
47+
SLAVE_DIR=sonic-slave-${{ parameters.dist }}
48+
if [ x${{ parameters.pool }} == x"sonicbld" ]; then
49+
if [ x${{ parameters.arch }} == x"amd64" ]; then
50+
SLAVE_BASE_IMAGE=${SLAVE_DIR}
51+
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}
52+
elif [ x${{ parameters.pool }} == x"sonicbld" ]; then
53+
SLAVE_BASE_IMAGE=${SLAVE_DIR}-march-${{ parameters.arch }}
54+
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-march-${{ parameters.arch }}
55+
fi
56+
elif [[ x${{ parameters.pool }} == x"sonicbld-armhf" && x${{ parameters.arch }} == x"armhf" ]]; then
57+
SLAVE_BASE_IMAGE=${SLAVE_DIR}
58+
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-armhf
59+
elif [[ x${{ parameters.pool }} == x"sonicbld-arm64" && x${{ parameters.arch }} == x"arm64" ]]; then
60+
SLAVE_BASE_IMAGE=${SLAVE_DIR}
61+
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-arm64
62+
else
63+
echo "do not support build ${{ parameters.arch }} on ${{ parameters.pool }}"
64+
exit 1
65+
fi
66+
67+
if [ x"$(Build.SourceBranchName)" == x"202012" ]; then
68+
BUILD_OPTIONS = 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
69+
fi
70+
71+
containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }')
72+
if [ ! -z "$containers" ]; then
73+
docker container kill $containers || true
74+
sleep 5
75+
fi
76+
images=$(docker images 'sonic-slave-*' -a -q)
77+
if [ ! -z "$images" ]; then
78+
docker rmi -f $images
79+
fi
80+
81+
tmpfile=$(mktemp)
82+
83+
echo ${{ parameters.arch }} > .arch
84+
85+
DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker BLDENV=${{ parameters.dist }} $(BUILD_OPTIONS) make -f Makefile.work sonic-slave-build | tee $tmpfile
86+
SLAVE_BASE_TAG=$(grep "^Checking sonic-slave-base image:" $tmpfile | awk -F ':' '{print $3}')
87+
SLAVE_TAG=$(grep "^Checking sonic-slave image:" $tmpfile | awk -F ':' '{print $3}')
88+
89+
mkdir -p target
90+
91+
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:latest
92+
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:$SLAVE_BASE_TAG
93+
set +x
94+
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_IMAGE]$SLAVE_BASE_IMAGE_UPLOAD"
95+
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_TAG]$SLAVE_BASE_TAG"
96+
env:
97+
REGISTRY_SERVER: ${{ parameters.registry_url }}
98+
displayName: Build sonic-slave-${{ parameters.dist }}-${{ parameters.arch }}
99+
100+
- task: Docker@2
101+
displayName: Upload image
102+
inputs:
103+
containerRegistry: ${{ parameters.registry_conn }}
104+
repository: $(VARIABLE_SLAVE_BASE_IMAGE)
105+
command: push
106+
tags: |
107+
$(VARIABLE_SLAVE_BASE_TAG)
108+
latest

.azure-pipelines/docker-sonic-slave.yml

+5-61
Original file line numberDiff line numberDiff line change
@@ -45,70 +45,14 @@ parameters:
4545
type: string
4646
default: sonicdev
4747

48-
variables:
49-
- ${{ if eq(variables['Build.SourceBranchName'], '202012') }}:
50-
- name: BUILD_OPTIONS
51-
value: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
52-
5348
stages:
5449
- stage: Build
5550
jobs:
5651
- ${{ each dist in parameters.dists }}:
5752
- ${{ if endswith(variables['Build.DefinitionName'], dist) }}:
5853
- ${{ each arch in parameters.arches }}:
59-
- job: Build_${{ dist }}_${{ arch }}
60-
timeoutInMinutes: 360
61-
pool: sonicbld
62-
steps:
63-
- template: cleanup.yml
64-
- checkout: self
65-
clean: true
66-
submodules: recursive
67-
- bash: |
68-
set -ex
69-
70-
containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }')
71-
if [ ! -z "$containers" ]; then
72-
docker container kill $containers || true
73-
sleep 5
74-
fi
75-
images=$(docker images 'sonic-slave-*' -a -q)
76-
if [ ! -z "$images" ]; then
77-
docker rmi -f $images
78-
fi
79-
80-
SLAVE_DIR=sonic-slave-${{ dist }}
81-
if [ x${{ arch }} == x"amd64" ]; then
82-
SLAVE_BASE_IMAGE=${SLAVE_DIR}
83-
else
84-
SLAVE_BASE_IMAGE=${SLAVE_DIR}-march-${{ arch }}
85-
fi
86-
87-
tmpfile=$(mktemp)
88-
89-
echo ${{ arch }} > .arch
90-
91-
DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker BLDENV=${{ dist }} $(BUILD_OPTIONS) make -f Makefile.work sonic-slave-build | tee $tmpfile
92-
SLAVE_BASE_TAG=$(grep "^Checking sonic-slave-base image:" $tmpfile | awk -F ':' '{print $3}')
93-
SLAVE_TAG=$(grep "^Checking sonic-slave image:" $tmpfile | awk -F ':' '{print $3}')
94-
95-
mkdir -p target
96-
97-
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE:latest
98-
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG
99-
set +x
100-
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_IMAGE]$SLAVE_BASE_IMAGE"
101-
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_TAG]$SLAVE_BASE_TAG"
102-
env:
103-
REGISTRY_SERVER: ${{ parameters.registry_url }}
104-
displayName: Build sonic-slave-${{ dist }}-${{ arch }}
105-
106-
- task: Docker@2
107-
displayName: Upload image
108-
inputs:
109-
containerRegistry: ${{ parameters.registry_conn }}
110-
repository: $(VARIABLE_SLAVE_BASE_IMAGE)
111-
command: push
112-
tags: |
113-
$(VARIABLE_SLAVE_BASE_TAG)
114-
latest
54+
- template: docker-sonic-slave-template.yml
55+
parameters:
56+
pool: sonicbld
57+
arch: ${{ arch }}
58+
dist: ${{ dist }}

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
NOJESSIE ?= 1
44
NOSTRETCH ?= 0
55
NOBUSTER ?= 0
6-
NOBULLSEYE ?= 1
6+
NOBULLSEYE ?= 0
77

88
ifeq ($(NOJESSIE),0)
99
BUILD_JESSIE=1
@@ -35,7 +35,7 @@ ifeq ($(NOSTRETCH), 0)
3535
EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=stretch make -f Makefile.work stretch
3636
endif
3737
ifeq ($(NOBUSTER), 0)
38-
BLDENV=buster make -f Makefile.work $@
38+
EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=buster make -f Makefile.work buster
3939
endif
4040
ifeq ($(NOBULLSEYE), 0)
4141
BLDENV=bullseye make -f Makefile.work $@

Makefile.cache

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ SONIC_COMMON_DPKG_LIST := debian/control debian/changelog debian/rules \
7474
debian/compat debian/install debian/copyright
7575
SONIC_COMMON_BASE_FILES_LIST := sonic-slave-jessie/Dockerfile.j2 sonic-slave-jessie/Dockerfile.user.j2 \
7676
sonic-slave-stretch/Dockerfile.j2 sonic-slave-stretch/Dockerfile.user.j2 \
77-
sonic-slave-buster/Dockerfile.j2 sonic-slave-buster/Dockerfile.user.j2
77+
sonic-slave-buster/Dockerfile.j2 sonic-slave-buster/Dockerfile.user.j2 \
78+
sonic-slave-bullseye/Dockerfile.j2 sonic-slave-bullseye/Dockerfile.user.j2
7879

7980

8081

0 commit comments

Comments
 (0)