Skip to content

Commit 92322be

Browse files
authored
Update the Azure Pipeline build to use Bookworm (#1452)
Update the Azure Pipeline build to build for Bookworm. Signed-off-by: Saikrishna Arcot <[email protected]>
1 parent 4f7eed0 commit 92322be

5 files changed

Lines changed: 221 additions & 73 deletions

File tree

.azure-pipelines/build-swss-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
sudo perl -i.bk -ne 'print if not /SONiCFileFormat|ActionFileDefaultTemplate/' /etc/rsyslog.conf
7575
sudo sed -ie '/GLOBAL DIRECTIVES/{s/$/\n\$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-lst-lf%\\n"\n\$ActionFileDefaultTemplate SONiCFileFormat/}' /etc/rsyslog.conf
7676
77-
sudo service rsyslog start
77+
sudo rsyslogd
7878
7979
displayName: "Install dependencies"
8080
- task: DownloadPipelineArtifact@2

.azure-pipelines/build-template.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
set -ex
7474
sudo apt-get update
7575
sudo apt-get install -qq -y \
76-
qtbase5-dev \
7776
libdbus-glib-1-dev \
7877
libpcsclite-dev \
7978
docbook-to-man \
@@ -86,7 +85,6 @@ jobs:
8685
libnl-nf-3-dev \
8786
libnl-cli-3-dev \
8887
swig4.0 \
89-
libzmq5 \
9088
libzmq3-dev \
9189
autoconf-archive
9290
@@ -167,20 +165,10 @@ jobs:
167165
displayName: "Compile sonic sairedis with coverage enabled"
168166
- script: |
169167
sudo cp azsyslog.conf /etc/rsyslog.conf
170-
sudo killall rsyslogd
168+
sudo pkill -F /run/rsyslogd.pid
171169
sudo rsyslogd
172170
displayName: "Update rsyslog.conf"
173171
- ${{ if eq(parameters.run_unit_test, true) }}:
174-
- script: |
175-
set -ex
176-
git clone https://github.com/gcovr/gcovr.git
177-
cd gcovr/
178-
git checkout 5.0
179-
sudo pip3 install setuptools
180-
sudo python3 setup.py install
181-
cd ..
182-
sudo rm -rf gcovr
183-
displayName: "Install gcovr 5.0"
184172
- script: |
185173
set -ex
186174
# Add SYS_TIME capability for settimeofday ok in syncd test
@@ -207,9 +195,9 @@ jobs:
207195
set -ex
208196
# Install .NET CORE
209197
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
210-
sudo apt-add-repository https://packages.microsoft.com/debian/11/prod
198+
sudo apt-add-repository https://packages.microsoft.com/debian/12/prod
211199
sudo apt-get update
212-
sudo apt-get install -y dotnet-sdk-7.0
200+
sudo apt-get install -y dotnet-sdk-8.0
213201
displayName: "Install .NET CORE"
214202
- task: PublishCodeCoverageResults@1
215203
inputs:

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ COPY ["debs", "/debs"]
99
# Docker's diff detection mechanism, where only the file size and the modification timestamp (which will remain the
1010
# same, even though contents have changed) are checked between the previous and current layer.
1111
RUN dpkg --purge libswsscommon python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss sonic-eventd libdashapi
12-
RUN dpkg -i /debs/libdashapi_1.0.0_amd64.deb \
12+
13+
RUN apt-get update
14+
15+
RUN apt install -y /debs/libdashapi_1.0.0_amd64.deb \
1316
/debs/libswsscommon_1.0.0_amd64.deb \
1417
/debs/python3-swsscommon_1.0.0_amd64.deb \
1518
/debs/sonic-db-cli_1.0.0_amd64.deb \
@@ -19,4 +22,10 @@ RUN dpkg -i /debs/libdashapi_1.0.0_amd64.deb \
1922
/debs/syncd-vs_1.0.0_amd64.deb \
2023
/debs/swss_1.0.0_amd64.deb
2124

22-
RUN if [ "$need_dbg" = "y" ] ; then dpkg -i /debs/syncd-vs-dbgsym_1.0.0_amd64.deb ; fi
25+
RUN if [ "$need_dbg" = "y" ] ; then dpkg -i /debs/libsairedis-dbgsym_1.0.0_amd64.deb ; fi
26+
27+
COPY ["start.sh", "/usr/bin/"]
28+
29+
RUN pip3 install scapy==2.5.0
30+
31+
RUN apt-get -y install software-properties-common libdatetime-perl libcapture-tiny-perl build-essential libcpanel-json-xs-perl git python3-protobuf
Lines changed: 187 additions & 0 deletions
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

0 commit comments

Comments
 (0)