Skip to content

Commit 7d77274

Browse files
authored
Merge branch 'sonic-net:master' into vrrp_orch
2 parents a685349 + caed910 commit 7d77274

File tree

10 files changed

+258
-100
lines changed

10 files changed

+258
-100
lines changed

.azure-pipelines/build-template.yml

+9-12
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,15 @@ jobs:
150150
runBranch: 'refs/heads/${{ parameters.common_lib_artifact_branch }}'
151151
path: $(Build.ArtifactStagingDirectory)/download/common
152152
patterns: |
153-
target/debs/bullseye/libnl-3-200_*.deb
154-
target/debs/bullseye/libnl-3-dev_*.deb
155-
target/debs/bullseye/libnl-genl-3-200_*.deb
156-
target/debs/bullseye/libnl-genl-3-dev_*.deb
157-
target/debs/bullseye/libnl-route-3-200_*.deb
158-
target/debs/bullseye/libnl-route-3-dev_*.deb
159-
target/debs/bullseye/libnl-nf-3-200_*.deb
160-
target/debs/bullseye/libnl-nf-3-dev_*.deb
161-
target/debs/bullseye/libyang_*.deb
162-
target/debs/bullseye/libprotobuf*.deb
163-
target/debs/bullseye/libprotoc*.deb
164-
target/debs/bullseye/protobuf-compiler*.deb
153+
target/debs/bookworm/libnl-3-200_*.deb
154+
target/debs/bookworm/libnl-3-dev_*.deb
155+
target/debs/bookworm/libnl-genl-3-200_*.deb
156+
target/debs/bookworm/libnl-genl-3-dev_*.deb
157+
target/debs/bookworm/libnl-route-3-200_*.deb
158+
target/debs/bookworm/libnl-route-3-dev_*.deb
159+
target/debs/bookworm/libnl-nf-3-200_*.deb
160+
target/debs/bookworm/libnl-nf-3-dev_*.deb
161+
target/debs/bookworm/libyang_*.deb
165162
displayName: "Download common libs"
166163
- task: DownloadPipelineArtifact@2
167164
inputs:

.azure-pipelines/docker-sonic-vs/Dockerfile

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ COPY ["debs", "/debs"]
1212
# same, even though contents have changed) are checked between the previous and current layer.
1313
RUN dpkg --purge libswsscommon python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss sonic-eventd libdashapi
1414

15-
RUN dpkg -i /debs/libdashapi_1.0.0_amd64.deb \
15+
RUN apt-get update
16+
17+
RUN apt install -y /debs/libdashapi_1.0.0_amd64.deb \
1618
/debs/libswsscommon_1.0.0_amd64.deb \
1719
/debs/python3-swsscommon_1.0.0_amd64.deb \
1820
/debs/sonic-db-cli_1.0.0_amd64.deb \
@@ -24,9 +26,11 @@ RUN dpkg -i /debs/libdashapi_1.0.0_amd64.deb \
2426

2527
RUN if [ "$need_dbg" = "y" ] ; then dpkg -i /debs/swss-dbg_1.0.0_amd64.deb ; fi
2628

27-
RUN apt-get update
29+
COPY ["start.sh", "/usr/bin/"]
30+
31+
RUN pip3 install scapy==2.5.0
2832

29-
RUN apt-get -y install software-properties-common libdatetime-perl libcapture-tiny-perl build-essential libcpanel-json-xs-perl git
33+
RUN apt-get -y install software-properties-common libdatetime-perl libcapture-tiny-perl build-essential libcpanel-json-xs-perl git python3-protobuf
3034

3135
RUN git clone -b v2.0 --single-branch --depth 1 https://github.com/linux-test-project/lcov && cd lcov && make install
3236

+187
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
#!/bin/bash -e
2+
3+
# Generate configuration
4+
5+
# NOTE: 'PLATFORM' and 'HWSKU' environment variables are set
6+
# in the Dockerfile so that they persist for the life of the container
7+
8+
ln -sf /usr/share/sonic/device/$PLATFORM /usr/share/sonic/platform
9+
ln -sf /usr/share/sonic/device/$PLATFORM/$HWSKU /usr/share/sonic/hwsku
10+
11+
SWITCH_TYPE=switch
12+
PLATFORM_CONF=platform.json
13+
if [[ $HWSKU == "DPU-2P" ]]; then
14+
SWITCH_TYPE=dpu
15+
PLATFORM_CONF=platform-dpu-2p.json
16+
fi
17+
18+
pushd /usr/share/sonic/hwsku
19+
20+
# filter available front panel ports in lanemap.ini
21+
[ -f lanemap.ini.orig ] || cp lanemap.ini lanemap.ini.orig
22+
for p in $(ip link show | grep -oE "eth[0-9]+" | grep -v eth0); do
23+
grep ^$p: lanemap.ini.orig
24+
done > lanemap.ini
25+
26+
# filter available sonic front panel ports in port_config.ini
27+
[ -f port_config.ini.orig ] || cp port_config.ini port_config.ini.orig
28+
grep ^# port_config.ini.orig > port_config.ini
29+
for lanes in $(awk -F ':' '{print $2}' lanemap.ini); do
30+
grep -E "\s$lanes\s" port_config.ini.orig
31+
done >> port_config.ini
32+
33+
popd
34+
35+
[ -d /etc/sonic ] || mkdir -p /etc/sonic
36+
37+
# Note: libswsscommon requires a dabase_config file in /var/run/redis/sonic-db/
38+
# Prepare this file before any dependent application, such as sonic-cfggen
39+
mkdir -p /var/run/redis/sonic-db
40+
cp /etc/default/sonic-db/database_config.json /var/run/redis/sonic-db/
41+
42+
SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
43+
sonic-cfggen -t /usr/share/sonic/templates/init_cfg.json.j2 -a "{\"system_mac\": \"$SYSTEM_MAC_ADDRESS\", \"switch_type\": \"$SWITCH_TYPE\"}" > /etc/sonic/init_cfg.json
44+
45+
if [[ -f /usr/share/sonic/virtual_chassis/default_config.json ]]; then
46+
sonic-cfggen -j /etc/sonic/init_cfg.json -j /usr/share/sonic/virtual_chassis/default_config.json --print-data > /tmp/init_cfg.json
47+
mv /tmp/init_cfg.json /etc/sonic/init_cfg.json
48+
fi
49+
50+
if [ -f /etc/sonic/config_db.json ]; then
51+
sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --print-data > /tmp/config_db.json
52+
mv /tmp/config_db.json /etc/sonic/config_db.json
53+
else
54+
# generate and merge buffers configuration into config file
55+
if [ -f /usr/share/sonic/hwsku/buffers.json.j2 ]; then
56+
sonic-cfggen -k $HWSKU -p /usr/share/sonic/device/$PLATFORM/$PLATFORM_CONF -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json
57+
buffers_cmd="-j /tmp/buffers.json"
58+
fi
59+
if [ -f /usr/share/sonic/hwsku/qos.json.j2 ]; then
60+
sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json
61+
qos_cmd="-j /tmp/qos.json"
62+
fi
63+
64+
sonic-cfggen -p /usr/share/sonic/device/$PLATFORM/$PLATFORM_CONF -k $HWSKU --print-data > /tmp/ports.json
65+
# change admin_status from up to down; Test cases dependent
66+
sed -i "s/up/down/g" /tmp/ports.json
67+
sonic-cfggen -j /etc/sonic/init_cfg.json $buffers_cmd $qos_cmd -j /tmp/ports.json --print-data > /etc/sonic/config_db.json
68+
fi
69+
70+
sonic-cfggen -t /usr/share/sonic/templates/copp_cfg.j2 > /etc/sonic/copp_cfg.json
71+
72+
if [ "$HWSKU" == "Mellanox-SN2700" ]; then
73+
cp /usr/share/sonic/hwsku/sai_mlnx.profile /usr/share/sonic/hwsku/sai.profile
74+
elif [ "$HWSKU" == "DPU-2P" ]; then
75+
cp /usr/share/sonic/hwsku/sai_dpu_2p.profile /usr/share/sonic/hwsku/sai.profile
76+
fi
77+
78+
mkdir -p /etc/swss/config.d/
79+
80+
rm -f /var/run/rsyslogd.pid
81+
82+
supervisorctl start rsyslogd
83+
84+
supervisord_cfg="/etc/supervisor/conf.d/supervisord.conf"
85+
chassisdb_cfg_file="/usr/share/sonic/virtual_chassis/default_config.json"
86+
chassisdb_cfg_file_default="/etc/default/sonic-db/default_chassis_cfg.json"
87+
host_template="/usr/share/sonic/templates/hostname.j2"
88+
db_cfg_file="/var/run/redis/sonic-db/database_config.json"
89+
db_cfg_file_tmp="/var/run/redis/sonic-db/database_config.json.tmp"
90+
91+
if [ -r "$chassisdb_cfg_file" ]; then
92+
echo $(sonic-cfggen -j $chassisdb_cfg_file -t $host_template) >> /etc/hosts
93+
else
94+
chassisdb_cfg_file="$chassisdb_cfg_file_default"
95+
echo "10.8.1.200 redis_chassis.server" >> /etc/hosts
96+
fi
97+
98+
supervisorctl start redis-server
99+
100+
start_chassis_db=`sonic-cfggen -v DEVICE_METADATA.localhost.start_chassis_db -y $chassisdb_cfg_file`
101+
if [[ "$HOSTNAME" == *"supervisor"* ]] || [ "$start_chassis_db" == "1" ]; then
102+
supervisorctl start redis-chassis
103+
fi
104+
105+
conn_chassis_db=`sonic-cfggen -v DEVICE_METADATA.localhost.connect_to_chassis_db -y $chassisdb_cfg_file`
106+
if [ "$start_chassis_db" != "1" ] && [ "$conn_chassis_db" != "1" ]; then
107+
cp $db_cfg_file $db_cfg_file_tmp
108+
update_chassisdb_config -j $db_cfg_file_tmp -d
109+
cp $db_cfg_file_tmp $db_cfg_file
110+
fi
111+
112+
if [ "$conn_chassis_db" == "1" ]; then
113+
if [ -f /usr/share/sonic/virtual_chassis/coreportindexmap.ini ]; then
114+
cp /usr/share/sonic/virtual_chassis/coreportindexmap.ini /usr/share/sonic/hwsku/
115+
116+
pushd /usr/share/sonic/hwsku
117+
118+
# filter available front panel ports in coreportindexmap.ini
119+
[ -f coreportindexmap.ini.orig ] || cp coreportindexmap.ini coreportindexmap.ini.orig
120+
for p in $(ip link show | grep -oE "eth[0-9]+" | grep -v eth0); do
121+
grep ^$p: coreportindexmap.ini.orig
122+
done > coreportindexmap.ini
123+
124+
popd
125+
fi
126+
fi
127+
128+
/usr/bin/configdb-load.sh
129+
130+
if [ "$HWSKU" = "brcm_gearbox_vs" ]; then
131+
supervisorctl start gbsyncd
132+
supervisorctl start gearsyncd
133+
fi
134+
135+
supervisorctl start syncd
136+
137+
supervisorctl start portsyncd
138+
139+
supervisorctl start orchagent
140+
141+
supervisorctl start coppmgrd
142+
143+
supervisorctl start neighsyncd
144+
145+
supervisorctl start fdbsyncd
146+
147+
supervisorctl start teamsyncd
148+
149+
supervisorctl start fpmsyncd
150+
151+
supervisorctl start teammgrd
152+
153+
supervisorctl start vrfmgrd
154+
155+
supervisorctl start portmgrd
156+
157+
supervisorctl start intfmgrd
158+
159+
supervisorctl start vlanmgrd
160+
161+
supervisorctl start zebra
162+
163+
supervisorctl start mgmtd
164+
165+
supervisorctl start staticd
166+
167+
supervisorctl start buffermgrd
168+
169+
supervisorctl start nbrmgrd
170+
171+
supervisorctl start vxlanmgrd
172+
173+
supervisorctl start sflowmgrd
174+
175+
supervisorctl start natmgrd
176+
177+
supervisorctl start natsyncd
178+
179+
supervisorctl start tunnelmgrd
180+
181+
supervisorctl start fabricmgrd
182+
183+
# Start arp_update when VLAN exists
184+
VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
185+
if [ "$VLAN" != "" ]; then
186+
supervisorctl start arp_update
187+
fi

.github/workflows/codeql-analysis.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- 'master'
99
- '202[0-9][0-9][0-9]'
10-
pull_request_target:
10+
pull_request:
1111
branches:
1212
- 'master'
1313
- '202[0-9][0-9][0-9]'
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
analyze:
1818
name: Analyze
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-22.04
2020
permissions:
2121
actions: read
2222
contents: read
@@ -50,15 +50,14 @@ jobs:
5050
libnl-genl-3-dev \
5151
libnl-route-3-dev \
5252
libnl-nf-3-dev \
53-
libyang-dev \
5453
libzmq3-dev \
5554
libzmq5 \
56-
swig3.0 \
57-
libpython2.7-dev \
55+
swig \
56+
libpython3-dev \
5857
libgtest-dev \
5958
libgmock-dev \
60-
libboost1.71-dev \
61-
libboost-serialization1.71-dev \
59+
libboost-dev \
60+
libboost-serialization-dev \
6261
dh-exec \
6362
doxygen \
6463
cdbs \
@@ -69,7 +68,8 @@ jobs:
6968
uuid-dev \
7069
libjansson-dev \
7170
nlohmann-json3-dev \
72-
python \
71+
build-essential \
72+
devscripts \
7373
stgit
7474
7575
- if: matrix.language == 'cpp'
@@ -79,7 +79,7 @@ jobs:
7979
git clone https://github.com/sonic-net/sonic-swss-common
8080
pushd sonic-swss-common
8181
./autogen.sh
82-
dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc)
82+
dpkg-buildpackage -rfakeroot -us -uc -b -Pnoyangmod,nopython2 -j$(nproc)
8383
popd
8484
dpkg-deb -x libswsscommon_${SWSSCOMMON_VER}_amd64.deb $(dirname $GITHUB_WORKSPACE)
8585
dpkg-deb -x libswsscommon-dev_${SWSSCOMMON_VER}_amd64.deb $(dirname $GITHUB_WORKSPACE)
@@ -115,12 +115,13 @@ jobs:
115115
cd ..
116116
git clone https://github.com/sonic-net/sonic-buildimage
117117
pushd sonic-buildimage/src/libnl3
118-
git clone https://github.com/thom311/libnl libnl3-${LIBNL3_VER}
118+
dget -u https://deb.debian.org/debian/pool/main/libn/libnl3/libnl3_${LIBNL3_VER}-${LIBNL3_REV}.dsc
119119
pushd libnl3-${LIBNL3_VER}
120-
git checkout tags/libnl${LIBNL3_VER//./_}
121-
git checkout -b sonic
120+
git init
122121
git config --local user.name $USER
123122
git config --local user.email [email protected]
123+
git add -f *
124+
git commit -qm "initial commit"
124125
stg init
125126
stg import -s ../patch/series
126127
git config --local --unset user.name
@@ -138,8 +139,8 @@ jobs:
138139
dpkg-deb -x libnl-nf-3-dev_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
139140
popd
140141
env:
141-
LIBNL3_VER: "3.5.0"
142-
LIBNL3_REV: "1"
142+
LIBNL3_VER: "3.7.0"
143+
LIBNL3_REV: "0.2"
143144

144145
- if: matrix.language == 'cpp'
145146
name: Build repository

0 commit comments

Comments
 (0)