Project

General

Profile

Actions

Bug #5497

closed

Jenkins CI job for pySim spends more time installing dependencies than actual testing

Added by laforge 10 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
03/27/2022
Due date:
% Done:

100%

Spec Reference:

Description

While debugging an issue I was following the jenkins build log in realtime and discovered that this is taking quite a lot of time downloading and installing python dependencies on each test execution.

We should try to have at least everything pre-installed that has debian has distribution packages.

https://jenkins.osmocom.org/jenkins/job/gerrit-pysim/1819/a1=default,a2=default,a3=default,a4=default,label=simtester/console

Requirement already satisfied: pylint in ./venv/lib/python3.7/site-packages (2.13.1)
Requirement already satisfied: typing-extensions>=3.10.0 in ./venv/lib/python3.7/site-packages (from pylint) (4.1.1)
Requirement already satisfied: dill>=0.2 in ./venv/lib/python3.7/site-packages (from pylint) (0.3.4)
Requirement already satisfied: tomli>=1.1.0 in ./venv/lib/python3.7/site-packages (from pylint) (2.0.1)
Requirement already satisfied: isort<6,>=4.2.5 in ./venv/lib/python3.7/site-packages (from pylint) (5.10.1)
Requirement already satisfied: astroid<=2.12.0-dev0,>=2.11.0 in ./venv/lib/python3.7/site-packages (from pylint) (2.11.2)
Requirement already satisfied: mccabe<0.8,>=0.6 in ./venv/lib/python3.7/site-packages (from pylint) (0.7.0)
Requirement already satisfied: platformdirs>=2.2.0 in ./venv/lib/python3.7/site-packages (from pylint) (2.5.1)
Requirement already satisfied: setuptools>=20.0 in ./venv/lib/python3.7/site-packages (from astroid<=2.12.0-dev0,>=2.11.0->pylint) (61.1.1)
Requirement already satisfied: wrapt<2,>=1.11 in ./venv/lib/python3.7/site-packages (from astroid<=2.12.0-dev0,>=2.11.0->pylint) (1.14.0)
Requirement already satisfied: lazy-object-proxy>=1.4.0 in ./venv/lib/python3.7/site-packages (from astroid<=2.12.0-dev0,>=2.11.0->pylint) (1.7.1)
Requirement already satisfied: typed-ast<2.0,>=1.4.0 in ./venv/lib/python3.7/site-packages (from astroid<=2.12.0-dev0,>=2.11.0->pylint) (1.5.2)

Collecting sphinx
  Using cached Sphinx-4.4.0-py3-none-any.whl (3.1 MB)

Collecting sphinxcontrib-serializinghtml>=1.1.5
  Using cached sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl (94 kB)
Collecting sphinxcontrib-applehelp
  Using cached sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl (121 kB)
Collecting imagesize
  Using cached imagesize-1.3.0-py2.py3-none-any.whl (5.2 kB)
Requirement already satisfied: Pygments>=2.0 in /usr/lib/python3/dist-packages (from sphinx) (2.3.1)
Collecting sphinxcontrib-jsmath
  Using cached sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl (5.1 kB)
Requirement already satisfied: docutils<0.18,>=0.14 in /usr/lib/python3/dist-packages (from sphinx) (0.14)
Collecting packaging
  Using cached packaging-21.3-py3-none-any.whl (40 kB)

Collecting importlib-metadata>=4.4
  Using cached importlib_metadata-4.11.3-py3-none-any.whl (18 kB)
Collecting Jinja2>=2.3

  Downloading Jinja2-3.1.1-py3-none-any.whl (132 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 132.6/132.6 KB 1.8 MB/s eta 0:00:00
Collecting alabaster<0.8,>=0.7
  Using cached alabaster-0.7.12-py2.py3-none-any.whl (14 kB)
Collecting snowballstemmer>=1.1
  Using cached snowballstemmer-2.2.0-py2.py3-none-any.whl (93 kB)
Collecting sphinxcontrib-qthelp
  Using cached sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl (90 kB)

Collecting requests>=2.5.0
  Using cached requests-2.27.1-py2.py3-none-any.whl (63 kB)
Collecting babel>=1.3
  Using cached Babel-2.9.1-py2.py3-none-any.whl (8.8 MB)

Collecting sphinxcontrib-devhelp
  Using cached sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl (84 kB)
Collecting sphinxcontrib-htmlhelp>=2.0.0
  Using cached sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl (100 kB)

Collecting pytz>=2015.7
  Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 503.5/503.5 KB 6.1 MB/s eta 0:00:00
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=4.4->sphinx) (3.4.1)
Requirement already satisfied: typing-extensions>=3.6.4 in ./venv/lib/python3.7/site-packages (from importlib-metadata>=4.4->sphinx) (4.1.1)

Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)

Collecting idna<4,>=2.5
  Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting charset-normalizer~=2.0.0
  Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2021.10.8-py2.py3-none-any.whl (149 kB)

Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.0/139.0 KB 5.0 MB/s eta 0:00:00

Collecting pyparsing!=3.0.5,>=2.0.2
  Using cached pyparsing-3.0.7-py3-none-any.whl (98 kB)

Installing collected packages: snowballstemmer, pytz, certifi, alabaster, urllib3, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, pyparsing, MarkupSafe, importlib-metadata, imagesize, idna, charset-normalizer, babel, requests, packaging, Jinja2, sphinx

  Attempting uninstall: importlib-metadata
    Found existing installation: importlib-metadata 3.10.0
    Not uninstalling importlib-metadata at /usr/local/lib/python3.7/dist-packages, outside environment /home/jenkins/workspace/gerrit-pysim/a1/default/a2/default/a3/default/a4/default/label/simtester/venv
    Can't uninstall 'importlib-metadata'. No files were found to uninstall.

Successfully installed Jinja2-3.1.1 MarkupSafe-2.1.1 alabaster-0.7.12 babel-2.9.1 certifi-2021.10.8 charset-normalizer-2.0.12 idna-3.3 imagesize-1.3.0 importlib-metadata-4.11.3 packaging-21.3 pyparsing-3.0.7 pytz-2022.1 requests-2.27.1 snowballstemmer-2.2.0 sphinx-4.4.0 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 urllib3-1.26.9

Collecting sphinxcontrib-napoleon
  Using cached sphinxcontrib_napoleon-0.7-py2.py3-none-any.whl (17 kB)
Requirement already satisfied: six>=1.5.2 in /usr/lib/python3/dist-packages (from sphinxcontrib-napoleon) (1.12.0)
Collecting pockets>=0.3
  Using cached pockets-0.9.1-py2.py3-none-any.whl (26 kB)

Installing collected packages: pockets, sphinxcontrib-napoleon
Successfully installed pockets-0.9.1 sphinxcontrib-napoleon-0.7

Obtaining sphinx-argparse from git+https://github.com/osmocom/sphinx-argparse@master#egg=sphinx-argparse
  Cloning https://github.com/osmocom/sphinx-argparse (to revision master) to ./venv/src/sphinx-argparse
  Running command git clone --filter=blob:none --quiet https://github.com/osmocom/sphinx-argparse /home/jenkins/workspace/gerrit-pysim/a1/default/a2/default/a3/default/a4/default/label/simtester/venv/src/sphinx-argparse

  Resolved https://github.com/osmocom/sphinx-argparse to commit f62ee2b5e03fc07fa87526653800da589c9536d7

  Preparing metadata (setup.py): started

  Preparing metadata (setup.py): finished with status 'done'

Requirement already satisfied: sphinx>=1.2.0 in ./venv/lib/python3.7/site-packages (from sphinx-argparse) (4.4.0)
Requirement already satisfied: Jinja2>=2.3 in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (3.1.1)
Requirement already satisfied: snowballstemmer>=1.1 in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (2.2.0)
Requirement already satisfied: babel>=1.3 in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (2.9.1)
Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (2.0.0)
Requirement already satisfied: requests>=2.5.0 in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (2.27.1)
Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.5 in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (1.1.5)
Requirement already satisfied: Pygments>=2.0 in /usr/lib/python3/dist-packages (from sphinx>=1.2.0->sphinx-argparse) (2.3.1)
Requirement already satisfied: sphinxcontrib-jsmath in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (1.0.1)
Requirement already satisfied: importlib-metadata>=4.4 in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (4.11.3)
Requirement already satisfied: packaging in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (21.3)
Requirement already satisfied: alabaster<0.8,>=0.7 in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (0.7.12)
Requirement already satisfied: sphinxcontrib-qthelp in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (1.0.3)
Requirement already satisfied: imagesize in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (1.3.0)
Requirement already satisfied: docutils<0.18,>=0.14 in /usr/lib/python3/dist-packages (from sphinx>=1.2.0->sphinx-argparse) (0.14)
Requirement already satisfied: sphinxcontrib-devhelp in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (1.0.2)
Requirement already satisfied: sphinxcontrib-applehelp in ./venv/lib/python3.7/site-packages (from sphinx>=1.2.0->sphinx-argparse) (1.0.2)
Requirement already satisfied: pytz>=2015.7 in ./venv/lib/python3.7/site-packages (from babel>=1.3->sphinx>=1.2.0->sphinx-argparse) (2022.1)
Requirement already satisfied: typing-extensions>=3.6.4 in ./venv/lib/python3.7/site-packages (from importlib-metadata>=4.4->sphinx>=1.2.0->sphinx-argparse) (4.1.1)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=4.4->sphinx>=1.2.0->sphinx-argparse) (3.4.1)
Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.7/site-packages (from Jinja2>=2.3->sphinx>=1.2.0->sphinx-argparse) (2.1.1)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.7/site-packages (from requests>=2.5.0->sphinx>=1.2.0->sphinx-argparse) (2021.10.8)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./venv/lib/python3.7/site-packages (from requests>=2.5.0->sphinx>=1.2.0->sphinx-argparse) (1.26.9)
Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.7/site-packages (from requests>=2.5.0->sphinx>=1.2.0->sphinx-argparse) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./venv/lib/python3.7/site-packages (from requests>=2.5.0->sphinx>=1.2.0->sphinx-argparse) (2.0.12)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./venv/lib/python3.7/site-packages (from packaging->sphinx>=1.2.0->sphinx-argparse) (3.0.7)

Installing collected packages: sphinx-argparse
  Running setup.py develop for sphinx-argparse

Successfully installed sphinx-argparse
Actions #1

Updated by osmith 4 months ago

  • Status changed from New to In Progress
  • Assignee changed from osmith to roh
  • % Done changed from 0 to 80

This patch should fix it:
https://gerrit.osmocom.org/c/osmo-ci/+/29740

I couldn't test if it works, need permissions on the simtester server first. Assigning to roh for that.

Actions #2

Updated by roh 4 months ago

  • Assignee changed from roh to osmith

your key is in

Actions #3

Updated by osmith 3 months ago

  • % Done changed from 80 to 90

Done, see the ansible patch above.

I've noticed that this didn't change the execution time much however, it seems it spends most time running pylint and generating documentation, before running the actual tests.

To optimize the execution time, we could split up:
  • running tests
  • pylint / generating docs

into two jobs (e.g. via the job matrix we already use for the master builds), and run the pylint/docs part on a different jenkins node. Or possibly even split it up further by running pylint and docs in separate jobs.

Actions #4

Updated by fixeria 3 months ago

osmith wrote in #note-3:

To optimize the execution time, we could split up:
  • running tests
  • pylint / generating docs

sounds like a good idea to me!

pylint is indeed slow because it's a python project itself.

Actions #5

Updated by osmith 3 months ago

  • % Done changed from 90 to 60

I've started splitting it up. That reduces the time for the job running on simtester from 6-7 minutes to ~2 min.

Actions #7

Updated by osmith 3 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)