Skip to content

Commit 494347d

Browse files
author
Roman Savchuk
committed
Merge branch 'master' of github.com:SavchukRomanLv/sonic-buildimage into rsavchuk/update_bfn_sdk_sai_1_10_2
2 parents e07b746 + 0eeb249 commit 494347d

File tree

27 files changed

+299
-135
lines changed

27 files changed

+299
-135
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
4949
displayName: 'Make configure'
5050
postSteps:
51-
- script: cp target -r $(Build.ArtifactStagingDirectory)/
51+
- script: mv target $(Build.ArtifactStagingDirectory)/
5252
displayName: Copy Artifacts
5353
condition: always()
5454
- publish: $(Build.ArtifactStagingDirectory)
@@ -58,6 +58,10 @@ jobs:
5858
condition: failed()
5959
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)$(System.JobAttempt)'
6060
displayName: "Archive failed sonic image"
61+
- template: trigger-publish-artifacts-build.yml
62+
parameters:
63+
artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
64+
publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)'
6165
- ${{ parameters.postSteps }}
6266
- template: cleanup.yml
6367
jobGroups: ${{ parameters.jobGroups }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# The steps to trigger the pipeline to publish the artifacts
2+
3+
parameters:
4+
- name: artifactName
5+
type: string
6+
default: ""
7+
- name: publishPrefix
8+
type: string
9+
default: "$(Build.DefinitionName)/$(Build.SourceBranchName)"
10+
11+
steps:
12+
- script: |
13+
. functions.sh
14+
sonic_version=$(sonic_get_version)
15+
latest_tag=$(git describe --tags --abbrev=0)
16+
docker_tags="$sonic_version $(Build.SourceBranchName)"
17+
if [ "$(Build.SourceBranchName)" == "master" ]; then
18+
docker_tags="$docker_tags latest"
19+
fi
20+
echo "##vso[task.setvariable variable=sonic_version]$sonic_version"
21+
echo "##vso[task.setvariable variable=latest_tag]$latest_tag"
22+
echo "##vso[task.setvariable variable=docker_tags]$docker_tags"
23+
condition: ne(variables['Build.Reason'], 'PullRequest')
24+
displayName: 'Set trigger build variables'
25+
- task: TriggerBuild@4
26+
condition: ne(variables['Build.Reason'], 'PullRequest')
27+
inputs:
28+
definitionIsInCurrentTeamProject: false
29+
teamProject: internal
30+
tfsServer: $(System.CollectionUri)
31+
buildDefinition: 'publish-artifacts'
32+
queueBuildForUserThatTriggeredBuild: true
33+
ignoreSslCertificateErrors: false
34+
useSameSourceVersion: false
35+
useCustomSourceVersion: false
36+
useSameBranch: false
37+
waitForQueuedBuildsToFinish: false
38+
storeInEnvironmentVariable: true
39+
authenticationMethod: 'Personal Access Token'
40+
password: '$(system.accesstoken)'
41+
enableBuildInQueueCondition: false
42+
dependentOnSuccessfulBuildCondition: false
43+
dependentOnFailedBuildCondition: false
44+
checkbuildsoncurrentbranch: false
45+
failTaskIfConditionsAreNotFulfilled: false
46+
buildParameters: ''
47+
templateParameters: |
48+
pipelineContext: {"buildId":"$(Build.BuildId)",
49+
"pipelineId":"$(System.DefinitionId)",
50+
"project": "$(System.TeamProject)",
51+
"branchName":"$(Build.SourceBranchName)"},
52+
artifactContext: {"artifactName":"${{ parameters.artifactName }}",
53+
"artifactPatterns":"**/*.bin\n
54+
**/*.swi\n
55+
**/*.raw\n
56+
**/*.img.gz\n
57+
**/*-rpc.gz\n
58+
**/python-saithrift*.deb"},
59+
publishContext: {"publishPrefix":"${{ parameters.publishPrefix }}",
60+
"keepArtifactName":false,
61+
"dockerImagePatterns":"target/*-rpc.gz",
62+
"dockerTags":"$(docker_tags)",
63+
"version":"$(sonic_version)",
64+
"latestTag":"$(latest_tag)"}

device/mellanox/x86_64-mlnx_msn2700_simx-r0/platform_reboot

-21
This file was deleted.

device/mellanox/x86_64-mlnx_msn3700_simx-r0/platform_reboot

-1
This file was deleted.

device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform_reboot

-1
This file was deleted.

device/mellanox/x86_64-nvidia_sn4800_simx-r0/platform_reboot

-1
This file was deleted.

device/mellanox/x86_64-nvidia_sn5600_simx-r0/platform_reboot

-1
This file was deleted.

dockers/docker-orchagent/Dockerfile.j2

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
2-
FROM docker-swss-layer-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
2+
FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
33

44
ARG docker_container_name
55
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
@@ -26,17 +26,10 @@ RUN apt-get update && \
2626

2727
{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %}
2828
# Fix for gcc/python/iputils-ping not found in arm docker
29-
RUN apt-get install -f -y python2.7 python2.7-dev
3029
RUN apt-get install -y \
31-
gcc-8 \
30+
gcc \
3231
iputils-ping
3332
{% endif %}
34-
{% if CONFIGURED_ARCH == "armhf" %}
35-
RUN ln -s -f /usr/bin/gcc-8 /usr/bin/arm-linux-gnueabihf-gcc
36-
{% endif %}
37-
{% if CONFIGURED_ARCH == "arm64" %}
38-
RUN ln -s -f /usr/bin/gcc-8 /usr/bin/aarch64-linux-gnu-gcc
39-
{% endif %}
4033

4134
# Dependencies of restore_neighbors.py
4235
RUN pip3 install \
@@ -45,7 +38,7 @@ RUN pip3 install \
4538

4639
{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %}
4740
# Remove installed gcc
48-
RUN apt-get remove -y gcc-8
41+
RUN apt-get remove -y gcc
4942
{% endif %}
5043

5144
{% if docker_orchagent_debs.strip() -%}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
2+
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
3+
4+
## Make apt-get non-interactive
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
RUN apt-get update
8+
9+
{% if docker_swss_layer_bullseye_debs.strip() -%}
10+
# Copy locally-built Debian package dependencies
11+
{{ copy_files("debs/", docker_swss_layer_bullseye_debs.split(' '), "/debs/") }}
12+
13+
# Install locally-built Debian packages and implicitly install their dependencies
14+
{{ install_debian_packages(docker_swss_layer_bullseye_debs.split(' ')) }}
15+
{%- endif %}
16+
17+
RUN apt-get clean -y && \
18+
apt-get autoclean -y && \
19+
apt-get autoremove -y && \
20+
rm -rf /debs
21+
22+
ENTRYPOINT ["/usr/local/bin/supervisord"]

rules/docker-orchagent.mk

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ DOCKER_ORCHAGENT_DBG = $(DOCKER_ORCHAGENT_STEM)-$(DBG_IMAGE_MARK).gz
66

77
$(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS)
88

9-
$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_DEPENDS)
9+
$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS)
1010
$(DOCKER_ORCHAGENT)_DBG_DEPENDS += $(SWSS_DBG) \
1111
$(LIBSWSSCOMMON_DBG) \
1212
$(LIBSAIREDIS_DBG)
1313
$(DOCKER_ORCHAGENT)_PYTHON_WHEELS += $(SCAPY)
1414

15-
$(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_IMAGE_PACKAGES)
15+
$(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES)
1616

1717
$(DOCKER_ORCHAGENT)_PATH = $(DOCKERS_PATH)/$(DOCKER_ORCHAGENT_STEM)
1818

19-
$(DOCKER_ORCHAGENT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BUSTER)
19+
$(DOCKER_ORCHAGENT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE)
2020

2121
$(DOCKER_ORCHAGENT)_VERSION = 1.0.0
2222
$(DOCKER_ORCHAGENT)_PACKAGE_NAME = swss
@@ -39,6 +39,3 @@ $(DOCKER_ORCHAGENT)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw
3939

4040
$(DOCKER_ORCHAGENT)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
4141
$(DOCKER_ORCHAGENT)_FILES += $(ARP_UPDATE_SCRIPT) $(ARP_UPDATE_VARS_TEMPLATE) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
42-
43-
SONIC_BUSTER_DOCKERS += $(DOCKER_ORCHAGENT)
44-
SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_ORCHAGENT_DBG)

rules/docker-swss-layer-bullseye.dep

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
DPATH := $($(DOCKER_SWSS_LAYER_BULLSEYE)_PATH)
3+
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-swss-layer-bullseye.mk rules/docker-swss-layer-bullseye.dep
4+
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
5+
DEP_FILES += $(shell git ls-files $(DPATH))
6+
7+
$(DOCKER_SWSS_LAYER_BULLSEYE)_CACHE_MODE := GIT_CONTENT_SHA
8+
$(DOCKER_SWSS_LAYER_BULLSEYE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
9+
$(DOCKER_SWSS_LAYER_BULLSEYE)_DEP_FILES := $(DEP_FILES)

rules/docker-swss-layer-bullseye.mk

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# bullseye-based docker image for sonic swss layer
2+
3+
DOCKER_SWSS_LAYER_BULLSEYE= docker-swss-layer-bullseye.gz
4+
$(DOCKER_SWSS_LAYER_BULLSEYE)_PATH = $(DOCKERS_PATH)/docker-swss-layer-bullseye
5+
6+
$(DOCKER_SWSS_LAYER_BULLSEYE)_DEPENDS += $(SWSS)
7+
$(DOCKER_SWSS_LAYER_BULLSEYE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE)
8+
9+
$(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) \
10+
$(SWSS)
11+
$(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES)
12+
13+
SONIC_DOCKER_IMAGES += $(DOCKER_SWSS_LAYER_BULLSEYE)
14+
SONIC_BULLSEYE_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE)

src/sonic-config-engine/tests/common_utils.py

+50-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
import os
44
import re
55
import sys
6+
import subprocess
7+
import argparse
8+
import shlex
69

710
PY3x = sys.version_info >= (3, 0)
811
PYvX_DIR = "py3" if PY3x else "py2"
912
PYTHON_INTERPRETTER = "python3" if PY3x else "python2"
13+
YANG_MODELS_DIR = "/usr/local/yang-models"
1014

1115
def tuple_to_str(tuplestr):
1216
""" Convert Python tuple '('elem1', 'elem2')' representation into string on the for "elem1|elem2" """
@@ -33,6 +37,52 @@ def liststr_to_dict(liststr):
3337

3438
return list_obj
3539

40+
class YangWrapper(object):
41+
def __init__(self, path=YANG_MODELS_DIR):
42+
"""
43+
sonic_yang only supports python3
44+
"""
45+
if PY3x:
46+
import sonic_yang
47+
self.yang_parser = sonic_yang.SonicYang(path)
48+
self.yang_parser.loadYangModel()
49+
self.test_dir = os.path.dirname(os.path.realpath(__file__))
50+
self.script_file = PYTHON_INTERPRETTER + ' ' + os.path.join(self.test_dir, '..', 'sonic-cfggen')
51+
52+
def validate(self, argument):
53+
"""
54+
Raise exception when yang validation failed
55+
"""
56+
if PY3x and "-m" in argument:
57+
import sonic_yang
58+
parser=argparse.ArgumentParser(description="Render configuration file from minigraph data and jinja2 template.")
59+
parser.add_argument("-m", "--minigraph", help="minigraph xml file", nargs='?', const='/etc/sonic/minigraph.xml')
60+
parser.add_argument("-k", "--hwsku", help="HwSKU")
61+
parser.add_argument("-n", "--namespace", help="namespace name", nargs='?', const=None, default=None)
62+
parser.add_argument("-p", "--port-config", help="port config file, used with -m or -k", nargs='?', const=None)
63+
parser.add_argument("-S", "--hwsku-config", help="hwsku config file, used with -p and -m or -k", nargs='?', const=None)
64+
args, unknown = parser.parse_known_args(shlex.split(argument))
65+
66+
print('\n Validating yang schema')
67+
cmd = self.script_file + ' -m ' + args.minigraph
68+
if args.hwsku is not None:
69+
cmd += ' -k ' + args.hwsku
70+
if args.hwsku_config is not None:
71+
cmd += ' -S ' + args.hwsku_config
72+
if args.port_config is not None:
73+
cmd += ' -p ' + args.port_config
74+
if args.namespace is not None:
75+
cmd += ' -n ' + args.namespace
76+
cmd += ' --print-data'
77+
output = subprocess.check_output(cmd, shell=True).decode()
78+
try:
79+
self.yang_parser.loadData(configdbJson=json.loads(output))
80+
self.yang_parser.validate_data_tree()
81+
except sonic_yang.SonicYangException as e:
82+
print("yang data generated from %s is not valid: %s"%(args.minigraph, str(e)))
83+
return False
84+
return True
85+
3686
def cmp(file1, file2):
3787
""" compare files """
3888
try:
@@ -43,4 +93,3 @@ def cmp(file1, file2):
4393
return obj1 == obj2
4494
except:
4595
return filecmp.cmp(file1, file2)
46-

src/sonic-config-engine/tests/sample-graph-resource-type.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
<Hostname>switch-t0</Hostname>
177177
<PortChannelInterfaces>
178178
<PortChannel>
179-
<Name>PortChannel01</Name>
179+
<Name>PortChannel1</Name>
180180
<AttachTo>fortyGigE0/4</AttachTo>
181181
<SubInterface/>
182182
</PortChannel>
@@ -228,12 +228,12 @@
228228
<IPInterfaces>
229229
<IPInterface>
230230
<Name i:nil="true"/>
231-
<AttachTo>PortChannel01</AttachTo>
231+
<AttachTo>PortChannel1</AttachTo>
232232
<Prefix>10.0.0.56/31</Prefix>
233233
</IPInterface>
234234
<IPInterface>
235235
<Name i:Name="true"/>
236-
<AttachTo>PortChannel01</AttachTo>
236+
<AttachTo>PortChannel1</AttachTo>
237237
<Prefix>FC00::71/126</Prefix>
238238
</IPInterface>
239239
<IPInterface>
@@ -265,7 +265,7 @@
265265
<DataAcls/>
266266
<AclInterfaces>
267267
<AclInterface>
268-
<AttachTo>PortChannel01</AttachTo>
268+
<AttachTo>PortChannel1</AttachTo>
269269
<InAcl>DataAcl</InAcl>
270270
<Type>DataPlane</Type>
271271
</AclInterface>

src/sonic-config-engine/tests/sample-graph-subintf.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
<Hostname>switch-t0</Hostname>
177177
<PortChannelInterfaces>
178178
<PortChannel>
179-
<Name>PortChannel01</Name>
179+
<Name>PortChannel1</Name>
180180
<AttachTo>fortyGigE0/4</AttachTo>
181181
<SubInterface/>
182182
</PortChannel>
@@ -245,12 +245,12 @@
245245
<IPInterfaces>
246246
<IPInterface>
247247
<Name i:nil="true"/>
248-
<AttachTo>PortChannel01</AttachTo>
248+
<AttachTo>PortChannel1</AttachTo>
249249
<Prefix>10.0.0.56/31</Prefix>
250250
</IPInterface>
251251
<IPInterface>
252252
<Name i:Name="true"/>
253-
<AttachTo>PortChannel01</AttachTo>
253+
<AttachTo>PortChannel1</AttachTo>
254254
<Prefix>FC00::71/126</Prefix>
255255
</IPInterface>
256256
<IPInterface>
@@ -272,7 +272,7 @@
272272
<DataAcls/>
273273
<AclInterfaces>
274274
<AclInterface>
275-
<AttachTo>PortChannel01</AttachTo>
275+
<AttachTo>PortChannel1</AttachTo>
276276
<InAcl>DataAcl</InAcl>
277277
<Type>DataPlane</Type>
278278
</AclInterface>

0 commit comments

Comments
 (0)