diff options
| author | Zuul <zuul@review.opendev.org> | 2023-05-18 06:37:13 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2023-05-18 06:37:13 +0000 |
| commit | a3d30d559612505f4dff3cafc98ca885325586db (patch) | |
| tree | ec8d0b2ff2b50910c772f2fd34a72dbda880ea36 | |
| parent | ea951969550bfbcb3e42673a7f68f8556fd15409 (diff) | |
| parent | 7aa6450491644068300575062993c53b9413568d (diff) | |
| download | kolla-a3d30d559612505f4dff3cafc98ca885325586db.tar.gz kolla-a3d30d559612505f4dff3cafc98ca885325586db.zip | |
Merge "toolbox: use venv instead of virtualenv"
| -rw-r--r-- | docker/kolla-toolbox/Dockerfile.j2 | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2 index 118cdf1f2..def4792fc 100644 --- a/docker/kolla-toolbox/Dockerfile.j2 +++ b/docker/kolla-toolbox/Dockerfile.j2 @@ -5,8 +5,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% block kolla_toolbox_header %}{% endblock %} -{% set virtualenv_path='/opt/ansible' %} -{% set os_client_config= virtualenv_path + '/lib/python' + distro_python_version + '/site-packages/os_client_config/defaults.json' %} +{% set venv_path='/opt/ansible' %} +{% set os_client_config= venv_path + '/lib/python' + distro_python_version + '/site-packages/os_client_config/defaults.json' %} {% import "macros.j2" as macros with context %} @@ -54,18 +54,14 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% endif %} {{ macros.install_packages(kolla_toolbox_packages | customizable("packages")) }} -{% set kolla_toolbox_pip_virtualenv_packages = [ - ] %} - {% block kolla_toolbox_upper_constraints %} RUN mkdir -p /requirements \ && curl -o /requirements/upper-constraints.txt ${UPPER_CONSTRAINTS_FILE:-https://releases.openstack.org/constraints/upper/{{ openstack_release }}} \ && {{ macros.upper_constraints_remove("openstacksdk") }} \ - && {{ macros.install_pip(kolla_toolbox_pip_virtualenv_packages | customizable("pip_virtualenv_packages")) }} \ - && python3 -m venv --system-site-packages {{ virtualenv_path }} + && python3 -m venv --system-site-packages {{ venv_path }} {% endblock %} -ENV PATH {{ virtualenv_path }}/bin:$PATH +ENV PATH {{ venv_path }}/bin:$PATH {% set kolla_toolbox_pip_packages = [ 'ansible-core==2.14.*', @@ -85,7 +81,7 @@ COPY requirements.yml /var/lib/ansible/ RUN {{ macros.install_pip(['pip', 'wheel', 'setuptools']) }} \ && {{ macros.install_pip(kolla_toolbox_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/ansible /usr/share/ansible \ - && echo 'localhost ansible_connection=local ansible_python_interpreter={{ virtualenv_path }}/bin/python' > /etc/ansible/hosts \ + && echo 'localhost ansible_connection=local ansible_python_interpreter={{ venv_path }}/bin/python' > /etc/ansible/hosts \ && sed -i 's| "identity_api_version": "2.0",| "identity_api_version": "3",|' {{ os_client_config }} \ && for i in {1..5}; do ansible-galaxy collection install --timeout 120 -p /usr/share/ansible/collections -r /var/lib/ansible/requirements.yml \ && break || sleep 15; done |
