stx-tools: Dockerfile build fails (tox)

Bug #1960675 reported by Davlet Panech
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Davlet Panech

Bug Description

Brief Description
-----------------
stx-tools/Dockerfile fails to build. This doesn't happen on CENGN servers because the builder image is cached there.

Also: on CENGN tox in the cached image is broken and shows Python exceptions when invoked.

Severity
--------
Major

Steps to Reproduce
------------------
Clone starlingx/tools

cd tools
docker build -t test_build .

Expected Behavior
------------------
Build succeeds

Actual Behavior
----------------
Build fails

Reproducibility
---------------
Reproducible

System Configuration
--------------------
N/A

Branch/Pull Time/Commit
-----------------------
master/2022-02-11

Last Pass
---------
Unknown. Last "successful" build created a broken tox inside the image.

Timestamp/Logs
--------------

04:53:25 Step 28/52 : RUN pip install -c /home/$MYUNAME/builder-constraints.txt pbr==5.6.0 --upgrade && pip install -c /home/$MYUNAME/builder-constraints.txt git-review==2.1.0 --upgrade && pip install -c /home/$MYUNAME/builder-constraints.txt python-subunit==1.4.0 junitxml==0.7 testtools==2.4.0 --upgrade && pip install -c /home/$MYUNAME/builder-constraints.txt tox==3.23.0 --upgrade
[...]
04:53:37 Collecting tox==3.23.0
04:53:37 Downloading https://files.pythonhosted.org/packages/ec/7e/4609fd0386d41f0b94fe952708970fb87cc1fb66e088758b1f0ab336802e/tox-3.23.0-py2.py3-none-any.whl (85kB)
04:53:37 Collecting importlib-metadata>=0.12; python_version < "3.8" (from tox==3.23.0)
04:53:38 Downloading https://files.pythonhosted.org/packages/28/ac/befd6d793f230c17c366959f518a7fb2f38c0168b850944ec70ba0566271/importlib_metadata-4.11.0.tar.gz (42kB)
04:53:38 Complete output from command python setup.py egg_info:
04:53:38 Traceback (most recent call last):
04:53:38 File "<string>", line 1, in <module>
04:53:38 IOError: [Errno 2] No such file or directory: '/tmp/pip-build-Izey6h/importlib-metadata/setup.py'
04:53:38
04:53:38 ----------------------------------------
04:53:38 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Izey6h/importlib-metadata/

Test Activity
-------------
N/A

Workaround
----------
None

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tools (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/tools/+/828928

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tools (master)

Reviewed: https://review.opendev.org/c/starlingx/tools/+/828928
Committed: https://opendev.org/starlingx/tools/commit/eec9163e0e51db48424bc6397b44b70bcb55d331
Submitter: "Zuul (22348)"
Branch: master

commit eec9163e0e51db48424bc6397b44b70bcb55d331
Author: Davlet Panech <email address hidden>
Date: Fri Feb 11 16:34:37 2022 -0500

    Dockerfile: install tox in its own virtualenv

    Fix multiple problems with python modules that cause build errors.

    * Avoid replacing RPM-owned python modules with pip:
      - Remove python-tox: installed via pip later in Dockerfile
      - Remove python-testrepository: installed via pip later in Dockerfile
        (required by pbr)
      - Add python-virtualenv: was pulled in by one of the removed packages
        above

    * builder-constraints.txt: used only for global packages:
      - Move all version constraints of Dockerfile into constraints file
      - Remove filelock and platformdirs packages (required by tox -- see
        below).
      - git-review: downgrade to 1.28.0, latest official version compatible
        with python 2.7

    * Install a sane python 2.7 virtual environment that doesn't conflict
      with RPM modules, that includes tox. Create a symlink to tox in
      /usr/bin/. Uses a separate contraints file.

    * builder-opt-py27-constraints.txt: new file for the virtualenv in /opt:
      - tox==3.23.0
      - Remove "filelock" and "platformdirs" packages formerly in the
        original constraints file. They resolve correctly by the tox
        requirement. Note that this downgrades the packages slightly compared
        to the explicit requirements, back to the latest official versions
        compatible with python 2.7.

        See revisions starlingx/tools revisions:
            0d67f81bdff338c2f965a50aa3fccac08579ec60
            7bde482bcbee0d740446d7484a59d312e73e769b

    Closes-Bug: 1960675
    Signed-off-by: Davlet Panech <email address hidden>
    Change-Id: I7e3e7e4f4afa52a614cb9f58b2d6172441ea7bc1

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
tags: added: stx.7.0 stx.build
Changed in starlingx:
importance: Undecided → Medium
assignee: nobody → Davlet Panech (dpanech)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.