Skip to content

Commit 4599f7a

Browse files
liorghubmssonicbld
authored andcommitted
[Nvidia] Update syncd docker to use python version 3 (#17735)
* Remove python2 from compilation of python-sdk-api * Upgrade Python version in syncd RPC docker image to Python3
1 parent 6b8549c commit 4599f7a

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##
2-
## Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES.
2+
## Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES.
33
## Apache-2.0
44
##
55
## Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,23 +25,27 @@ RUN mkdir -p /var/run/sx_sdk
2525
RUN apt-get purge -y syncd
2626

2727
## Pre-install the fundamental packages
28-
RUN apt-get update \
29-
&& apt-get -y install \
30-
net-tools \
31-
python-setuptools \
32-
build-essential \
33-
libssl-dev \
34-
libffi-dev \
35-
python-dev \
36-
wget \
37-
cmake \
38-
libqt5core5a \
39-
libqt5network5 \
40-
libboost-atomic1.74.0
28+
RUN apt-get update \
29+
&& apt-get -y install \
30+
net-tools \
31+
build-essential \
32+
libssl-dev \
33+
libffi-dev \
34+
wget \
35+
cmake \
36+
libqt5core5a \
37+
libqt5network5 \
38+
libboost-atomic1.74.0 \
39+
python3-pip \
40+
python3-dev \
41+
python-is-python3 \
42+
python3-setuptools
43+
44+
RUN pip3 install --upgrade pip
4145

4246
# Build and install python-scapy
43-
RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_all.deb --output python-scapy_2.4.0-2_all.deb \
44-
&& dpkg -i python-scapy_2.4.0-2_all.deb \
47+
RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python3-scapy_2.4.0-2_all.deb --output python3-scapy_2.4.0-2_all.deb \
48+
&& dpkg -i python3-scapy_2.4.0-2_all.deb \
4549
&& apt install -f
4650

4751
{% if docker_syncd_mlnx_rpc_debs.strip() -%}
@@ -64,10 +68,6 @@ RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_
6468
{{ install_debian_packages(docker_syncd_mlnx_rpc_pydebs.split(' ')) }}
6569
{% endif %}
6670

67-
# Install pip2 since it is no longer in the APT upstream
68-
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
69-
&& python2 get-pip.py
70-
7171
RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
7272
&& tar xvfz 1.0.0.tar.gz \
7373
&& cd nanomsg-1.0.0 \
@@ -78,10 +78,10 @@ RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
7878
&& cd .. \
7979
&& rm -fr nanomsg-1.0.0 \
8080
&& rm -f 1.0.0.tar.gz \
81-
&& pip2 install cffi==1.7.0 \
82-
&& pip2 install --upgrade cffi==1.7.0 \
83-
&& pip2 install wheel \
84-
&& pip2 install nnpy \
81+
&& pip3 install cffi==1.16.0 \
82+
&& pip3 install wheel \
83+
&& pip3 install nnpy \
84+
&& pip3 install ptf \
8585
&& mkdir -p /opt \
8686
&& cd /opt \
8787
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \

platform/mellanox/docker-syncd-mlnx-rpc/ptf_nn_agent.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[program:ptf_nn_agent]
2-
command=/usr/bin/python2 /opt/ptf_nn_agent.py --device-socket 1@tcp://0.0.0.0:10900 -i 1-3@Ethernet12 --set-nn-rcv-buffer=109430400 --set-iface-rcv-buffer=109430400 --set-nn-snd-buffer=109430400 --set-iface-snd-buffer=109430400
2+
command=/usr/bin/python3 /opt/ptf_nn_agent.py --device-socket 1@tcp://0.0.0.0:10900 -i 1-3@Ethernet12 --set-nn-rcv-buffer=109430400 --set-iface-rcv-buffer=109430400 --set-nn-snd-buffer=109430400 --set-iface-snd-buffer=109430400
33
process_name=ptf_nn_agent
44
stdout_logfile=/tmp/ptf_nn_agent.out.log
55
stderr_logfile=/tmp/ptf_nn_agent.err.log

platform/mellanox/docker-syncd-mlnx/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##
2-
## Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES.
2+
## Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES.
33
## Apache-2.0
44
##
55
## Licensed under the Apache License, Version 2.0 (the "License");

platform/mellanox/sdk-src/python-sdk-api/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
1818
./autogen.sh
1919
fi
2020

21-
debuild -e PYTHON_INTERPRETERS="\"python2 python3\"" -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
21+
debuild -e PYTHON_INTERPRETERS="\"python3\"" -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
2222

2323
popd
2424

0 commit comments

Comments
 (0)