From 48e8157a80c22e8507d324fc7ac33e0784ad7bfb Mon Sep 17 00:00:00 2001 From: Oleksandr Kozodoi Date: Tue, 16 Nov 2021 10:22:45 -0800 Subject: [PATCH 1/2] Add necessary changes for virtual environment of sonic-mgmt docker container Signed-off-by: Oleksandr Kozodoi --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 67 ++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index ccdcc168bef8..89950484201b 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -174,7 +174,6 @@ RUN python -m virtualenv --system-site-packages env-201811 RUN env-201811/bin/pip install cryptography==3.3.2 ansible==2.0.0.2 RUN python3 -m venv env-python3 -RUN env-python3/bin/pip3 install cryptography==3.3.2 azure-kusto-data azure-kusto-ingest defusedxml pytest aiohttp # NOTE: There is an ordering dependency for pycryptodome. Leaving this at # the end until we figure that out. @@ -183,3 +182,69 @@ RUN pip install pycryptodome==3.9.8 # Install allure-pytest library RUN pip install --upgrade setuptools \ && pip install allure-pytest==2.8.22 + +# Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD. +ENV VIRTUAL_ENV=env-python3 +ARG BACKUP_OF_PATH="$PATH" +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONIOENCODING=UTF-8 + +RUN python3 -m pip install --upgrade --ignore-installed pip setuptools==58.4.0 + +RUN python3 -m pip install setuptools-rust \ + aiohttp \ + defusedxml \ + azure-kusto-ingest \ + azure-kusto-data \ + cffi \ + contextlib2==0.6.0.post1 \ + cryptography==3.3.2 \ + "future>=0.16.0" \ + gitpython \ + ipaddr \ + ipython==5.4.1 \ + ixnetwork-restpy==1.0.64 \ + ixnetwork-open-traffic-generator==0.0.79 \ + snappi[ixnetwork,convergence]==0.5.11 \ + jinja2==2.7.2 \ + jsonpatch \ + lxml \ + natsort \ + netaddr \ + netmiko==2.4.2 \ + paramiko==2.7.1 \ + passlib \ + pexpect \ + prettytable \ + psutil \ + pyasn1==0.1.9 \ + pyfiglet \ + pylint==1.8.1 \ + pyro4 \ + pysnmp==4.2.5 \ + pytest-repeat \ + pytest-html \ + pytest-xdist==1.28.0 \ + pytest \ + redis \ + requests \ + rpyc \ + six \ + tabulate \ + textfsm \ + virtualenv \ + wheel==0.33.6 \ + pysubnettree \ + nnpy \ + dpkt \ + pycryptodome==3.9.8 \ + ansible==2.8.12 \ + pytest-ansible \ + allure-pytest==2.8.22 \ + retry \ + thrift==0.11.0 \ + ptf + +# Deactivating a virtualenv. +ENV PATH="$BACKUP_OF_PATH" From 9b5cb937c3f1f814e9fdb30b531453fbbeaa4a40 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozodoi Date: Fri, 26 Nov 2021 06:05:30 -0800 Subject: [PATCH 2/2] Upgraded version of pysnmp Signed-off-by: Oleksandr Kozodoi --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 89950484201b..130fa29a7ee3 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -218,11 +218,11 @@ RUN python3 -m pip install setuptools-rust \ pexpect \ prettytable \ psutil \ - pyasn1==0.1.9 \ + pyasn1==0.4.8 \ pyfiglet \ pylint==1.8.1 \ pyro4 \ - pysnmp==4.2.5 \ + pysnmp==4.4.12 \ pytest-repeat \ pytest-html \ pytest-xdist==1.28.0 \