Skip to content

Commit ee38cc8

Browse files
committed
Merge branch 'master' of https://github.com/Azure/sonic-buildimage into internal
2 parents 3982142 + 1995540 commit ee38cc8

File tree

5 files changed

+56
-18
lines changed

5 files changed

+56
-18
lines changed

dockers/docker-sonic-mgmt/Dockerfile.j2

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set prefix = DEFAULT_CONTAINER_REGISTRY %}
2-
FROM {{ prefix }}ubuntu:18.04
2+
FROM {{ prefix }}ubuntu:20.04
33

44
ENV DEBIAN_FRONTEND=noninteractive
55

@@ -21,8 +21,6 @@ RUN apt-get update && apt-get install -y build-essential \
2121
psmisc \
2222
python \
2323
python-dev \
24-
python-scapy \
25-
python-pip \
2624
python3-pip \
2725
python3-venv \
2826
rsyslog \
@@ -31,10 +29,20 @@ RUN apt-get update && apt-get install -y build-essential \
3129
sudo \
3230
tcpdump \
3331
telnet \
34-
vim
32+
vim \
33+
python-is-python2 \
34+
software-properties-common
35+
36+
RUN add-apt-repository -y universe
37+
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
38+
&& python2 get-pip.py
39+
40+
RUN curl -L http://archive.ubuntu.com/ubuntu/pool/universe/s/scapy/python-scapy_2.3.3-3_all.deb \
41+
--output python-scapy_2.3.3-3_all.deb \
42+
&& dpkg -i python-scapy_2.3.3-3_all.deb
3543

3644
RUN pip install setuptools==44.1.1
37-
RUN pip install cffi==1.10.0 \
45+
RUN pip install cffi==1.12.0 \
3846
contextlib2==0.6.0.post1 \
3947
cryptography==3.3.2 \
4048
"future>=0.16.0" \
@@ -96,7 +104,7 @@ RUN pip install cffi==1.10.0 \
96104
&& rm -f 1.0.0.tar.gz \
97105
&& pip install nnpy \
98106
&& pip install dpkt \
99-
&& pip install scapy==2.4.5 --upgrade
107+
&& pip install scapy==2.4.5 --upgrade --ignore-installed
100108

101109
# Install docker-ce-cli
102110
RUN apt-get update \
@@ -114,10 +122,6 @@ RUN apt-get update \
114122
# Install Azure CLI
115123
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
116124

117-
# Install Microsoft Azure Kusto Library for Python
118-
RUN pip install azure-kusto-data==0.0.13 \
119-
azure-kusto-ingest==0.0.13
120-
121125
RUN pip install wheel==0.33.6
122126

123127
## Copy and install sonic-mgmt docker dependencies
@@ -193,8 +197,7 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
193197

194198
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONIOENCODING=UTF-8
195199

196-
RUN python3 -m pip install --upgrade --ignore-installed pip setuptools==58.4.0
197-
200+
RUN python3 -m pip install --upgrade --ignore-installed pip setuptools==58.4.0 wheel==0.33.6
198201
RUN python3 -m pip install setuptools-rust \
199202
aiohttp \
200203
defusedxml \
@@ -210,6 +213,7 @@ RUN python3 -m pip install setuptools-rust \
210213
ixnetwork-restpy==1.0.64 \
211214
ixnetwork-open-traffic-generator==0.0.79 \
212215
snappi[ixnetwork,convergence]==0.7.44 \
216+
markupsafe==2.0.1 \
213217
jinja2==2.7.2 \
214218
jsonpatch \
215219
lxml \
@@ -237,7 +241,6 @@ RUN python3 -m pip install setuptools-rust \
237241
tabulate \
238242
textfsm==1.1.2 \
239243
virtualenv \
240-
wheel==0.33.6 \
241244
pysubnettree \
242245
nnpy \
243246
dpkt \
@@ -252,5 +255,5 @@ RUN python3 -m pip install setuptools-rust \
252255
celery[redis]==4.4.7 \
253256
msrest==0.6.21
254257

255-
# Deactivating a virtualenv.
258+
# Deactivating a virtualenv
256259
ENV PATH="$BACKUP_OF_PATH"

files/build_templates/docker_image_ctl.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function preStartAction()
8787
{%- if docker_container_name == "database" %}
8888
WARM_DIR=/host/warmboot
8989
if [ "$DATABASE_TYPE" != "chassisdb" ]; then
90-
if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast") && -f $WARM_DIR/dump.rdb ]]; then
90+
if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast" || "$BOOT_TYPE" == "fast") && -f $WARM_DIR/dump.rdb ]]; then
9191
# Load redis content from /host/warmboot/dump.rdb
9292
docker cp $WARM_DIR/dump.rdb database$DEV:/var/lib/redis/dump.rdb
9393
else
@@ -218,7 +218,7 @@ function postStartAction()
218218
($(docker exec -i database$DEV sonic-db-cli PING | grep -c PONG) -gt 0) ]]; do
219219
sleep 1;
220220
done
221-
if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast") && -f $WARM_DIR/dump.rdb ]]; then
221+
if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast" || "$BOOT_TYPE" == "fast") && -f $WARM_DIR/dump.rdb ]]; then
222222
# retain the dump file from last boot for debugging purposes
223223
mv $WARM_DIR/dump.rdb $WARM_DIR/dump.rdb.old
224224
else

scripts/build_kvm_image.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ prepare_installer_disk()
4949
umount $tmpdir
5050
}
5151

52+
wait_kvm_ready()
53+
{
54+
local count=30
55+
local waiting_in_seconds=2.0
56+
for ((i=1; i<=$count; i++)); do
57+
sleep $waiting_in_seconds
58+
echo "$(date) [$i/$count] waiting for the port $KVM_PORT ready"
59+
if netstat -l | grep -q ":$KVM_PORT"; then
60+
break
61+
fi
62+
done
63+
}
64+
5265
apt-get install -y net-tools
5366
create_disk
5467
prepare_installer_disk
@@ -86,7 +99,7 @@ echo "Installing SONiC"
8699

87100
kvm_pid=$!
88101

89-
sleep 2.0
102+
wait_kvm_ready
90103

91104
[ -d "/proc/$kvm_pid" ] || {
92105
echo "ERROR: kvm died."
@@ -114,7 +127,7 @@ echo "Booting up SONiC"
114127

115128
kvm_pid=$!
116129

117-
sleep 2.0
130+
wait_kvm_ready
118131

119132
[ -d "/proc/$kvm_pid" ] || {
120133
echo "ERROR: kvm died."
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Fix the return value of utils._execute_subprocess method for empty strings
2+
---
3+
ifupdown2/ifupdown/utils.py | 2 +-
4+
1 file changed, 1 insertion(+), 1 deletion(-)
5+
6+
diff --git a/ifupdown2/ifupdown/utils.py b/ifupdown2/ifupdown/utils.py
7+
index d638fe9..0c5d8ce 100644
8+
--- a/ifupdown2/ifupdown/utils.py
9+
+++ b/ifupdown2/ifupdown/utils.py
10+
@@ -380,7 +380,7 @@ class utils():
11+
finally:
12+
utils.disable_subprocess_signal_forwarding(signal.SIGINT)
13+
14+
- cmd_output_string = cmd_output.decode() if cmd_output else cmd_output
15+
+ cmd_output_string = cmd_output.decode() if cmd_output is not None else cmd_output
16+
17+
if cmd_returncode != 0:
18+
raise Exception(cls._format_error(cmd,
19+
--
20+
2.14.1
21+

src/ifupdown2/patch/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
0001-fix-broadcast-addr-encoding.patch
22
0002-disable-checks-when-using-no-wait.patch
3+
0003-Fix-the-return-value-of-utils._execute_subprocess-me.patch

0 commit comments

Comments
 (0)