diff --git a/docker/aodh/aodh-base/Dockerfile.j2 b/docker/aodh/aodh-base/Dockerfile.j2 index fb74d296fe..0b04a6486a 100644 --- a/docker/aodh/aodh-base/Dockerfile.j2 +++ b/docker/aodh/aodh-base/Dockerfile.j2 @@ -63,8 +63,13 @@ RUN mkdir -p /var/www/cgi-bin/aodh \ ADD aodh-base-archive /aodh-base-source +{% set aodh_base_pip_packages = [ + 'pymongo', + '/aodh' +] %} + RUN ln -s aodh-base-source/* aodh \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt pymongo /aodh \ + && {{ macros.install_pip(aodh_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/aodh /var/www/cgi-bin/aodh \ && cp -r /aodh/etc/aodh/* /etc/aodh/ \ && cp /aodh/aodh/api/app.wsgi /var/www/cgi-bin/aodh \ diff --git a/docker/barbican/barbican-base/Dockerfile.j2 b/docker/barbican/barbican-base/Dockerfile.j2 index 7b6286235f..d96027d2f2 100644 --- a/docker/barbican/barbican-base/Dockerfile.j2 +++ b/docker/barbican/barbican-base/Dockerfile.j2 @@ -25,9 +25,17 @@ MAINTAINER {{ maintainer }} {{ macros.install_packages(barbican_base_packages | customizable("packages")) }} +{% set barbican_base_pip_packages = [ + 'pastedeploy', + 'uwsgi', + 'MySQL-python' , + 'python-barbicanclient' , + '/barbican' +] %} + ADD barbican-base-archive /barbican-base-source RUN ln -s barbican-base-source/* barbican \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt pastedeploy uwsgi MySQL-python python-barbicanclient /barbican \ + && {{ macros.install_pip(barbican_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/barbican \ && cp -r /barbican/etc/barbican/* /etc/barbican/ \ && chown -R barbican: /etc/barbican diff --git a/docker/bifrost/bifrost-base/Dockerfile.j2 b/docker/bifrost/bifrost-base/Dockerfile.j2 index 796b063189..1d7c69d8b8 100644 --- a/docker/bifrost/bifrost-base/Dockerfile.j2 +++ b/docker/bifrost/bifrost-base/Dockerfile.j2 @@ -15,10 +15,14 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' && /bin/fa ENV VENV /var/lib/kolla/venv +{% set bifrost_base_pip_packages = [ + '/bifrost' +] %} + ADD bifrost-base-archive /bifrost-base-source COPY build_arg.yml /tmp/build_arg.yml RUN ln -s bifrost-base-source/* bifrost \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /bifrost + && {{ macros.install_pip(bifrost_base_pip_packages | customizable("pip_packages")) }} WORKDIR /bifrost diff --git a/docker/ceilometer/ceilometer-base/Dockerfile.j2 b/docker/ceilometer/ceilometer-base/Dockerfile.j2 index 65af7e51cb..272a47bcc3 100644 --- a/docker/ceilometer/ceilometer-base/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-base/Dockerfile.j2 @@ -27,9 +27,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} +{% set ceilometer_base_pip_packages = [ + '/ceilometer[gnocchi,mongo,mysql]' +] %} + ADD ceilometer-base-archive /ceilometer-base-source RUN ln -s ceilometer-base-source/* ceilometer \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /ceilometer[gnocchi,mongo,mysql] \ + && {{ macros.install_pip(ceilometer_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/ceilometer \ && cp -r /ceilometer/etc/ceilometer/* /etc/ceilometer/ \ && chown -R ceilometer: /etc/ceilometer \ diff --git a/docker/ceilometer/ceilometer-compute/Dockerfile.j2 b/docker/ceilometer/ceilometer-compute/Dockerfile.j2 index 6c793b4909..cae5100350 100644 --- a/docker/ceilometer/ceilometer-compute/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-compute/Dockerfile.j2 @@ -32,7 +32,12 @@ MAINTAINER {{ maintainer }} {% endif %} {{ macros.install_packages(ceilometer_compute_packages | customizable("packages")) }} -RUN /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt libvirt-python + +{% set ceilometer_compute_pip_packages = [ + 'libvirt-python' +] %} + +RUN {{ macros.install_pip(ceilometer_compute_pip_packages | customizable("pip_packages")) }} {% endif %} diff --git a/docker/cinder/cinder-base/Dockerfile.j2 b/docker/cinder/cinder-base/Dockerfile.j2 index 5f08bb0525..531637b764 100644 --- a/docker/cinder/cinder-base/Dockerfile.j2 +++ b/docker/cinder/cinder-base/Dockerfile.j2 @@ -40,9 +40,13 @@ MAINTAINER {{ maintainer }} {% endif %} {{ macros.install_packages(cinder_base_packages | customizable("packages")) }} +{% set cinder_base_pip_packages = [ + '/cinder' +] %} + ADD cinder-base-archive /cinder-base-source RUN ln -s cinder-base-source/* cinder \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /cinder \ + && {{ macros.install_pip(cinder_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/cinder \ && cp -r /cinder/etc/cinder/* /etc/cinder/ \ && chown -R cinder: /etc/cinder \ diff --git a/docker/cloudkitty/cloudkitty-base/Dockerfile.j2 b/docker/cloudkitty/cloudkitty-base/Dockerfile.j2 index 18d017e237..c9976c80bf 100644 --- a/docker/cloudkitty/cloudkitty-base/Dockerfile.j2 +++ b/docker/cloudkitty/cloudkitty-base/Dockerfile.j2 @@ -25,9 +25,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} +{% set cloudkitty_base_pip_packages = [ + '/cloudkitty' +] %} + ADD cloudkitty-base-archive /cloudkitty-base-source RUN ln -s cloudkitty-base-source/* cloudkitty \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /cloudkitty \ + && {{ macros.install_pip(cloudkitty_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/cloudkitty \ && cp -r /cloudkitty/etc/cloudkitty/* /etc/cloudkitty/ \ && chown -R cloudkitty: /etc/cloudkitty diff --git a/docker/congress/congress-base/Dockerfile.j2 b/docker/congress/congress-base/Dockerfile.j2 index 5466df7645..59376fdfa4 100644 --- a/docker/congress/congress-base/Dockerfile.j2 +++ b/docker/congress/congress-base/Dockerfile.j2 @@ -27,9 +27,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} +{% set congress_base_pip_packages = [ + '/congress' +] %} + ADD congress-base-archive /congress-base-source RUN ln -s congress-base-source/* congress \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /congress \ + && {{ macros.install_pip(congress_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/congress \ && cp -r /congress/etc/* /etc/congress/ \ && chown -R congress: /etc/congress diff --git a/docker/designate/designate-base/Dockerfile.j2 b/docker/designate/designate-base/Dockerfile.j2 index 6976ed15c9..3932998300 100644 --- a/docker/designate/designate-base/Dockerfile.j2 +++ b/docker/designate/designate-base/Dockerfile.j2 @@ -39,9 +39,13 @@ RUN cp /etc/designate/policy.json /tmp/ \ {% endif %} {% elif install_type == 'source' %} +{% set designate_base_pip_packages = [ + '/designate' +] %} + ADD designate-base-archive /designate-base-source RUN ln -s designate-base-source/* designate \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /designate \ + && {{ macros.install_pip(designate_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/designate \ && cp -r /designate/etc/designate/* /etc/designate/ \ && mv /etc/designate/rootwrap.conf.sample /etc/designate/rootwrap.conf \ diff --git a/docker/dind/Dockerfile.j2 b/docker/dind/Dockerfile.j2 index da3ae5e7cc..4daa70e320 100644 --- a/docker/dind/Dockerfile.j2 +++ b/docker/dind/Dockerfile.j2 @@ -19,7 +19,12 @@ RUN /bin/true 'openssh-server' ] %} {{ macros.install_packages(dind_packages | customizable("packages")) }} -RUN pip --no-cache-dir install --upgrade docker-py + +{% set dind_pip_packages = [ + 'docker-py' +] %} + +RUN {{ macros.install_pip(dind_pip_packages | customizable("pip_packages"), constraints = false) }} {% endif %} diff --git a/docker/freezer/freezer-api/Dockerfile.j2 b/docker/freezer/freezer-api/Dockerfile.j2 index 1eab11b025..3e5fd5bbfc 100644 --- a/docker/freezer/freezer-api/Dockerfile.j2 +++ b/docker/freezer/freezer-api/Dockerfile.j2 @@ -33,8 +33,13 @@ RUN echo > /etc/apache2/ports.conf {% endif %} ADD freezer-api-archive /freezer-api-source + +{% set freezer_api_pip_packages = [ + '/freezer-api' +] %} + RUN ln -s freezer-api-source/* freezer-api \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /freezer-api \ + && {{ macros.install_pip(freezer_api_pip_packages | customizable("pip_packages")) }} \ && cp -r /freezer-api/etc/freezer/* /etc/freezer/ {% endif %} diff --git a/docker/freezer/freezer-base/Dockerfile.j2 b/docker/freezer/freezer-base/Dockerfile.j2 index 9c5e81bff0..8f138aa033 100644 --- a/docker/freezer/freezer-base/Dockerfile.j2 +++ b/docker/freezer/freezer-base/Dockerfile.j2 @@ -15,10 +15,15 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD freezer-base-archive /freezer-base-source + +{% set freezer_base_pip_packages = [ + '/freezer' +] %} + RUN ln -s freezer-base-source/* freezer \ && mkdir -p /etc/freezer \ && chown -R freezer: /etc/freezer \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /freezer \ + && {{ macros.install_pip(freezer_base_pip_packages | customizable("pip_packages")) }} \ && cp -r /freezer/etc/* /etc/freezer {% endif %} diff --git a/docker/glance/glance-base/Dockerfile.j2 b/docker/glance/glance-base/Dockerfile.j2 index a4c2c8b1b3..f4d972f090 100644 --- a/docker/glance/glance-base/Dockerfile.j2 +++ b/docker/glance/glance-base/Dockerfile.j2 @@ -33,8 +33,13 @@ MAINTAINER {{ maintainer }} {{ macros.install_packages(glance_base_packages | customizable("packages")) }} ADD glance-base-archive /glance-base-source + +{% set glance_base_pip_packages = [ + '/glance[cinder]' +] %} + RUN ln -s glance-base-source/* glance \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /glance[cinder] \ + && {{ macros.install_pip(glance_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/glance \ && cp -r /glance/etc/* /etc/glance/ \ && chown -R glance: /etc/glance diff --git a/docker/gnocchi/gnocchi-base/Dockerfile.j2 b/docker/gnocchi/gnocchi-base/Dockerfile.j2 index dfc7cbb1ec..13f1ac5a2e 100644 --- a/docker/gnocchi/gnocchi-base/Dockerfile.j2 +++ b/docker/gnocchi/gnocchi-base/Dockerfile.j2 @@ -61,8 +61,13 @@ RUN truncate -s 0 /etc/apache2/ports.conf {% endif %} ADD gnocchi-base-archive /gnocchi-base-source +{% set gnocchi_base_pip_packages = [ + 'gnocchiclient', + '/gnocchi[keystone,mysql,file,ceph]' +] %} + RUN ln -s gnocchi-base-source/* gnocchi \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /gnocchi[keystone,mysql,file,ceph] \ + && {{ macros.install_pip(gnocchi_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/gnocchi \ && chown -R gnocchi: /etc/gnocchi diff --git a/docker/heat/heat-base/Dockerfile.j2 b/docker/heat/heat-base/Dockerfile.j2 index 6a0a73f36d..b22290e38e 100644 --- a/docker/heat/heat-base/Dockerfile.j2 +++ b/docker/heat/heat-base/Dockerfile.j2 @@ -19,8 +19,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD heat-base-archive /heat-base-source + +{% set heat_base_pip_packages = [ + '/heat' +] %} + RUN ln -s heat-base-source/* heat \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /heat \ + && {{ macros.install_pip(heat_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/heat \ && cp -r /heat/etc/heat/* /etc/heat/ \ && chown -R heat: /etc/heat diff --git a/docker/helm-repository/Dockerfile.j2 b/docker/helm-repository/Dockerfile.j2 index eba2ab3b57..855941913e 100644 --- a/docker/helm-repository/Dockerfile.j2 +++ b/docker/helm-repository/Dockerfile.j2 @@ -38,7 +38,11 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ && python get-pip.py \ && rm get-pip.py -RUN pip install pyyaml +{% set helm_repository_pip_packages = [ + 'pyyaml' +] %} + +RUN {{ macros.install_pip(helm_repository_pip_packages | customizable("pip_packages"), constraints = false) }} RUN curl -Lo /tmp/helm-v${helm_version}-linux-amd64.tar.gz http://storage.googleapis.com/kubernetes-helm/helm-v${helm_version}-linux-amd64.tar.gz \ && sudo tar --strip-components 1 -C /usr/bin linux-amd64/helm -zxvf /tmp/helm-v${helm_version}-linux-amd64.tar.gz \ diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2 index d10338b5f5..86b1c4d58a 100644 --- a/docker/horizon/Dockerfile.j2 +++ b/docker/horizon/Dockerfile.j2 @@ -108,15 +108,24 @@ RUN echo > /etc/apache2/ports.conf \ ADD horizon-archive /horizon-source ADD plugins-archive / + +{% set horizon_pip_packages = [ + '/horizon' +] %} + +{% set horizon_plugins_pip_packages = [ + '/plugins/*' +] %} + RUN ln -s horizon-source/* horizon \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /horizon \ + && {{ macros.install_pip(horizon_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/openstack-dashboard \ && ln -s /etc/openstack-dashboard/local_settings /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py \ && cp -r /horizon/openstack_dashboard/conf/* /etc/openstack-dashboard/ \ && cp /horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings \ && cp /horizon/manage.py /var/lib/kolla/venv/bin/manage.py \ && if [ "$(ls /plugins)" ]; then \ - pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \ + {{ macros.install_pip(horizon_plugins_pip_packages) }}; \ fi \ && (cd /var/lib/kolla/venv/lib/python2.7/site-packages/horizon && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \ && (cd /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \ diff --git a/docker/ironic/ironic-base/Dockerfile.j2 b/docker/ironic/ironic-base/Dockerfile.j2 index a8e94fa21f..e192aba48c 100644 --- a/docker/ironic/ironic-base/Dockerfile.j2 +++ b/docker/ironic/ironic-base/Dockerfile.j2 @@ -19,8 +19,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD ironic-base-archive /ironic-base-source + +{% set ironic_base_pip_packages = [ + '/ironic' +] %} + RUN ln -s ironic-base-source/* ironic \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /ironic \ + && {{ macros.install_pip(ironic_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/ironic \ && cp -r /ironic/etc/ironic/* /etc/ironic/ \ && chown -R ironic: /etc/ironic \ diff --git a/docker/ironic/ironic-conductor/Dockerfile.j2 b/docker/ironic/ironic-conductor/Dockerfile.j2 index 5841c39016..6da367427b 100644 --- a/docker/ironic/ironic-conductor/Dockerfile.j2 +++ b/docker/ironic/ironic-conductor/Dockerfile.j2 @@ -71,7 +71,12 @@ MAINTAINER {{ maintainer }} 'parted' ] %} {% endif %} -RUN /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt -r /ironic/driver-requirements.txt + +{% set ironic_conductor_pip_packages = [ + '-r /ironic/driver-requirements.txt' +] %} + +RUN {{ macros.install_pip(ironic_conductor_pip_packages | customizable("pip_packages")) }} {% endif %} {{ macros.install_packages(ironic_conductor_packages | customizable("packages")) }} diff --git a/docker/ironic/ironic-inspector/Dockerfile.j2 b/docker/ironic/ironic-inspector/Dockerfile.j2 index d659eb7ff8..491531ba4b 100644 --- a/docker/ironic/ironic-inspector/Dockerfile.j2 +++ b/docker/ironic/ironic-inspector/Dockerfile.j2 @@ -25,9 +25,14 @@ MAINTAINER {{ maintainer }} {{ macros.install_packages(ironic_inspector_packages | customizable("packages")) }} ADD ironic-inspector-archive /ironic-inspector-source + +{% set ironic_inspector_pip_packages = [ + '/ironic-inspector' +] %} + RUN ln -s ironic-inspector-source/* ironic-inspector \ && mv /etc/ironic /etc/ironic-inspector \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /ironic-inspector \ + && {{ macros.install_pip(ironic_inspector_pip_packages | customizable("pip_packages")) }} \ && cp /ironic-inspector/rootwrap.conf /etc/ironic-inspector/ \ && cp -r /ironic-inspector/rootwrap.d/ /etc/ironic-inspector/ \ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/ironic-inspector/rootwrap.conf diff --git a/docker/karbor/karbor-base/Dockerfile.j2 b/docker/karbor/karbor-base/Dockerfile.j2 index 45e5663099..15c3552052 100644 --- a/docker/karbor/karbor-base/Dockerfile.j2 +++ b/docker/karbor/karbor-base/Dockerfile.j2 @@ -15,8 +15,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD karbor-base-archive /karbor-base-source + +{% set karbor_base_pip_packages = [ + '/karbor' +] %} + RUN ln -s karbor-base-source/* karbor \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /karbor \ + && {{ macros.install_pip(karbor_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/karbor \ && cp -r /karbor/etc/* /etc/karbor/ \ && chown -R karbor: /etc/karbor diff --git a/docker/keystone/keystone-base/Dockerfile.j2 b/docker/keystone/keystone-base/Dockerfile.j2 index 81e20def32..9b33a55554 100644 --- a/docker/keystone/keystone-base/Dockerfile.j2 +++ b/docker/keystone/keystone-base/Dockerfile.j2 @@ -62,8 +62,13 @@ RUN echo > /etc/apache2/ports.conf {% block keystone_source_install %} ADD keystone-base-archive /keystone-base-source + +{% set keystone_base_pip_packages = [ + '/keystone' +] %} + RUN ln -s keystone-base-source/* keystone \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /keystone \ + && {{ macros.install_pip(keystone_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/keystone /var/www/cgi-bin/keystone \ && cp -r /keystone/etc/* /etc/keystone/ \ && cp /var/lib/kolla/venv/bin/keystone-wsgi-admin /var/www/cgi-bin/keystone/admin \ diff --git a/docker/keystone/keystone/Dockerfile.j2 b/docker/keystone/keystone/Dockerfile.j2 index 18b549fb58..196874b1a5 100644 --- a/docker/keystone/keystone/Dockerfile.j2 +++ b/docker/keystone/keystone/Dockerfile.j2 @@ -3,12 +3,19 @@ MAINTAINER {{ maintainer }} {% block keystone_header %}{% endblock %} +{% import "macros.j2" as macros with context %} + ADD plugins-archive / COPY keystone_bootstrap.sh /usr/local/bin/kolla_keystone_bootstrap COPY extend_start.sh /usr/local/bin/kolla_extend_start + +{% set keystone_plugins_pip_packages = [ + '/plugins/*' +] %} + RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_keystone_bootstrap \ && if [ "$(ls /plugins)" ]; then \ - pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \ + {{ macros.install_pip(keystone_plugins_pip_packages | customizable("pip_packages")) }}; \ fi {% block keystone_footer %}{% endblock %} diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2 index 8f348cbfa0..16e6f9dc31 100644 --- a/docker/kolla-toolbox/Dockerfile.j2 +++ b/docker/kolla-toolbox/Dockerfile.j2 @@ -56,13 +56,16 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ && rm get-pip.py {% endblock %} -RUN pip --no-cache-dir install \ - pytz \ - ansible==2.1.1.0 \ - MySQL-python \ - os-client-config==1.16.0 \ - pyudev \ - shade==1.5.0 +{% set kolla_toolbox_pip_packages = [ + 'pytz', + 'ansible==2.1.1.0', + 'MySQL-python', + 'os-client-config==1.16.0', + 'pyudev', + 'shade==1.5.0' + ] %} + +RUN {{ macros.install_pip(kolla_toolbox_pip_packages | customizable("pip_packages"), constraints = false) }} RUN mkdir -p /etc/ansible /usr/share/ansible \ && echo 'localhost ansible_connection=local' > /etc/ansible/hosts \ diff --git a/docker/kuryr/kuryr-base/Dockerfile.j2 b/docker/kuryr/kuryr-base/Dockerfile.j2 index ece66c7d9d..5911d343ed 100644 --- a/docker/kuryr/kuryr-base/Dockerfile.j2 +++ b/docker/kuryr/kuryr-base/Dockerfile.j2 @@ -3,6 +3,8 @@ MAINTAINER {{ maintainer }} {% block kuryr_base_header %}{% endblock %} +{% import "macros.j2" as macros with context %} + {% if install_type == 'binary' %} RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ @@ -11,11 +13,16 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD kuryr-base-archive /kuryr-base-source + +{% set kuryr_base_pip_packages = [ + '/kuryr-base' +] %} + # NOTE(Jeffrey4l): remove kuryr-lib constraint in upper-constraints.txt file. # Otherwise, it will be failed. RUN ln -s kuryr-base-source/* kuryr-base \ && sed -i 's|^kuryr-lib===.*$||g' requirements/upper-constraints.txt \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /kuryr-base + && {{ macros.install_pip(kuryr_base_pip_packages | customizable("pip_packages")) }} {% endif %} diff --git a/docker/kuryr/kuryr-libnetwork/Dockerfile.j2 b/docker/kuryr/kuryr-libnetwork/Dockerfile.j2 index 1d9da60024..b153451c6c 100644 --- a/docker/kuryr/kuryr-libnetwork/Dockerfile.j2 +++ b/docker/kuryr/kuryr-libnetwork/Dockerfile.j2 @@ -3,6 +3,8 @@ MAINTAINER {{ maintainer }} {% block kuryr_libnetwork_header %}{% endblock %} +{% import "macros.j2" as macros with context %} + {% if install_type == 'binary' %} RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ @@ -11,8 +13,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD kuryr-libnetwork-archive /kuryr-libnetwork-source + +{% set kuryr_libnetwork_pip_packages = [ + '/kuryr-libnetwork' +] %} + RUN ln -s kuryr-libnetwork-source/* kuryr-libnetwork \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /kuryr-libnetwork + && {{ macros.install_pip(kuryr_libnetwork_pip_packages | customizable("pip_packages")) }} {% endif %} diff --git a/docker/macros.j2 b/docker/macros.j2 index b60b6eb971..143d15bcc6 100644 --- a/docker/macros.j2 +++ b/docker/macros.j2 @@ -14,8 +14,14 @@ {%- endmacro %} -{% macro install_pip(packages) %} -RUN /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt {% for package in packages %}{{ package }} {% endfor %} +{% macro install_pip(packages, constraints = true) %} +{%- if packages is sequence and packages|length > 0 -%} + pip --no-cache-dir install --upgrade{{ ' ' }} + {%- if constraints %}-c requirements/upper-constraints.txt {% endif -%} + {{ packages | join(' ') }} +{%- else -%} + true +{%- endif -%} {% endmacro %} diff --git a/docker/magnum/magnum-base/Dockerfile.j2 b/docker/magnum/magnum-base/Dockerfile.j2 index e81dd7c1e3..add797f69b 100644 --- a/docker/magnum/magnum-base/Dockerfile.j2 +++ b/docker/magnum/magnum-base/Dockerfile.j2 @@ -18,8 +18,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD magnum-base-archive /magnum-base-source + +{% set magnum_base_pip_packages = [ + '/magnum[osprofiler]' +] %} + RUN ln -s magnum-base-source/* magnum \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /magnum[osprofiler] \ + && {{ macros.install_pip(magnum_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/magnum \ && cp -r /magnum/etc/magnum/* /etc/magnum \ && chown -R magnum: /etc/magnum diff --git a/docker/manila/manila-base/Dockerfile.j2 b/docker/manila/manila-base/Dockerfile.j2 index 2231732629..c6b222debf 100644 --- a/docker/manila/manila-base/Dockerfile.j2 +++ b/docker/manila/manila-base/Dockerfile.j2 @@ -40,8 +40,13 @@ MAINTAINER {{ maintainer }} {{ macros.install_packages(manila_base_packages | customizable("packages")) }} ADD manila-base-archive /manila-base-source + +{% set manila_base_pip_packages = [ + '/manila' +] %} + RUN ln -s manila-base-source/* manila \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /manila \ + && {{ macros.install_pip(manila_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/manila /var/cache/manila \ && cp -r /manila/etc/manila/* /etc/manila/ \ && chown -R manila: /etc/manila /var/cache/manila \ diff --git a/docker/mistral/mistral-base/Dockerfile.j2 b/docker/mistral/mistral-base/Dockerfile.j2 index b2dca3c456..0d8ce7f394 100644 --- a/docker/mistral/mistral-base/Dockerfile.j2 +++ b/docker/mistral/mistral-base/Dockerfile.j2 @@ -19,8 +19,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD mistral-base-archive /mistral-base-source + +{% set mistral_base_pip_packages = [ + '/mistral' +] %} + RUN ln -s mistral-base-source/* mistral \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install /mistral \ + && {{ macros.install_pip(mistral_base_pip_packages | customizable("pip_packages"), constraints = false) }} \ && mkdir -p /etc/mistral \ && cp -r /mistral/etc/* /etc/mistral/ \ && chown -R mistral: /etc/mistral diff --git a/docker/monasca/monasca-api/Dockerfile.j2 b/docker/monasca/monasca-api/Dockerfile.j2 index 609722d60f..b0375641c5 100644 --- a/docker/monasca/monasca-api/Dockerfile.j2 +++ b/docker/monasca/monasca-api/Dockerfile.j2 @@ -13,8 +13,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD monasca-api-archive /monasca-api-source + +{% set monasca_api_pip_packages = [ + '/monasca-api' +] %} + RUN ln -s monasca-api-source/* monasca-api \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /monasca-api + && {{ macros.install_pip(monasca_api_pip_packages | customizable("pip_packages")) }} {% endif %} diff --git a/docker/monasca/monasca-log-api/Dockerfile.j2 b/docker/monasca/monasca-log-api/Dockerfile.j2 index 8c4d9a81e3..83c621c6dc 100644 --- a/docker/monasca/monasca-log-api/Dockerfile.j2 +++ b/docker/monasca/monasca-log-api/Dockerfile.j2 @@ -14,7 +14,7 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ ADD monasca-log-api-archive /monasca-log-api-source RUN ln -s monasca-log-api-source/* monasca-log \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /monasca-log + && {{ macros.install_pip(['/monasca-log'] | customizable("pip_packages")) }} {% endif %} diff --git a/docker/monasca/monasca-notification/Dockerfile.j2 b/docker/monasca/monasca-notification/Dockerfile.j2 index 2ca45bdb64..8433c98f1c 100644 --- a/docker/monasca/monasca-notification/Dockerfile.j2 +++ b/docker/monasca/monasca-notification/Dockerfile.j2 @@ -13,8 +13,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD monasca-notification-archive /monasca-notification-source + +{% set monasca_notification_pip_packages = [ + '/monasca-notification' +] %} + RUN ln -s monasca-notification-source/* monasca-notification \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /monasca-notification + && {{ macros.install_pip(monasca_notification_pip_packages | customizable("pip_packages")) }} {% endif %} diff --git a/docker/monasca/monasca-persister/Dockerfile.j2 b/docker/monasca/monasca-persister/Dockerfile.j2 index e9bce5b394..a48a46431f 100644 --- a/docker/monasca/monasca-persister/Dockerfile.j2 +++ b/docker/monasca/monasca-persister/Dockerfile.j2 @@ -13,8 +13,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD monasca-persister-archive /monasca-persister-source + +{% set monasca_persister_pip_packages = [ + '/monasca-persister' +] %} + RUN ln -s monasca-persister-source/* monasca-persister \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /monasca-persister + && {{ macros.install_pip(monasca_persister_pip_packages | customizable("pip_packages")) }} {% endif %} diff --git a/docker/monasca/monasca-statsd/Dockerfile.j2 b/docker/monasca/monasca-statsd/Dockerfile.j2 index 6399e1acd7..3320f4e2a8 100644 --- a/docker/monasca/monasca-statsd/Dockerfile.j2 +++ b/docker/monasca/monasca-statsd/Dockerfile.j2 @@ -13,10 +13,15 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD monasca-statsd-archive /monasca-statsd-source + +{% set monasca_statsd_pip_packages = [ + '/monasca-statsd' +] %} + # NOTE(SamYaple): <=1.3.0 do not have any packages in requirements.txt and that # breaks pip. So removing constraints file. RUN ln -s monasca-statsd-source/* monasca-statsd \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade /monasca-statsd + && {{ macros.install_pip(monasca_statsd_pip_packages | customizable("pip_packages"), constraints = false) }} {% endif %} diff --git a/docker/murano/murano-base/Dockerfile.j2 b/docker/murano/murano-base/Dockerfile.j2 index 5d6eeb1583..1e46e5514c 100644 --- a/docker/murano/murano-base/Dockerfile.j2 +++ b/docker/murano/murano-base/Dockerfile.j2 @@ -20,8 +20,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD murano-base-archive /murano-base-source + +{% set murano_base_pip_packages = [ + '/murano' +] %} + RUN ln -s murano-base-source/* murano \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /murano \ + && {{ macros.install_pip(murano_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/murano \ && cp -r /murano/etc/murano/* /etc/murano/ \ && chown -R murano: /etc/murano \ diff --git a/docker/neutron/neutron-base/Dockerfile.j2 b/docker/neutron/neutron-base/Dockerfile.j2 index d6ec683ea2..9b31eceefc 100644 --- a/docker/neutron/neutron-base/Dockerfile.j2 +++ b/docker/neutron/neutron-base/Dockerfile.j2 @@ -82,8 +82,17 @@ RUN mkdir -p /usr/share/neutron \ ADD neutron-base-archive /neutron-base-source ADD plugins-archive / + +{% set neutron_base_pip_packages = [ + '/neutron' +] %} + +{% set neutron_base_plugins_pip_packages = [ + '/plugins/*' +] %} + RUN ln -s neutron-base-source/* neutron \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /neutron \ + && {{ macros.install_pip(neutron_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/neutron /usr/share/neutron \ && cp -r /neutron/etc/* /etc/neutron/ \ && cp -r /neutron/etc/neutron/* /etc/neutron/ \ @@ -92,7 +101,7 @@ RUN ln -s neutron-base-source/* neutron \ && chown -R neutron: /etc/neutron /usr/share/neutron \ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/neutron/rootwrap.conf \ && if [ "$(ls /plugins)" ]; then \ - pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \ + {{ macros.install_pip(neutron_base_plugins_pip_packages) }}; \ fi {% endif %} diff --git a/docker/neutron/neutron-lbaas-agent/Dockerfile.j2 b/docker/neutron/neutron-lbaas-agent/Dockerfile.j2 index b84b498e7d..79694dc497 100644 --- a/docker/neutron/neutron-lbaas-agent/Dockerfile.j2 +++ b/docker/neutron/neutron-lbaas-agent/Dockerfile.j2 @@ -33,8 +33,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD neutron-lbaas-agent-archive /neutron-lbaas-agent-source + +{% set neutron_lbaas_agent_pip_packages = [ + '/neutron_lbaas' +] %} + RUN ln -s neutron-lbaas-agent-source/* neutron_lbaas \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /neutron_lbaas \ + && {{ macros.install_pip(neutron_lbaas_agent_pip_packages | customizable("pip_packages")) }} \ && cp /neutron_lbaas/etc/neutron/rootwrap.d/* /etc/neutron/rootwrap.d \ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/neutron/rootwrap.conf diff --git a/docker/neutron/neutron-server/Dockerfile.j2 b/docker/neutron/neutron-server/Dockerfile.j2 index dd6d03bf34..05b65f7a89 100644 --- a/docker/neutron/neutron-server/Dockerfile.j2 +++ b/docker/neutron/neutron-server/Dockerfile.j2 @@ -27,10 +27,15 @@ MAINTAINER {{ maintainer }} {{ macros.install_packages(neutron_server_packages | customizable("packages")) }} ADD plugins-archive / + +{% set neutron_server_plugins_pip_packages = [ + '/plugins/*' +] %} + COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start \ && if [ "$(ls /plugins)" ]; then \ - pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \ + {{ macros.install_pip(neutron_server_plugins_pip_packages | customizable("pip_packages")) }}; \ fi {% block neutron_server_footer %}{% endblock %} diff --git a/docker/neutron/neutron-sfc-agent/Dockerfile.j2 b/docker/neutron/neutron-sfc-agent/Dockerfile.j2 index cdd0b555cc..9e1cb16029 100644 --- a/docker/neutron/neutron-sfc-agent/Dockerfile.j2 +++ b/docker/neutron/neutron-sfc-agent/Dockerfile.j2 @@ -3,6 +3,8 @@ MAINTAINER {{ maintainer }} {% block neutron_networking_sfc_agent_header %}{% endblock %} +{% import "macros.j2" as macros with context %} + {% if install_type == 'binary' %} RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ @@ -11,8 +13,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD neutron-sfc-agent-archive /neutron-sfc-agent-source + +{% set neutron_sfc_agent_pip_packages = [ + '/neutron-sfc-agent' +] %} + RUN ln -s neutron-sfc-agent-source/* neutron-sfc-agent \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /neutron-sfc-agent + && {{ macros.install_pip(neutron_sfc_agent_pip_packages | customizable("pip_packages")) }} {% endif %} diff --git a/docker/neutron/neutron-vpnaas-agent/Dockerfile.j2 b/docker/neutron/neutron-vpnaas-agent/Dockerfile.j2 index c995cee0e6..fadfa2ca06 100644 --- a/docker/neutron/neutron-vpnaas-agent/Dockerfile.j2 +++ b/docker/neutron/neutron-vpnaas-agent/Dockerfile.j2 @@ -35,8 +35,13 @@ MAINTAINER {{ maintainer }} {{ macros.install_packages(neutron_vpnaas_agent_packages | customizable("packages")) }} ADD neutron-vpnaas-agent-archive /neutron-vpnaas-agent-source + +{% set neutron_vpnaas_agent_pip_packages = [ + '/neutron_vpnaas' +] %} + RUN ln -s neutron-vpnaas-agent-source/* neutron_vpnaas \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /neutron_vpnaas \ + && {{ macros.install_pip(neutron_vpnaas_agent_pip_packages | customizable("pip_packages")) }} \ && cp /neutron_vpnaas/etc/neutron/rootwrap.d/* /etc/neutron/rootwrap.d {% endif %} diff --git a/docker/nova/nova-base/Dockerfile.j2 b/docker/nova/nova-base/Dockerfile.j2 index 13109388eb..9c3014ce0b 100644 --- a/docker/nova/nova-base/Dockerfile.j2 +++ b/docker/nova/nova-base/Dockerfile.j2 @@ -57,8 +57,13 @@ MAINTAINER {{ maintainer }} {{ macros.install_packages(nova_base_packages | customizable("packages")) }} ADD nova-base-archive /nova-base-source + +{% set nova_base_pip_packages = [ + '/nova' +] %} + RUN ln -s nova-base-source/* nova \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /nova \ + && {{ macros.install_pip(nova_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/nova/ \ && cp -r /nova/etc/nova/* /etc/nova/ \ && chown -R nova: /etc/nova/ \ diff --git a/docker/nova/nova-compute/Dockerfile.j2 b/docker/nova/nova-compute/Dockerfile.j2 index 0304c79541..925f6ba362 100644 --- a/docker/nova/nova-compute/Dockerfile.j2 +++ b/docker/nova/nova-compute/Dockerfile.j2 @@ -84,7 +84,7 @@ RUN mkdir -p /etc/ceph ] %} -{{ macros.install_pip(nova_compute_pip_packages | customizable("pip_packages")) }} +RUN {{ macros.install_pip(nova_compute_pip_packages | customizable("pip_packages")) }} {% endif %} diff --git a/docker/octavia/octavia-base/Dockerfile.j2 b/docker/octavia/octavia-base/Dockerfile.j2 index 24af704380..83b7c4e287 100644 --- a/docker/octavia/octavia-base/Dockerfile.j2 +++ b/docker/octavia/octavia-base/Dockerfile.j2 @@ -21,8 +21,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD octavia-base-archive /octavia-base-source + +{% set octavia_base_pip_packages = [ + '/octavia' +] %} + RUN ln -s /octavia-base-source/* octavia \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /octavia \ + && {{ macros.install_pip(octavia_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/octavia \ && cp -r /octavia/etc/* /etc/octavia/ \ && chown -R octavia: /etc/octavia diff --git a/docker/openstack-base/Dockerfile.j2 b/docker/openstack-base/Dockerfile.j2 index 8e39775835..c43b53fd8c 100644 --- a/docker/openstack-base/Dockerfile.j2 +++ b/docker/openstack-base/Dockerfile.j2 @@ -350,11 +350,13 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ ADD openstack-base-archive /openstack-base-source RUN ln -s openstack-base-source/* /requirements \ && mkdir -p /var/lib/kolla \ - && pip --no-cache-dir install -U virtualenv \ + && {{ macros.install_pip(['virtualenv'], constraints = false)}} \ && virtualenv --system-site-packages /var/lib/kolla/venv -{{ macros.install_pip(openstack_base_pip_packages | customizable("pip_packages")) }} + ENV PATH /var/lib/kolla/venv/bin:$PATH +RUN {{ macros.install_pip(openstack_base_pip_packages | customizable("pip_packages")) }} + {% endif %} {% block openstack_base_footer %}{% endblock %} diff --git a/docker/panko/panko-base/Dockerfile.j2 b/docker/panko/panko-base/Dockerfile.j2 index dd1d217c82..88ce5b87ce 100644 --- a/docker/panko/panko-base/Dockerfile.j2 +++ b/docker/panko/panko-base/Dockerfile.j2 @@ -50,8 +50,12 @@ RUN truncate -s 0 /etc/apache2/ports.conf {% endif %} ADD panko-base-archive /panko-base-source +{% set panko_base_pip_packages = [ + '/panko' +] %} + RUN ln -s panko-base-source/* panko \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /panko \ + && {{ macros.install_pip(panko_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/panko \ && cp -r /panko/etc/panko/* /etc/panko/ \ && chown -R panko: /etc/panko diff --git a/docker/rally/Dockerfile.j2 b/docker/rally/Dockerfile.j2 index e1872829dd..c6dcbea85c 100644 --- a/docker/rally/Dockerfile.j2 +++ b/docker/rally/Dockerfile.j2 @@ -18,11 +18,15 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD rally-archive /rally-source + +{% set rally_pip_packages = [ + '/rally' +] %} + RUN ln -s rally-source/* rally \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /rally \ + && {{ macros.install_pip(rally_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/rally \ && chown -R rally: /etc/rally - {% endif %} COPY extend_start.sh /usr/local/bin/kolla_extend_start diff --git a/docker/sahara/sahara-base/Dockerfile.j2 b/docker/sahara/sahara-base/Dockerfile.j2 index 552ccacad3..ae7efe6693 100644 --- a/docker/sahara/sahara-base/Dockerfile.j2 +++ b/docker/sahara/sahara-base/Dockerfile.j2 @@ -19,8 +19,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD sahara-base-archive /sahara-base-source + +{% set sahara_base_pip_packages = [ + '/sahara' +] %} + RUN ln -s sahara-base-source/* sahara \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /sahara \ + && {{ macros.install_pip(sahara_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/sahara \ && cp -r /sahara/etc/sahara/* /etc/sahara/ \ && chown -R sahara: /etc/sahara \ diff --git a/docker/searchlight/searchlight-base/Dockerfile.j2 b/docker/searchlight/searchlight-base/Dockerfile.j2 index a824686088..3b69c24e20 100644 --- a/docker/searchlight/searchlight-base/Dockerfile.j2 +++ b/docker/searchlight/searchlight-base/Dockerfile.j2 @@ -15,8 +15,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD searchlight-base-archive /searchlight-base-source + +{% set searchlight_base_pip_packages = [ + '/searchlight' +] %} + RUN ln -s searchlight-base-source/* searchlight \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /searchlight \ + && {{ macros.install_pip(searchlight_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/searchlight \ && cp -r /searchlight/etc/* /etc/searchlight \ && chown -R searchlight: /etc/searchlight diff --git a/docker/senlin/senlin-base/Dockerfile.j2 b/docker/senlin/senlin-base/Dockerfile.j2 index 004f85fa1a..5ca5db1cfa 100644 --- a/docker/senlin/senlin-base/Dockerfile.j2 +++ b/docker/senlin/senlin-base/Dockerfile.j2 @@ -15,8 +15,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD senlin-base-archive /senlin-base-source + +{% set senlin_base_pip_packages = [ + '/senlin' +] %} + RUN ln -s senlin-base-source/* senlin \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /senlin \ + && {{ macros.install_pip(senlin_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/senlin \ && cp -r /senlin/etc/senlin/* /etc/senlin \ && chown -R senlin: /etc/senlin diff --git a/docker/solum/solum-base/Dockerfile.j2 b/docker/solum/solum-base/Dockerfile.j2 index af7f5ca0cf..64c3f56d5c 100644 --- a/docker/solum/solum-base/Dockerfile.j2 +++ b/docker/solum/solum-base/Dockerfile.j2 @@ -15,8 +15,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD solum-base-archive /solum-base-source + +{% set solum_base_pip_packages = [ + '/solum' +] %} + RUN ln -s solum-base-source/* solum \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /solum \ + && {{ macros.install_pip(solum_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/solum \ && cp -r /solum/etc/solum/* /etc/solum/ \ && chown -R solum: /etc/solum diff --git a/docker/swift/swift-base/Dockerfile.j2 b/docker/swift/swift-base/Dockerfile.j2 index fa322999f1..a037a7f712 100644 --- a/docker/swift/swift-base/Dockerfile.j2 +++ b/docker/swift/swift-base/Dockerfile.j2 @@ -31,8 +31,13 @@ MAINTAINER {{ maintainer }} {{ macros.install_packages(swift_base_packages | customizable("packages")) }} ADD swift-base-archive /swift-base-source + +{% set swift_base_pip_packages = [ + '/swift' +] %} + RUN ln -s swift-base-source/* swift \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /swift \ + && {{ macros.install_pip(swift_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/swift /var/cache/swift \ && cp -r /swift/etc/* /etc/swift/ \ && chown -R swift: /etc/swift /var/cache/swift diff --git a/docker/tacker/Dockerfile.j2 b/docker/tacker/Dockerfile.j2 index 4f094aa84b..e77264a738 100644 --- a/docker/tacker/Dockerfile.j2 +++ b/docker/tacker/Dockerfile.j2 @@ -15,8 +15,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD tacker-archive /tacker-source + +{% set tacker_pip_packages = [ + '/tacker' +] %} + RUN ln -s tacker-source/* tacker \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /tacker \ + && {{ macros.install_pip(tacker_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/tacker \ && cp -r /tacker/etc/tacker/* /etc/tacker \ && chown -R tacker: /etc/tacker diff --git a/docker/tempest/Dockerfile.j2 b/docker/tempest/Dockerfile.j2 index 2f3a53817e..e713d16105 100644 --- a/docker/tempest/Dockerfile.j2 +++ b/docker/tempest/Dockerfile.j2 @@ -23,11 +23,16 @@ RUN ln -sf /var/lib/tempest /tempest {% elif install_type == 'source' %} ADD tempest-archive /tempest-source + +{% set tempest_pip_packages = [ + '/tempest' +] %} + # NOTE(Jeffrey4l): remove the tempest version constraint in the # upper-constrains.txt file. Otherwise, it will be failed. RUN ln -s tempest-source/* tempest \ && sed -i 's/^tempest===.*$//' requirements/upper-constraints.txt \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /tempest \ + && {{ macros.install_pip(tempest_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/tempest /var/log/tempest /etc/tempest/tempest_lock {% endif %} diff --git a/docker/trove/trove-base/Dockerfile.j2 b/docker/trove/trove-base/Dockerfile.j2 index 2245033628..6d66203f3c 100644 --- a/docker/trove/trove-base/Dockerfile.j2 +++ b/docker/trove/trove-base/Dockerfile.j2 @@ -21,8 +21,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD trove-base-archive /trove-base-source + +{% set trove_base_pip_packages = [ + '/trove' +] %} + RUN ln -s trove-base-source/* trove \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /trove \ + && {{ macros.install_pip(trove_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/trove \ && cp -r /trove/etc/trove/* /etc/trove/ \ && chown -R trove: /etc/trove diff --git a/docker/vitrage/vitrage-base/Dockerfile.j2 b/docker/vitrage/vitrage-base/Dockerfile.j2 index 7507111f54..f5886384fc 100644 --- a/docker/vitrage/vitrage-base/Dockerfile.j2 +++ b/docker/vitrage/vitrage-base/Dockerfile.j2 @@ -14,9 +14,13 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} +{% set vitrage_base_pip_packages = [ + '/vitrage' +] %} + ADD vitrage-base-archive /vitrage-base-source RUN ln -s vitrage-base-source/* vitrage \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /vitrage \ + && {{ macros.install_pip(vitrage_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/vitrage \ && cp -r /vitrage/etc/vitrage/* /etc/vitrage/ \ && chown -R vitrage: /etc/vitrage diff --git a/docker/vmtp/Dockerfile.j2 b/docker/vmtp/Dockerfile.j2 index c86f6e1753..69084d018c 100644 --- a/docker/vmtp/Dockerfile.j2 +++ b/docker/vmtp/Dockerfile.j2 @@ -14,7 +14,11 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} -RUN pip install vmtp +{% set vmtp_pip_packages = [ + 'vmtp' +] %} + +RUN {{ macros.install_pip(vmtp_pip_packages | customizable("pip_packages"), constraints = false) }} {% endif %} diff --git a/docker/watcher/watcher-base/Dockerfile.j2 b/docker/watcher/watcher-base/Dockerfile.j2 index 5f8c66ec9b..31a0839e44 100644 --- a/docker/watcher/watcher-base/Dockerfile.j2 +++ b/docker/watcher/watcher-base/Dockerfile.j2 @@ -18,8 +18,13 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD watcher-base-archive /watcher-base-source + +{% set watcher_base_pip_packages = [ + '/watcher' +] %} + RUN ln -s watcher-base-source/* watcher \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /watcher \ + && {{ macros.install_pip(watcher_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/watcher \ && cp -r /watcher/etc/watcher/* /etc/watcher/ \ && chown -R watcher: /etc/watcher diff --git a/docker/zaqar/Dockerfile.j2 b/docker/zaqar/Dockerfile.j2 index 13613a2485..97a00834ae 100755 --- a/docker/zaqar/Dockerfile.j2 +++ b/docker/zaqar/Dockerfile.j2 @@ -21,8 +21,14 @@ MAINTAINER {{ maintainer }} {% elif install_type == 'source' %} ADD zaqar-archive /zaqar-source + +{% set zaqar_pip_packages = [ + 'pymongo', + '/zaqar' +] %} + RUN ln -s zaqar-source/* zaqar \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt pymongo /zaqar \ + && {{ macros.install_pip(zaqar_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/zaqar \ && cp -r /zaqar/etc/* /etc/zaqar/ \ && mv /etc/zaqar/policy.json.sample /etc/zaqar/policy.json \ diff --git a/docker/zun/zun-base/Dockerfile.j2 b/docker/zun/zun-base/Dockerfile.j2 index a7b0da8349..fe0e97a08a 100644 --- a/docker/zun/zun-base/Dockerfile.j2 +++ b/docker/zun/zun-base/Dockerfile.j2 @@ -3,6 +3,8 @@ MAINTAINER {{ maintainer }} {% block zun_base_header %}{% endblock %} +{% import "macros.j2" as macros with context %} + {% if install_type == 'binary' %} RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ @@ -11,9 +13,14 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} ADD zun-base-archive /zun-base-source + +{% set zun_base_pip_packages = [ + '/zun' +] %} + RUN ln -s zun-base-source/* zun \ && useradd --user-group --create-home --home-dir /var/lib/zun zun \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /zun \ + && {{ macros.install_pip(zun_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/zun \ && cp -r /zun/etc/* /etc/zun/ \ && chown -R zun: /etc/zun