collectstatic and compress are not producing consistent results

Bug #1476383 reported by Eric Peterson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Shaoquan Chen

Bug Description

I have 3 identical machines (host names are different), and I have an ansible script to deploy horizon. As part of the script we run collectstatic and compress by hand (offline compression).

Each machine's static contents looks slightly different.

This causes horizon to fail when behind a load balancer, specifically when round robin or least conn policies are in place.

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

If I rerun these steps on the same machine, it's always consistent / the same / produces the same results.

On two machines with the same code I get:

ls -al static/dashboard/js/
-rw-rw-r-- 1 horizon horizon 494887 Jul 20 20:22 76adef98ad14.js
-rw-rw-r-- 1 horizon horizon 1095117 Jul 20 20:22 9f5a794ddce8.js
-rw-rw-r-- 1 horizon horizon 1029 Jul 20 20:22 d1540ac79bc7.js

ls -al static/dashboard/js/
-rw-rw-r-- 1 horizon horizon 494887 Jul 20 20:25 76adef98ad14.js
-rw-rw-r-- 1 horizon horizon 1095117 Jul 20 20:25 81e54d551c21.js
-rw-rw-r-- 1 horizon horizon 1029 Jul 20 20:25 d1540ac79bc7.js

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

update: The order of the entries of HORIZON_CONFIG['js_files'] is different, on each machine

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

I can confirm after doing a HORIZON_CONFIG['js_files'].sort() -> it works correctly

tags: added: low-hanging-fruit
tags: added: ops
Changed in horizon:
assignee: nobody → Kevin Kirkpatrick (kevkirkpatrick)
Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

Scratch the above comment, after sorting it produces reliable compression artifacts. However, the js is not in the correct order and it fails horribly for other reasons.

Matthias Runge (mrunge)
Changed in horizon:
status: New → Confirmed
Changed in horizon:
assignee: Kevin Kirkpatrick (kevkirkpatrick) → nobody
Changed in horizon:
assignee: nobody → Shaoquan Chen (sean-chen2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/204197

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/204197
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=b6399c69048761584824597b9af38f3c9db4a483
Submitter: Jenkins
Branch: master

commit b6399c69048761584824597b9af38f3c9db4a483
Author: Shaoquan Chen <email address hidden>
Date: Tue Jul 21 12:18:53 2015 -0600

    Proving JS source files in consistent order

    In some deployment environment, the JS source files need to be listed
    in consistent order so that they will have the same cache key value for
    the compressed JS file.

    Change-Id: Ib187a85b7a1fca03c0eb78b411cf121017d40890
    Closes-Bug: #1476383

Changed in horizon:
status: In Progress → Fix Committed
Changed in horizon:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-2 → 8.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.