Skip to content

Commit b83d0ed

Browse files
[ci] Fix slave docker build cache pipeline. (#24240)
Why I did it sonic slave docker keeps failing: LINK The pipeline works to prebuild slave docker. It will reduce build time in PR build. Work item tracking Microsoft ADO (number only): 35511752 How I did it How to verify it pipeline link signed-off-by: [email protected]
1 parent 612dedc commit b83d0ed

File tree

3 files changed

+13
-35
lines changed

3 files changed

+13
-35
lines changed

.azure-pipelines/build-template.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ parameters:
3636
type: string
3737
values:
3838
- sonicso1ES-amd64
39-
- sonicbld_8c
39+
- sonicso1ES-arm64
40+
- sonicso1ES-armhf
4041
default: sonicso1ES-amd64
4142

4243
- name: dbg_image

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ parameters:
1010
- amd64
1111
- armhf
1212
- arm64
13-
- name: march
14-
type: string
15-
default: ''
1613
- name: dist
1714
type: string
1815
values:
@@ -37,15 +34,15 @@ parameters:
3734
- sonicso1ES-armhf
3835

3936
jobs:
40-
- job: sonic_slave_${{ parameters.dist }}${{ parameters.march }}
37+
- job: sonic_slave_${{ parameters.dist }}_${{ parameters.arch }}
4138
timeoutInMinutes: 360
4239
variables:
43-
- template: /.azure-pipelines/template-variables.yml@buildimage
44-
- template: /.azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage
40+
- template: template-variables.yml
41+
- template: azure-pipelines-repd-build-variables.yml
4542
pool: ${{ parameters.pool }}
4643
steps:
4744
- template: cleanup.yml
48-
- template: /.azure-pipelines/template-clean-sonic-slave.yml@buildimage
45+
- template: template-clean-sonic-slave.yml
4946
- checkout: self
5047
clean: true
5148
- task: Docker@2
@@ -68,7 +65,7 @@ jobs:
6865
exit 0
6966
fi
7067
71-
DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker BLDENV=${{ parameters.dist }} make -f Makefile.work configure $build_options PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} $args || docker image ls $image_tag
68+
BLDENV=${{ parameters.dist }} make -f Makefile.work configure $build_options PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} || docker image ls $image_tag
7269
if [[ "$(Build.Reason)" == "PullRequest" ]];then
7370
exit 0
7471
fi

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

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
# Add steps that build, run tests, deploy, and more:
44
# https://aka.ms/yaml
55
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64
6-
resources:
7-
repositories:
8-
- repository: buildimage
9-
type: github
10-
name: sonic-net/sonic-buildimage
11-
ref: master
12-
endpoint: sonic-net
13-
146
schedules:
157
- cron: "0 0 * * 0"
168
displayName: Weekly build
@@ -57,25 +49,13 @@ parameters:
5749
default: sonicdev
5850

5951
stages:
60-
- stage: Build_in_amd64
61-
jobs:
62-
- ${{ each dist in parameters.dists }}:
63-
- ${{ if endswith(variables['Build.DefinitionName'], dist) }}:
64-
- template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage
65-
parameters:
66-
pool: sonicso1ES-amd64
67-
arch: amd64
68-
dist: ${{ dist }}
69-
- stage: Build_native_arm
70-
dependsOn: []
52+
- stage: Build
7153
jobs:
7254
- ${{ each dist in parameters.dists }}:
7355
- ${{ if endswith(variables['Build.DefinitionName'], dist) }}:
7456
- ${{ each arch in parameters.arches }}:
75-
- ${{ if ne(arch, 'amd64') }}:
76-
- template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage
77-
parameters:
78-
pool: sonicbld-${{ arch }}
79-
arch: ${{ arch }}
80-
dist: ${{ dist }}
81-
march: _${{ arch }}
57+
- template: docker-sonic-slave-template.yml
58+
parameters:
59+
pool: sonicso1ES-${{ arch }}
60+
arch: ${{ arch }}
61+
dist: ${{ dist }}

0 commit comments

Comments
 (0)