From b9591bdec9fe996b5072c2dea03313e5414be67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Mon, 24 Jun 2019 21:29:57 +0200 Subject: [PATCH] Speed up builds of horizon slowed down by recent upstream change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds of horizon needlessly ran many compilemessages iterations for core horizon parts because of using horizon's manage.py in a loop. The behavior was caused by recent upstream change ([1]). It caused CentOS source builds to take too long time and time out in CI. This patch switches to using django-admin. [1] https://opendev.org/openstack/horizon/commit/4e911e2889ebe7f0a577a0323649dceb9cef363c Change-Id: I737f80566dd263ed291e215968ec72a95ad41a5f Signed-off-by: Radosław Piliszek --- docker/horizon/Dockerfile.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2 index 763107efe3..19b66f1a8d 100644 --- a/docker/horizon/Dockerfile.j2 +++ b/docker/horizon/Dockerfile.j2 @@ -52,7 +52,7 @@ RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ && rm -f /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/?[^_]*.py* \ && rm -f /usr/lib/python{{ distro_python_version }}/site-packages/openstack_dashboard/local/enabled/?[^_]*.py* \ && for locale in /usr/lib/python{{ distro_python_version }}/site-packages/*/locale; do \ - (cd ${locale%/*} && /usr/bin/{{ horizon_python }} /usr/bin/manage.py compilemessages) \ + (cd ${locale%/*} && /usr/bin/django-admin compilemessages) \ done {% endblock %} @@ -83,7 +83,7 @@ RUN echo > /etc/apache2/ports.conf \ && cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \ && rm /etc/apache2/conf-enabled/openstack-dashboard.conf \ && for locale in /usr/lib/python3/dist-packages/*/locale; do \ - (cd ${locale%/*} && /usr/bin/python3 /usr/bin/manage.py compilemessages) \ + (cd ${locale%/*} && /usr/bin/django-admin compilemessages) \ done {% endblock %} @@ -149,9 +149,9 @@ RUN ln -s horizon-source/* horizon \ {{ macros.install_pip(horizon_plugins_pip_packages) }}; \ fi \ && for locale in /var/lib/kolla/venv/lib/python{{distro_python_version}}/site-packages/*/locale; do \ - (cd ${locale%/*} && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \ + (cd ${locale%/*} && /var/lib/kolla/venv/bin/django-admin compilemessages) \ done \ - && chown -R horizon: /etc/openstack-dashboard /var/lib/kolla/venv/lib/python{{distro_python_version}}/site-packages/static + && chown -R horizon: /etc/openstack-dashboard {% endif %}