<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Can you compress at RPM install time?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Y.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> rdo-list-bounces@redhat.com [mailto:rdo-list-bounces@redhat.com] <b>On Behalf Of </b>Adam Young<br><b>Sent:</b> Tuesday, April 14, 2015 1:19 AM<br><b>To:</b> rdo-list@redhat.com<br><b>Subject:</b> [Rdo-list] Systemd extension for HTTPD hosted applications<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>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:<o:p></o:p></p><pre><code>[Service]<o:p></o:p></code></pre><pre><code>ExecStartPre=/usr/bin/rb-site upgrade --all-sites<o:p></o:p></code></pre><pre><code><o:p> </o:p></code></pre><pre><code>[Unit]<o:p></o:p></code></pre><pre><code>After=postgresql.service mariadb.service mysql.service memcached.service</code><o:p></o:p></pre><p class=MsoNormal style='margin-bottom:12.0pt'><br>(visible at <a 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:<o:p></o:p></p><pre><code>ExecStartPre=python ${horizon_path}/manage.py compress   --force-if-not-fresh</code><o:p></o:p></pre><p class=MsoNormal><br>I think this should be the pattern for all of the HTTPD hosted services.  We should do this with Keystone next.<o:p></o:p></p></div></div></div></body></html>