Commit Graph

67 Commits

Author SHA1 Message Date
ShiyanWangMS
06795931b7
Add AZP agent necessary packages to sonic-mgmt-docker (#14291)
Why I did it
Add AZP agent necessary packages to sonic-mgmt-docker
Remove Python 201811 venv
Update some packages in order to meet internal security requirements

How I did it
Update sonic-mgmt-docker file

How to verify it
sonic-mgmt-docker can run: bash, apt update, apt install and ping.
start.sh is under /azp with exec permission.
env-201811 venv is removed.
jinja2 is upgrade to 2.10.1
2023-03-21 08:09:44 +08:00
Ye Jianquan
5e85c01621
Add scandir into sonic-mgmt docker image (#14219)
Why I did it
TestbedV2 requires scandir python package

How I did it
Install scandir packages
2023-03-14 08:58:11 +08:00
Vaibhav Hemant Dixit
860bc7492a
Add shellcheck and mock modules for running unit and linter test (#14062) 2023-03-03 19:24:26 +00:00
Xin Wang
a07aaca831
[docker-sonic-mgmt] Cleanup and upgrade some packages (#12218)
Why I did it
The Dockerfile of docker-sonic-mgmt became a little bit messy over time. Some packages are also a little bit too old. It would be better to do some cleanup and upgrade some important packages.

How I did it
Updated the dockerfile template for building docker-sonic-mgmt.

How to verify it
Locally built the docker-sonic-mgmt image and used it to run some test scripts.

Description for the changelog:
The build-essential package contains gcc and make. It's unnecessary to install them again.
The python-is-python2 package is included in the python package for Ubuntu 20.04. It's unnecessary to install it again.
Sort the apt and pip packages by alphabetic order.
Cleanup get-pip.py after installation.
Cleanup the python-scapy deb package after installation.
Ensure that the python pip, setuptools and wheel packages are up to date.
Install pytest-ansible from pip instead of from source code.
While installing docker-ce-cli, it's unnecessary to install curl and software-properties-common again.
Merged some pip install steps into one step.
Upgrade ansible from 2.8.12 to 2.9.27 for env-python3.
Upgrade pytest to 7.1.3 for env-python3.
Add ncclient package to evn-python3.
2022-10-18 10:02:30 +08:00
Ye Jianquan
62692f4228
Add storage blob related packages (#12220)
Why I did it
TestbedV2 relies on storage blob related python package to upload logs.

How I did it
Install storage blob related packages
2022-10-10 11:29:26 +08:00
Ye Jianquan
7666af9403
Fix pip install error (#12198)
Fix the error of pip install introduced in PR #12197
2022-09-28 14:39:33 +08:00
Ye Jianquan
9c602320c3
install missed package python-dateutil (#12197)
Why I did it
Fix issue of can't import dateutil.parser in show_techsupport/test_auto_techsupport.py

How I did it
install python-dateutil
2022-09-28 11:38:41 +08:00
ShiyanWangMS
1995540758
Upgrade docker-sonic-mgmt base image from Ubuntu18.04 to 20.04 (#12056)
Upgrade docker-sonic-mgmt base image from Ubuntu18.04 to 20.04
2022-09-27 09:15:48 +08:00
Xin Wang
f50dc28789
[docker-sonic-mgmt] Deprecate azure-kusto-data & azure-kusto-ingest for py2 (#12143)
Why I did it
The python packages azure-kusto-data and azure-kusto-ingest packages for python2 are too old and not really used. The python3 environment has newer version of these packages installed. This change is to deprecate these two packages for python2 in docker-sonic-mgmt image.

How I did it
Removed the lines for installing old version of packages azure-kusto-data and azure-kusto-ingest in python2 in the Dockerfile template.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
2022-09-26 10:48:02 +08:00
ShiyanWangMS
acc17db0c8
Revert PR#11831 (#12035) "Upgrade docker-sonic-mgmt base image from Ubuntu18.04 to 20.04" 2022-09-09 22:18:13 +08:00
ShiyanWangMS
83704d9955
Upgrade docker-sonic-mgmt base image from Ubuntu18.04 to 20.04 (#11831)
Update base image from ubuntu18.04 to ubuntu20.04
Fix necessary dependencies.
After upgrade, Py2 is 2.7.18, Py3 is 3.8.10.
2022-08-25 15:55:01 +08:00
Ye Jianquan
526cd92f53
Install celery in sonic-mgmt image (#11554)
Install celery in sonic-mgmt image
2022-07-29 14:46:24 +08:00
Ye Jianquan
27d53cbba7
FIX the build error introduced by textfsm 1.1.3(Published on 2022/7/6) (#11394)
Why I did it
sonic-mgmt docker image build error, because of the textfsm new version(1.1.3).
https://dev.azure.com/mssonic/build/_build/results?buildId=119147&view=logs&j=3dc8fd7e-4368-5a92-293e-d53cefc8c4b3&t=44e6c678-cb87-52d9-8547-bcdbd0ad6ae4&l=43043

How I did it
Fix textfsm version to 1.1.2

How to verify it
I build the image on my local env, and reproduce the issue with 1.1.3, it's fixed after I change the version to 1.1.2 .

Signed-off-by: jianquanye@microsoft.com
2022-07-09 19:02:10 +08:00
Ye Jianquan
5873e8ef9c
Upgrade snappi version to 0.7.44 (#11335)
Why I did it
Keysight provide a new version with some snappi API source code related fix: snappi[ixnetwork,convergence]==0.7.44

How I did it
Upgrade snappi version to 0.7.44

How to verify it
Whether it's installed in sonic-mgmt docker container
2022-07-06 16:59:19 +08:00
Oleksandr Kozodoi
c5849c9650
Add scapy support for python3 virtual environment in the sonic-mgmt docker container (#10234)
Why I did it
Migration of sonic-mgmt codebase from Python 2 to Python 3

How I did it
Added scapy dependencies to the env-python3 virtual environment.

How to verify it
Run test case:
py.test --testbed=testbed-t0 --inventory=../ansible/lab --testbed_file=../ansible/testbed.csv --host-pattern=testbed-t0 -- module-path=../ansible/library lldp

Signed-off-by: Oleksandr Kozodoi <oleksandrx.kozodoi@intel.com>
2022-03-16 12:00:51 +08:00
Shilong Liu
3fa627f290
Add a config variable to override default container registry instead of dockerhub. (#10166)
* Add variable to reset default docker registry
* fix bug in docker version control
2022-03-14 18:09:20 +08:00
xwjiang2021
b73da484c4
Install the allure-pytest package globally in sonic-mgmt docker (#10216)
Why I did it
This fix is to address issue: Azure/sonic-mgmt#5280

In the sonic-mgmt Dockerfile, python package allure-pytest is installed after ENV USER $user.
Consequently the package is installed to path /home/$user/.local and is only available to the $user
account. If we use root account in sonic-mgmt docker container to run tests, any script importing
the allure package will fail with ImportError. We need to install the allure-pytest package to global
directory instead of user local directory.

How I did it
Update the sonic-mgmt Dockerfile to ensure that the allure-pytest package is installed to global directory

How to verify it
Build a new sonic-mgmt docker image based on the changes.
Use sonic-mgmt docker container of the newly built image to run test scripts that depend on the
allure-pytest package. No ImportError is raised.
2022-03-12 20:18:12 +08:00
Oleksandr Kozodoi
3fa18d18d4
Add necessary changes for python3 virtual environment of sonic-mgmt docker container (#9277)
This PR includes necessary changes for the setup of the Python3 virtual environment in the sonic-mgmt docker container.

How to activate Python3 virtual environment?
Connect to the sonic-mgmt container
$ docker exec -ti sonic-mgmt bash
Activate the virtual environment
$ source /var/user/env-python3/bin/activate

Why I did it
Migration of sonic-mgmt codebase from Python 2 to Python 3

How I did it
Added all necessary dependencies to the env-python3 virtual environment.

Signed-off-by: Oleksandr Kozodoi <oleksandrx.kozodoi@intel.com>
2022-03-09 12:28:01 +08:00
DINESH KUMAR SELLAPPAN
d9b1577675
Support for Statistics Python Module in sonic-mgmt docker image (#9682)
This PR includes the support for statistics module in sonic-mgmt docker image
2022-01-25 10:32:22 +08:00
Shilong Liu
36d866002a
[build] Fix docker-sonic-mgmt pylint dependency lazy-object-proxy version (#9596) 2021-12-24 10:42:37 +08:00
Ze Gan
79b8ff52b0
[sonic-mgmt]: Upgrade scapy (#8554)
* Upgrade scapy

Signed-off-by: Ze Gan <ganze718@gmail.com>

* Add scapy version

Signed-off-by: Ze Gan <ganze718@gmail.com>
2021-11-24 10:07:50 +08:00
DINESH KUMAR SELLAPPAN
31a647a72d
[docker-sonic-mgmt]: Snappi version to 0.5.11 (#8790) 2021-09-23 02:12:12 -07:00
richardyu
479f61404b
Add thrift in the docker-sonic-mgmt (#8623)
Co-authored-by: richardyu-ms <richard.yu@microsoft.com>
2021-08-31 19:20:06 -07:00
slutati1536
de43c6a163
Added retry to sonic-mgmt docker container (#7997)
Why I did it
the motivation for this PR is to add retry_call to several test cases in the community, for example, the following cases:

test_show_platform_fanstatus_mocked
test_show_platform_temperature_mocked
are executing a command once and comparing the output to the expected mock data,
sometimes differences between the mock and the actual are causing the tests to fail.

retry will make these tests more stable.
retry will also be more efficient than sleep which will cause the tests to run longer because sometimes it is not necessary to sleep all that time, retry will only run a function only until it passed.

How I did it
added retry to the docker file

How to verify it
I run the tests with retry on the docker after installing the retry package

Signed-off-by: Sharon Lutati <slutati@nvidia.com>
2021-07-20 09:28:10 -07:00
thomas.cappleman@metaswitch.com
101b1fa08b
[build]: Fix sonic-cfggen contextlib err (#7996)
A recent version of contextlib2 (https://pypi.org/project/contextlib2/21.6.0/#history) has broken Python2 compatibility, so the version picked up by netaddr when using Python2 must be specified, or else builds fail

Co-authored-by: Tom Zhu <tom.zhu@metaswitch.com>
2021-06-28 17:15:03 -07:00
ppikh
3ad4f79fea
[sonic-mgmt docker]: Added allure-pytest library to sonic-mgmt docker container (#7665)
* Modified Dockerfile.j2 - added allure-pytest library

Signed-off-by: Petro Pikh <petrop@nvidia.com>
2021-06-02 08:42:30 -07:00
Wei Bai
3967c28a76
[docker-sonic-mgmt]: Upgrade Tgen version in SONiC mgmt docker (#7472) 2021-04-29 12:31:46 -07:00
Xin Wang
a7e1f7cbad
[docker-sonic-mgmt]: Install aiohttp package to sonic-mgmt docker (#7429)
The aiohttp package is required by azure.kusto.data which is used by  sonic-mgmt/test_reporting.
This change is to ensure that the dependent package is installed in the sonic-mgmt docker.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
2021-04-26 23:38:16 -07:00
ajbalogh
990b1127a7
[docker-sonic-mgmt] update version of ixnetwork client packages (#7242)
* Why I did it
Upgrade to the latest ixnetwork-restpy and ixnetwork-open-traffic-generator pypi packages

* How I did it
Updated the pip install entries for the packages in the Dockerfile.j2

* How to verify it
pip show ixnetwork-restpy
pip show ixnetwork-open-traffic-generator

Co-authored-by: Neetha John <nejo@microsoft.com>
2021-04-23 10:17:19 -07:00
ANISH-GOTTAPU
e858d6e346
adding snappi to docker (#7292)
For the migration of tests that involves tgen from abstract to snappi, snappi library is needed
2021-04-15 08:24:31 -07:00
Ying Xie
070b020bc3
[sonic-mgmt docker] pin cryptography version to 3.3.2 (#7009)
Why I did it
sonic-mgmt-docker build was failing.

How I did it
pin cryptography version to 3.3.2

How to verify it
build sonic-mgmt docker.
2021-03-10 19:15:11 -08:00
Wei Bai
8939202f67
[docker-sonic-mgmt]: Upgrade Tgen API from 0.0.42 to 0.0.70 (#6275)
Tgen API 0.0.42 has many problems. We have fixed them in 0.0.70.
2020-12-24 01:53:31 -08:00
ajbalogh
a9fc866ba5
dockers/docker-sonic-mgmt/Dockerfile.js: Add keysight ixnetwork-open-… (#5762)
*Why I did it
Provide access to the ixnetwork-open-traffic-generator pypi package

*How I did it
Added a pip install entry for the package in the Dockerfile.j2

*How to verify it
pip show ixnetwork-open-traffic-generator

*Description for the changelog
Install of ixnetwork-open-traffic-generator pypi package is required for proposed rdma tests.
2020-11-09 14:12:39 -08:00
Danny Allen
a56ad41b9e
[mgmt] Install dhclient in sonic-mgmt docker (#5447)
Signed-off-by: Danny Allen <daall@microsoft.com>
2020-09-23 20:01:58 -07:00
Danny Allen
7eda531ffd
[mgmt] Install ip command in mgmt docker (#5430)
Signed-off-by: Danny Allen <daall@microsoft.com>
2020-09-22 18:39:14 -07:00
Danny Allen
9feba88455
[mgmt] Fix Azure CLI install behind proxy (#5407)
Signed-off-by: Danny Allen <daall@microsoft.com>
2020-09-22 09:37:03 -07:00
Danny Allen
2868a27935
[mgmt] Upgrade sonic-mgmt container to stretch (#5397)
- Bump sonic-mgmt version to 18.04
- Update installation methods
- Add virtualenv for python3

Signed-off-by: Danny Allen <daall@microsoft.com>
2020-09-17 22:00:32 -07:00
Ying Xie
d499a266c0 [mgmt docker] move pycryptodome installation to the end of the docker building (#4917)
* [mgmt docker] move pycryptodome installation to the end of the docker building

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* pin down the version to current: 3.9.8

* comment
2020-07-12 18:08:52 +00:00
Ying Xie
6f11833ffa Revert "[sonic mgmt docker] lock pycryptodome version to 3.9.7 (#4913)" (#4915)
This reverts commit f427d2eecf.
2020-07-12 18:08:51 +00:00
Ying Xie
caa3323e9d [sonic mgmt docker] lock pycryptodome version to 3.9.7 (#4913)
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
2020-07-12 18:08:51 +00:00
Shuba Viswanathan
921d132a32
[sonic-mgmt]: Support for pytest-html to control logs better (#4791)
The current stdout file which also includes the dut logs are very verbose and noisy.

We have manually installed it in the sonic-mgmt docker in our organization and tuned the pytest settings to produce very helpful and concise logs.

pytest-html plugins can be used to post-process the output in various ways based on our different and unique organizational needs.

Hence proposing to add this pkt to the docker file
2020-06-25 17:45:16 -07:00
Danny Allen
364511aa36
[mgmt docker] Clean up docker-sonic-mgmt dockerfile (#4759)
- Alphabetize dependencies to prevent duplicates
- Remove unneccesary git clone

Signed-off-by: Danny Allen <daall@microsoft.com>
2020-06-16 11:32:25 -07:00
Arun Saravanan Balachandran
a748daeaed
[docker-sonic-mgmt]: import patch to support 'become' and 'become_user' arguments in pytest-ansible (#4681) 2020-06-12 16:21:10 -07:00
Ying Xie
4b39193a13
[sonic-mgmt] upgrade ansible to 2.7.12 (#4751)
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
2020-06-11 23:23:27 -07:00
Ying Xie
2e93a92bd9
[sonic-mgmt] upgrade paramilo to version 2.7.1 (#4750)
spytest requires higher paramiko version. Fix it to 2.7.1.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
2020-06-11 14:04:51 -07:00
Guohan Lu
767152f09b [docker-sonic-mgmt]: fix pip version to 20.1.1
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2020-05-26 10:29:13 +00:00
Wei Bai
46ef6defa7
[docker-sonic-mgmt] Add IxNetwork python client (#4533)
* Add IxNetwork python client to sonic mgmt docker
2020-05-05 18:40:20 -07:00
Danny Allen
4f8f1d45e4
[docker-sonic-mgmt] Merge spytest dependencies into mgmt docker (#4411)
Signed-off-by: Danny Allen <daall@microsoft.com>
2020-04-12 13:35:28 -07:00
xumia
78b93a8897
[docker-sonic-mgmt]: Fix virtual environment bug (#4370) 2020-04-04 18:17:55 -07:00
xumia
2c97321545
[sonic-mgmt]: Support virtual environment for ansible 2.0.0.2 (#4325)
. env-201811/bin/activate

The ansible 2.0.0.2 will be used.
2020-03-30 17:50:57 -07:00