Merge "Recognize TOX_CONSTRAINTS_FILE as a valid constraints variable"

This commit is contained in:
Zuul 2020-11-06 12:12:34 +00:00 committed by Gerrit Code Review
commit ce0236573e
4 changed files with 18 additions and 6 deletions

View File

@ -26,9 +26,10 @@ Command::
Note:
- In order to cap requirements for installation, an ``upper_constraints_file``
setting is defined. This is consuming the ``UPPER_CONSTRAINTS_FILE`` env
var by default, to properly integrate with CI systems, and will default
to ``/opt/stack/requirements/upper-constraints.txt`` file if not present.
setting is defined. This is consuming the ``UPPER_CONSTRAINTS_FILE`` or
``TOX_CONSTRAINTS_FILE`` env var by default, to properly integrate with CI
systems, and will default to
``/opt/stack/requirements/upper-constraints.txt`` file if not present.
Manually test with Virtual Machines
===================================

View File

@ -50,7 +50,11 @@ git_url_root: https://opendev.org
reqs_git_url: "{{ git_url_root }}/openstack/requirements"
reqs_git_folder: "{{ git_root }}/requirements"
reqs_git_branch: "{{ git_branch }}"
upper_constraints_file: "{{ lookup('env', 'UPPER_CONSTRAINTS_FILE') | default(reqs_git_folder + '/upper-constraints.txt', True) }}"
upper_constraints_file: >-
{{ lookup('env', 'UPPER_CONSTRAINTS_FILE')
| default(lookup('env', 'TOX_CONSTRAINTS_FILE'), True)
| default(reqs_git_folder + '/upper-constraints.txt', True) }}
update_repos: true
force_update_repos: true

View File

@ -16,4 +16,7 @@ pip_install_delay: 10
reqs_git_folder: /opt/stack/requirements
state: present
version:
upper_constraints_file: "{{ lookup('env', 'UPPER_CONSTRAINTS_FILE') | default(reqs_git_folder + '/upper-constraints.txt', True) }}"
upper_constraints_file: >-
{{ lookup('env', 'UPPER_CONSTRAINTS_FILE')
| default(lookup('env', 'TOX_CONSTRAINTS_FILE'), True)
| default(reqs_git_folder + '/upper-constraints.txt', True) }}

View File

@ -13,6 +13,10 @@ export LANG=en_US.UTF-8
export VENV=${VENV:-/opt/stack/bifrost}
# NOTE(dtantsur): change this when creating a stable branch
BRANCH=${ZUUL_BRANCH:-master}
CONSTRAINTS_FILE=${UPPER_CONSTRAINTS_FILE:-${TOX_CONSTRAINTS_FILE:-https://releases.openstack.org/constraints/upper/$BRANCH}}
CHECK_CMD_PKGS=(
python3-devel
python3
@ -145,6 +149,6 @@ echo "Using Bindep to install binary dependencies"
bindep -b &> /dev/null || ${INSTALLER_CMD} $(bindep -b)
echo "Installing Python requirements"
${PIP} install -r "$(dirname $0)/../requirements.txt" -c ${UPPER_CONSTRAINTS_FILE:-https://releases.openstack.org/constraints/upper/master}
${PIP} install -r "$(dirname $0)/../requirements.txt" -c "${CONSTRAINTS_FILE}"
echo "Completed installation of basic dependencies."