repo is caching wrong versions of pinned pip_install packages

Bug #1609056 reported by Logan V
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
High
Jesse Pretorius
Liberty
Fix Released
High
Jesse Pretorius
Mitaka
Fix Released
High
Jesse Pretorius

Bug Description

As illustrated below the repo is caching setuptools-25.1.3-py2.py3-none-any.whl when the global-requirement-pins.txt contains "setuptools==25.1.1", causing pip_install to fail when it uses the repo container as its index.

root@osdeploy-mitaka:~/osdeploy# lxc-attach -n `lxc-ls | grep repo` -- cat /var/log/repo/repo_builder.log | grep 'setuptools!=24.0.0,>=16.0'
Setting setuptools!=24.0.0,>=16.0 (from -c /var/www/repo/os-releases/13.3.1/requirements_constraints.txt (line 354)) extras to: ()

root@osdeploy-mitaka:~/osdeploy# lxc-attach -n `lxc-ls | grep repo` -- ls /var/www/repo/pools/setuptools
setuptools-25.1.3-py2.py3-none-any.whl

openstack-ansible/global-requirement-pins.txt:setuptools==25.1.1
openstack-ansible/playbooks/inventory/group_vars/hosts.yml: - setuptools==25.1.1
openstack-ansible/playbooks/inventory/group_vars/all_containers.yml: - setuptools==25.1.1
openstack-ansible/requirements.txt:setuptools>=16.0,!=24.0.0 # PSF/ZPL

pip_get_pip_options: >
  --no-index
  --find-links "{{ openstack_repo_url }}/os-releases/{{ openstack_release }}"
  --trusted-host "{{ openstack_repo_url | netloc_no_port }}"

TASK: [pip_install | Install PIP] *********************************************
failed: [aio1_galera_container-e7e30db5] => {"attempts": 3, "changed": true, "cmd": "python /opt/get-pip.py --no-index --find-links \"http://172.29.236.100:8181/os-releases/13.3.1\" --trusted-host \"172.29.236.100\" pip==8.1.2 setuptools==25.1.1 wheel==0.29.0", "delta": "0:00:01.356128", "end": "2016-08-02 16:44:01.585508", "failed": true, "rc": 1, "start": "2016-08-02 16:44:00.229380", "warnings": []}
stderr: Could not find a version that satisfies the requirement setuptools==25.1.1 (from versions: 25.1.3)
No matching distribution found for setuptools==25.1.1
stdout: Ignoring indexes: https://pypi.python.org/simple
Collecting pip==8.1.2
  Downloading http://172.29.236.100:8181/os-releases/13.3.1/pip-8.1.2-py2.py3-none-any.whl (1.2MB)
Collecting setuptools==25.1.1
msg: Task failed as maximum retries was encountered

  src: https://git.openstack.org/openstack/openstack-ansible-plugins
  version: 4f366c332d9f08472b3d04ca8de057f68ac2633b
  src: https://git.openstack.org/openstack/openstack-ansible-repo_build
  version: cff0a5592b783cf1d0dd6b3e5f0c4950b75e9ec5

OSA at stable/mitaka 5c8dd5bd8d7898ec7ce977d80c3699c8aa03233a

Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

Given requirements.txt with this content:
setuptools==25.1.1

And constraints.txt with this content:
setuptools<=25.1.3

The execution of 'pip wheel -r requirements.txt -c constraints.txt' results in setuptools 25.1.3 being downloaded, which is not what is expected.

Confirming this bug - we'll have to implement an overwrite of upper-constraints for anything in global-requirements-pins.txt to ensure that the requirements and constraints match.

Changed in openstack-ansible:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → newton-3
assignee: nobody → Jesse Pretorius (jesse-pretorius)
Revision history for this message
Logan V (loganv) wrote :

Workaround until this is fixed:

repo_build_upper_constraints_overrides: "{{ pip_packages }}"

Changed in openstack-ansible:
importance: Critical → High
Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

Unassigning from myself just in case someone else wants to pick this up before I do. If this is not resolved by tomorrow morning then I'll work up a patch.

Changed in openstack-ansible:
assignee: Jesse Pretorius (jesse-pretorius) → nobody
Changed in openstack-ansible:
assignee: nobody → Jesse Pretorius (jesse-pretorius)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-repo_build (master)

Fix proposed to branch: master
Review: https://review.openstack.org/350352

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

Reviewed: https://review.openstack.org/350352
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-repo_build/commit/?id=38d7faffa96aa2b03e718320f2dc281cc12029b8
Submitter: Jenkins
Branch: master

commit 38d7faffa96aa2b03e718320f2dc281cc12029b8
Author: Jesse Pretorius <email address hidden>
Date: Wed Aug 3 00:15:56 2016 +0100

    Fix repo constraints construction and package installation

    The current repo build process has the following issues:

    1. The constraints consruction doesn't properly handle two constraints
       which use the same name, but have different version specs. eg:
       ovs===2.5.0;python_version=='2.7'
       ovs===2.6.0.dev2;python_version=='3.4'
       This is a problem in both the constraints construction, and
       in the testing.

    2. The pip packages installed on the repo server in order to
       construct the repo do not respect the global pins or the upper
       constraint overrides.

    3. The constraints are selected based on the requirements specified.
       This makes the process unnecessarily complex and hard to test.

    4. The global pins are not applied to the constructed constraints,
       so the wrong packages get built and installed.

    5. The tests aren't thoroughly checking that the constraints are
       correct.

    This patch corrects all of these issues and hopefully makes the
    mechanism for constructing constraints more readily apparent, and
    therefore easier to maintain.

    Change-Id: If52d073d43081468e2faf2cd063c4b211c29994f
    Related-Bug: #1605846
    Closes-Bug: #1609056

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-repo_build (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/350576

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

Fix proposed to branch: liberty
Review: https://review.openstack.org/350605

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to openstack-ansible-plugins (stable/mitaka)

Related fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/350612

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-repo_build (master)

Reviewed: https://review.openstack.org/350654
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-repo_build/commit/?id=ca864e298dc9e1486a09ed37b1b438c14df50248
Submitter: Jenkins
Branch: master

commit ca864e298dc9e1486a09ed37b1b438c14df50248
Author: Jesse Pretorius <email address hidden>
Date: Wed Aug 3 16:40:51 2016 +0100

    Correct global_pins depth

    In https://review.openstack.org/350352 the repo_build process
    implemented the test vars and changes to the constraints build
    which caters properly for global pins, but the data set used
    was incorrectly mapped from the py_pkgs lookup output.

    This patch fixes the depth, tests and template to use the
    correct depth.

    Related-Bug: #1605846
    Closes-Bug: #1609056
    Change-Id: Ic8959fd27b4012d569aef1b9ddd1d7be40ed49e0

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to openstack-ansible-plugins (stable/mitaka)

Reviewed: https://review.openstack.org/350612
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-plugins/commit/?id=450d972f27a34a5ac0024a24fbc5b377c70aac10
Submitter: Jenkins
Branch: stable/mitaka

commit 450d972f27a34a5ac0024a24fbc5b377c70aac10
Author: Jesse Pretorius <email address hidden>
Date: Wed Aug 3 15:24:31 2016 +0100

    Backport py_pkgs changes from Newton

    A minimal backport of the Newton changes to the py_pkgs lookup
    plugin in order to support https://review.openstack.org/350576
    does not appear to be possible.

    This is therefore a complete backport of all changes.

    Related-Bug: #1605846
    Related-Bug: #1609056
    Needed-By: If52d073d43081468e2faf2cd063c4b211c29994f
    Change-Id: Ic473eb9de26a2a3b92e234851b8f731c0255976c

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/352095

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-repo_build (stable/mitaka)

Reviewed: https://review.openstack.org/350576
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-repo_build/commit/?id=ae56b67cc07ca5a1e2dd03c74b5049b5942f41cf
Submitter: Jenkins
Branch: stable/mitaka

commit ae56b67cc07ca5a1e2dd03c74b5049b5942f41cf
Author: Jesse Pretorius <email address hidden>
Date: Wed Aug 3 00:15:56 2016 +0100

    Fix repo constraints construction and package installation

    The current repo build process has the following issues:

    1. The constraints consruction doesn't properly handle two constraints
       which use the same name, but have different version specs. eg:
       ovs===2.5.0;python_version=='2.7'
       ovs===2.6.0.dev2;python_version=='3.4'
       This is a problem in the constraints construction.

    2. The pip packages installed on the repo server in order to
       construct the repo do not respect the global pins or the upper
       constraint overrides.

    3. The constraints are selected based on the requirements specified.
       This makes the process unnecessarily complex.

    4. The global pins are not applied to the constructed constraints,
       so the wrong packages get built and installed.

    This patch corrects all of these issues and hopefully makes the
    mechanism for constructing constraints more readily apparent, and
    therefore easier to maintain.

    Conflicts:
    >------tasks/repo_pre_build.yml
    >------tests/test-repo-build.yml
    >------tests/test-vars.yml

    This backport also includes corrections to the template from
    https://review.openstack.org/350654

    Depends-On: Ic473eb9de26a2a3b92e234851b8f731c0255976c
    Change-Id: If52d073d43081468e2faf2cd063c4b211c29994f
    Related-Bug: #1605846
    Closes-Bug: #1609056
    (cherry picked from commit 38d7faffa96aa2b03e718320f2dc281cc12029b8)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/mitaka)

Reviewed: https://review.openstack.org/352095
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=4273df8562d5892fc73f0be3be91f0a44bff2292
Submitter: Jenkins
Branch: stable/mitaka

commit 4273df8562d5892fc73f0be3be91f0a44bff2292
Author: Jesse Pretorius <email address hidden>
Date: Sun Aug 7 11:16:48 2016 -0500

    Update role SHA's to pull in upper-constraints fix

    This patch updates the role SHA's to ensure that the upper-constraints
    fixes are included in the next release.

    It also includes an update to the lxc_hosts role to change the default
    apt sources used due to issues with the Rackspace mirror.

    Related-Bug: #1605846
    Closes-Bug: #1609056
    Depends-On: Ic473eb9de26a2a3b92e234851b8f731c0255976c
    Depends-On: I294e1f8842fff1ad643db64b506b44f29204f8d0
    Depends-On: Ic473eb9de26a2a3b92e234851b8f731c0255976c
    Change-Id: If95779e1e626dfb9140b77fcf4ea6b00028c73d2

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (liberty)

Reviewed: https://review.openstack.org/350605
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=4c620fee1f509d15009fdc18c3ad53cac7bd5f69
Submitter: Jenkins
Branch: liberty

commit 4c620fee1f509d15009fdc18c3ad53cac7bd5f69
Author: Jesse Pretorius <email address hidden>
Date: Wed Aug 3 14:40:41 2016 +0100

    Fix repo constraints construction and package installation

    The current repo build process has the following issues:

    1. The constraints consruction doesn't properly handle two constraints
       which use the same name, but have different version specs. eg:
       ovs===2.5.0;python_version=='2.7'
       ovs===2.6.0.dev2;python_version=='3.4'
       This is a problem in the constraints construction.

    2. The pip packages installed on the repo server in order to
       construct the repo do not respect the global pins or the upper
       constraint overrides.

    3. The constraints are selected based on the requirements specified.
       This makes the process unnecessarily complex.

    4. The global pins are not applied to the constructed constraints,
       so the wrong packages get built and installed.

    This patch corrects all of these issues and hopefully makes the
    mechanism for constructing constraints more readily apparent, and
    therefore easier to maintain.

    This backport combines selective changes implemented in the
    following reviews:

    - Add logic to NOT build "proprietary" packages
      https://review.openstack.org/300505

    - Updated py_pkgs to index requirement files
      https://review.openstack.org/345448

    - Fix py_pkgs lookup to not include optional packages
      https://review.openstack.org/347834

    - Update py_pkgs to itemise global pins
      https://review.openstack.org/347930

    - Fix repo constraints construction and package installation
      https://review.openstack.org/350352

    - Correct global_pins depth
      https://review.openstack.org/350654

    Change-Id: If52d073d43081468e2faf2cd063c4b211c29994f
    Related-Bug: #1605846
    Closes-Bug: #1609056

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 13.3.1

This issue was fixed in the openstack/openstack-ansible 13.3.1 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible-repo_build 13.3.1

This issue was fixed in the openstack/openstack-ansible-repo_build 13.3.1 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 12.2.1

This issue was fixed in the openstack/openstack-ansible 12.2.1 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible-repo_build 14.0.0.0b3

This issue was fixed in the openstack/openstack-ansible-repo_build 14.0.0.0b3 development milestone.

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.