Skip to content

Commit c447877

Browse files
committed
Start up mgmtd
FRR 10.0.1 upgrade (sonic-net/sonic-buildimage#20269) brought in a mgmtd daemon for FRR. This needs to be started up in docker-sonic-vs. Signed-off-by: Saikrishna Arcot <[email protected]>
1 parent b86569e commit c447877

File tree

3 files changed

+190
-1
lines changed

3 files changed

+190
-1
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ RUN apt install /debs/libdashapi_1.0.0_amd64.deb \
2424

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

27+
COPY ["start.sh", "/usr/bin/"]
28+
2729
RUN apt-get update
2830

2931
RUN apt-get -y install software-properties-common libdatetime-perl libcapture-tiny-perl build-essential libcpanel-json-xs-perl git
+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

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def __init__(
303303
"portmgrd"
304304
]
305305
self.syncd = ["syncd"]
306-
self.rtd = ["fpmsyncd", "zebra", "staticd"]
306+
self.rtd = ["fpmsyncd", "zebra", "staticd", "mgmtd"]
307307
self.teamd = ["teamsyncd", "teammgrd"]
308308
self.natd = ["natsyncd", "natmgrd"]
309309
self.alld = self.basicd + self.swssd + self.syncd + self.rtd + self.teamd + self.natd

0 commit comments

Comments
 (0)