Speed up builds of horizon slowed down by recent upstream change

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] 4e911e2889

Change-Id: I737f80566dd263ed291e215968ec72a95ad41a5f
Signed-off-by: Radosław Piliszek <radoslaw.piliszek@gmail.com>
This commit is contained in:
Radosław Piliszek 2019-06-24 21:29:57 +02:00
parent a7f9817a3e
commit b9591bdec9

View File

@ -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/share/openstack-dashboard/openstack_dashboard/local/enabled/?[^_]*.py* \
&& rm -f /usr/lib/python{{ distro_python_version }}/site-packages/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 \ && 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 done
{% endblock %} {% endblock %}
@ -83,7 +83,7 @@ RUN echo > /etc/apache2/ports.conf \
&& cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \ && cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
&& rm /etc/apache2/conf-enabled/openstack-dashboard.conf \ && rm /etc/apache2/conf-enabled/openstack-dashboard.conf \
&& for locale in /usr/lib/python3/dist-packages/*/locale; do \ && 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 done
{% endblock %} {% endblock %}
@ -149,9 +149,9 @@ RUN ln -s horizon-source/* horizon \
{{ macros.install_pip(horizon_plugins_pip_packages) }}; \ {{ macros.install_pip(horizon_plugins_pip_packages) }}; \
fi \ fi \
&& for locale in /var/lib/kolla/venv/lib/python{{distro_python_version}}/site-packages/*/locale; do \ && 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 \ 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 %} {% endif %}