Revert "Upgrade Ansible to 6.7.0 and make Python3 as the default interpreter in sonic-mgmt-docker (#15836)" (#16537)

This reverts commit 51fb6d7d9f.

The new sonic-mgmt docker image has ansible upgraded. Encountered some issues that are hard to debug to have a quick fix. Let's revert the change for now. The new sonic-mgmt docker image was kept for further debugging and fixing. After all the issues are fixed, we'll need to apply this change again.
This commit is contained in:
ShiyanWangMS 2023-09-13 16:20:17 +08:00 committed by GitHub
parent 337a9dbcf4
commit 42126ccf7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,67 +38,67 @@ RUN apt-get update && apt-get install -y apt-transport-https \
telnet \ telnet \
vim vim
RUN python3 -m pip install --upgrade pip setuptools wheel RUN pip3 install --upgrade pip setuptools wheel
RUN python3 -m pip install aiohttp \ RUN pip3 install aiohttp \
allure-pytest==2.8.22 \ allure-pytest==2.8.22 \
ansible==6.7.0 \ ansible==2.9.27 \
azure-storage-blob==12.9.0 \ azure-storage-blob==12.9.0 \
azure-kusto-data \ azure-kusto-data \
azure-kusto-ingest \ azure-kusto-ingest \
defusedxml \ defusedxml \
celery[redis]==5.2.7 \ celery[redis]==5.2.7 \
cffi \ cffi \
contextlib2==0.6.0.post1 \ contextlib2==0.6.0.post1 \
cryptography==41.0.2 \ cryptography==3.3.2 \
dpkt \ dpkt \
"future>=0.16.0" \ "future>=0.16.0" \
gitpython \ gitpython \
ipaddr \ ipaddr \
ipython==8.12.2 \ ipython==8.12.2 \
ixnetwork-restpy==1.0.64 \ ixnetwork-restpy==1.0.64 \
ixnetwork-open-traffic-generator==0.0.79 \ ixnetwork-open-traffic-generator==0.0.79 \
jinja2==3.1.2 \ jinja2==2.10.1 \
jsonpatch \ jsonpatch \
lxml \ lxml \
markupsafe==2.0.1 \ markupsafe==2.0.1 \
mock \ mock \
msrest==0.6.21 \ msrest==0.6.21 \
natsort \ natsort \
ncclient \ ncclient \
netaddr \ netaddr \
netmiko==2.4.2 \ netmiko==2.4.2 \
paramiko==2.7.1 \ paramiko==2.7.1 \
passlib \ passlib \
pexpect \ pexpect \
prettytable \ prettytable \
psutil \ psutil \
ptf \ ptf \
pyasn1==0.4.8 \ pyasn1==0.4.8 \
pycryptodome==3.9.8 \ pycryptodome==3.9.8 \
pyfiglet \ pyfiglet \
pylint==1.8.1 \ pylint==1.8.1 \
pyro4 \ pyro4 \
pysnmp==4.4.12 \ pysnmp==4.4.12 \
pysubnettree \ pysubnettree \
pytest-ansible==4.0.0 \ pytest-ansible \
pytest-html \ pytest-html \
pytest-repeat \ pytest-repeat \
pytest-xdist==1.28.0 \ pytest-xdist==1.28.0 \
python-dateutil \ python-dateutil \
pytest==7.4.0 \ pytest==7.1.3 \
redis \ redis \
requests \ requests \
retry \ retry \
rpyc \ rpyc \
scandir \ scandir \
scapy==2.4.5 \ scapy==2.4.5 \
setuptools-rust \ setuptools-rust \
six \ six \
snappi[ixnetwork,convergence]==0.11.16 \ snappi[ixnetwork,convergence]==0.7.44 \
tabulate \ tabulate \
textfsm==1.1.2 \ textfsm==1.1.2 \
thrift==0.11.0 \ thrift==0.11.0 \
virtualenv \ virtualenv \
&& wget https://github.com/nanomsg/nanomsg/archive/1.2.tar.gz \ && wget https://github.com/nanomsg/nanomsg/archive/1.2.tar.gz \
&& tar xvfz 1.2.tar.gz \ && tar xvfz 1.2.tar.gz \
&& cd nanomsg-1.2 \ && cd nanomsg-1.2 \
@ -109,72 +109,81 @@ RUN python3 -m pip install aiohttp \
&& ldconfig \ && ldconfig \
&& cd ../.. \ && cd ../.. \
&& rm -fr nanomsg-1.2 \ && rm -fr nanomsg-1.2 \
&& rm -f 1.2.tar.gz \ && rm -f 1.2.tar.gz \
&& python3 -m pip install nnpy && pip3 install nnpy
RUN curl -fsSL http://archive.ubuntu.com/ubuntu/pool/universe/s/scapy/python-scapy_2.3.3-3_all.deb \
--output python-scapy_2.3.3-3_all.deb \
&& dpkg -i python-scapy_2.3.3-3_all.deb \
&& rm -f python-scapy_2.3.3-3_all.deb
RUN curl -fsSL https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \ RUN curl -fsSL https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
&& python2 get-pip.py \ && python2 get-pip.py \
&& rm -f get-pip.py && rm -f get-pip.py \
&& ln -sf `which pip2` /usr/bin/pip
RUN python2 -m pip install --upgrade pip setuptools wheel RUN pip install --upgrade pip setuptools wheel
RUN python2 -m pip install allure-pytest==2.8.22 \ RUN pip install allure-pytest==2.8.22 \
ansible==2.8.20 \ ansible==2.8.12 \
azure-storage-blob==12.9.0 \ azure-storage-blob==12.9.0 \
celery[redis]==4.4.7 \ celery[redis]==4.4.7 \
cffi==1.12.0 \ cffi==1.12.0 \
contextlib2==0.6.0.post1 \ contextlib2==0.6.0.post1 \
cryptography==3.3.2 \ cryptography==3.3.2 \
dpkt \ dpkt \
"future>=0.16.0" \ "future>=0.16.0" \
gitpython \ gitpython \
ipaddr \ ipaddr \
ipython==5.4.1 \ ipython==5.4.1 \
ixnetwork-restpy==1.0.64 \ ixnetwork-restpy==1.0.64 \
ixnetwork-open-traffic-generator==0.0.79 \ ixnetwork-open-traffic-generator==0.0.79 \
jinja2==2.10.1 \ jinja2==2.10.1 \
jsonpatch \ jsonpatch \
lazy-object-proxy==1.6.0 \ lazy-object-proxy==1.6.0 \
lxml \ lxml \
mock \ mock \
msrest==0.6.21 \ msrest==0.6.21 \
natsort \ natsort \
netaddr \ netaddr \
netmiko==2.4.2 \ netmiko==2.4.2 \
nnpy \ nnpy \
paramiko==2.7.1 \ paramiko==2.7.1 \
passlib \ passlib \
pexpect \ pexpect \
prettytable \ prettytable \
protobuf==3.15.0 \ psutil \
psutil \ pyaml==21.10.1 \
ptf \ pyasn1==0.1.9 \
pyaml==21.10.1 \ pycryptodome==3.9.8 \
pyasn1==0.1.9 \ pyfiglet \
pycryptodome==3.9.8 \ pylint==1.8.1 \
pyfiglet \ pyro4 \
pylint==1.8.1 \ pysnmp==4.2.5 \
pyro4 \ pysubnettree \
pysnmp==4.2.5 \ pytest==4.6.11 \
pysubnettree \ pytest-ansible \
pytest==4.6.11 \ pytest-repeat \
pytest-ansible \ pytest-html \
pytest-repeat \ pytest-xdist==1.28.0 \
pytest-html \ python-dateutil \
pytest-xdist==1.28.0 \ redis \
python-dateutil \ requests \
redis \ retry \
requests \ rpyc \
retry \ scandir \
rpyc \ six \
scandir \ snappi[ixnetwork,convergence]==0.7.44 \
scapy==2.4.5 \ statistics \
six \ tabulate \
snappi[ixnetwork,convergence]==0.11.16 \ textfsm==1.1.3 \
statistics \ thrift==0.11.0 \
tabulate \ virtualenv \
textfsm==1.1.3 \ && git clone https://github.com/p4lang/scapy-vxlan.git \
thrift==0.11.0 \ && cd scapy-vxlan \
virtualenv && python setup.py install \
&& cd .. \
&& rm -fr scapy-vxlan \
&& pip install scapy==2.4.5 --upgrade --ignore-installed
# Install docker-ce-cli # Install docker-ce-cli
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
@ -190,9 +199,16 @@ RUN mkdir -p /etc/apt/keyrings \
&& apt-get update && apt-get install -y azure-cli && apt-get update && apt-get install -y azure-cli
## Copy and install sonic-mgmt docker dependencies ## Copy and install sonic-mgmt docker dependencies
COPY debs/sonic-device-data_*.deb debs/ COPY \
{% for deb in docker_sonic_mgmt_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i debs/sonic-device-data_*.deb RUN dpkg -i \
{% for deb in docker_sonic_mgmt_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
# Install protobuf 3.21.12 # Install protobuf 3.21.12
RUN mkdir -p /tmp/protobuf \ RUN mkdir -p /tmp/protobuf \
@ -267,7 +283,7 @@ RUN python3 -m pip install aiohttp \
celery[redis]==5.2.7 \ celery[redis]==5.2.7 \
cffi \ cffi \
contextlib2==0.6.0.post1 \ contextlib2==0.6.0.post1 \
cryptography==41.0.2 \ cryptography==3.3.2 \
dpkt \ dpkt \
"future>=0.16.0" \ "future>=0.16.0" \
gitpython \ gitpython \
@ -313,7 +329,7 @@ RUN python3 -m pip install aiohttp \
scapy==2.4.5 \ scapy==2.4.5 \
setuptools-rust \ setuptools-rust \
six \ six \
snappi[ixnetwork,convergence]==0.11.16 \ snappi[ixnetwork,convergence]==0.7.44 \
sshconf==0.2.5 \ sshconf==0.2.5 \
tabulate \ tabulate \
textfsm==1.1.2 \ textfsm==1.1.2 \
@ -328,9 +344,5 @@ WORKDIR /azp
COPY ./start.sh . COPY ./start.sh .
RUN chmod +x start.sh RUN chmod +x start.sh
# Install python3 as default python
RUN ln -sf /usr/bin/python3 /usr/bin/python \
&& ln -sf `which pip3` /usr/bin/pip
USER $user USER $user
WORKDIR /var/$user WORKDIR /var/$user