<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Discussing offline versus online compression in #rdo.<br>
<br>
What do we do now? Its ugly. The compression is performed at RPM
build time. THis is ugly, because the Javascript files it is
compressing come from other RPMS. So, if you update the RPM that
has newer javascript, the RPM will not see the change, and show the
old code.<br>
<br>
<br>
What we want is to specify that the compression script runs before
Horizon starts. While we know we need to optimize the script to
keep restart times down, that is an issue that needs to be solved
upstream as well. Lets assume for the moment that we will always
run it.<br>
<br>
The compression needs to be done in the system, but should not be
done by the HTTPD daemon itself; Static files should be owned by a
user other than the one that runs HTTPD.<br>
<br>
The right answer seems to be systemd, since we use systemd to
restart httpd. We should be able to indicate that it needs to run
the compression script. We don't want to create a separate service
for openstack-dashboard, though; the service is HTTPD.<br>
<br>
<br>
Steve Gallagher was kind enough to walk me through the basics. He
pointed me to what reviewboard (another mod_wsgi App) does. It
installs a file under<br>
<br>
/usr/lib/systemd/system/httpd.service.d<br>
<br>
named reviewboard-sites.conf. It looks like this:<br>
<br>
<pre><code>[Service]
ExecStartPre=/usr/bin/rb-site upgrade --all-sites
[Unit]
After=postgresql.service mariadb.service mysql.service memcached.service</code></pre>
<br>
(visible at
<a class="moz-txt-link-freetext" href="http://pkgs.fedoraproject.org/cgit/ReviewBoard.git/tree/reviewboard-sites.conf?h=f21">http://pkgs.fedoraproject.org/cgit/ReviewBoard.git/tree/reviewboard-sites.conf?h=f21</a>)<br>
<br>
<br>
so for horizon:<br>
<br>
<pre><code>ExecStartPre=python ${horizon_path}/manage.py compress --force-if-not-fresh</code></pre>
<br>
I think this should be the pattern for all of the HTTPD hosted
services. We should do this with Keystone next.<br>
</body>
</html>