Skip to content

Commit 59b0747

Browse files
wsycqyzsonic-otn
authored andcommitted
Add Python3 packages to sonic-mgmt-docker (sonic-net#15726)
Why I did it This is part of sonic-mgmt-docker Python3 migration project. Currently Python3 packages are in the Python3 virtual environment. This PR will add Python3 packages to real file system. After we migrate all script to use Python3 in real file system, the Python3 venv will be deleted. After this PR, in sonic-mgmt-docker, Directly run cmd - pytest will use Python2's version. python3 -m pytest will use Python3's version. How I did it Modify sonic-mgmt-docker j2 script. How to verify it Build a private sonic-mgmt-docker and run basic test case with Python3.
1 parent 98e1982 commit 59b0747

File tree

1 file changed

+75
-12
lines changed

1 file changed

+75
-12
lines changed

dockers/docker-sonic-mgmt/Dockerfile.j2

+75-12
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,80 @@ RUN apt-get update && apt-get install -y apt-transport-https \
3838
telnet \
3939
vim
4040

41+
RUN pip3 install --upgrade pip setuptools wheel
42+
RUN pip3 install aiohttp \
43+
allure-pytest==2.8.22 \
44+
ansible==2.9.27 \
45+
azure-storage-blob==12.9.0 \
46+
azure-kusto-data \
47+
azure-kusto-ingest \
48+
defusedxml \
49+
celery[redis]==4.4.7 \
50+
cffi \
51+
contextlib2==0.6.0.post1 \
52+
cryptography==3.3.2 \
53+
dpkt \
54+
"future>=0.16.0" \
55+
gitpython \
56+
ipaddr \
57+
ipython==5.4.1 \
58+
ixnetwork-restpy==1.0.64 \
59+
ixnetwork-open-traffic-generator==0.0.79 \
60+
jinja2==2.10.1 \
61+
jsonpatch \
62+
lxml \
63+
markupsafe==2.0.1 \
64+
mock \
65+
msrest==0.6.21 \
66+
natsort \
67+
ncclient \
68+
netaddr \
69+
netmiko==2.4.2 \
70+
paramiko==2.7.1 \
71+
passlib \
72+
pexpect \
73+
prettytable \
74+
psutil \
75+
ptf \
76+
pyasn1==0.4.8 \
77+
pycryptodome==3.9.8 \
78+
pyfiglet \
79+
pylint==1.8.1 \
80+
pyro4 \
81+
pysnmp==4.4.12 \
82+
pysubnettree \
83+
pytest-ansible \
84+
pytest-html \
85+
pytest-repeat \
86+
pytest-xdist==1.28.0 \
87+
python-dateutil \
88+
pytest==7.1.3 \
89+
redis \
90+
requests \
91+
retry \
92+
rpyc \
93+
scandir \
94+
scapy==2.4.5 \
95+
setuptools-rust \
96+
six \
97+
snappi[ixnetwork,convergence]==0.7.44 \
98+
tabulate \
99+
textfsm==1.1.2 \
100+
thrift==0.11.0 \
101+
virtualenv \
102+
&& wget https://github.com/nanomsg/nanomsg/archive/1.2.tar.gz \
103+
&& tar xvfz 1.2.tar.gz \
104+
&& cd nanomsg-1.2 \
105+
&& mkdir -p build \
106+
&& cd build \
107+
&& cmake .. \
108+
&& make install \
109+
&& ldconfig \
110+
&& cd ../.. \
111+
&& rm -fr nanomsg-1.2 \
112+
&& rm -f 1.2.tar.gz \
113+
&& pip3 install nnpy
114+
41115
RUN curl -fsSL http://archive.ubuntu.com/ubuntu/pool/universe/s/scapy/python-scapy_2.3.3-3_all.deb \
42116
--output python-scapy_2.3.3-3_all.deb \
43117
&& dpkg -i python-scapy_2.3.3-3_all.deb \
@@ -72,6 +146,7 @@ RUN pip install allure-pytest==2.8.22 \
72146
natsort \
73147
netaddr \
74148
netmiko==2.4.2 \
149+
nnpy \
75150
paramiko==2.7.1 \
76151
passlib \
77152
pexpect \
@@ -108,18 +183,6 @@ RUN pip install allure-pytest==2.8.22 \
108183
&& python setup.py install \
109184
&& cd .. \
110185
&& rm -fr scapy-vxlan \
111-
&& wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
112-
&& tar xvfz 1.0.0.tar.gz \
113-
&& cd nanomsg-1.0.0 \
114-
&& mkdir -p build \
115-
&& cd build \
116-
&& cmake .. \
117-
&& make install \
118-
&& ldconfig \
119-
&& cd ../.. \
120-
&& rm -fr nanomsg-1.0.0 \
121-
&& rm -f 1.0.0.tar.gz \
122-
&& pip install nnpy \
123186
&& pip install scapy==2.4.5 --upgrade --ignore-installed
124187

125188
# Install docker-ce-cli

0 commit comments

Comments
 (0)