Closed Bug 1124382 Opened 10 years ago Closed 9 years ago

Move the treeherder static and media folders outside of the treeherder.webapp django app

Categories

(Tree Management :: Treeherder, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mdoglio, Assigned: mdoglio)

References

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
emorley
: review+
Details | Review
Since treeherder.webapp is a django application, its static folder should contain application-specific static assets. I propose the following layout: -treeherder |-webapp |-static |-webapp <-- app-specific static files assets |-media |-static <-- project-wide static files |-admin |-rest_framework |-django_browserid |-webapp <--a copy of treeherder/webapp/static/webapp made by collectstatic In order to have this layout, we need to change settings.STATIC_ROOT and settings.ADMIN_ROOT and we also need to change the apache vhost definition to point to the new folders under assets.
The second setting to change is settings.MEDIA_ROOT, not ADMIN_ROOT. sorry :p
Blocks: 1043323
Component: Treeherder: Infrastructure → Treeherder
Priority: -- → P4
QA Contact: laura
We don't need to change the apache vhost config for settings.STATIC_ROOT anymore, we now use whitenoise to serve the static files.
Blocks: 1197186
(In reply to Mauro Doglio [:mdoglio] from comment #2) > We don't need to change the apache vhost config for settings.STATIC_ROOT > anymore, we now use whitenoise to serve the static files. On stage/prod the requests are still handled by Apache before being passed to gunicorn. However if paths change I guess the existing apache config entries won't match, and so it will fall back to gunicorn anyway? In which case this is fine (we're slowly move more things over to being served by whitenoise). Separately to this bug, would you like me to file a bug for removing most of the current stage/prod apache config so we start using whitenoise everywhere?
Yeah that would be great.
Attached file PR 900
Attachment #8651736 - Flags: review?(emorley)
Assignee: nobody → mdoglio
Status: NEW → ASSIGNED
Comment on attachment 8651736 [details] [review] PR 900 I've filed bug 1197799 for removing much of the stage/prod apache configs, so we use gunicorn there for everything. This bug probably doesn't need to wait on that, for the reasons in comment 3, but we can check for sure on stage :-)
Attachment #8651736 - Flags: review?(emorley) → review+
(In reply to Ed Morley [:emorley] from comment #6) > I've filed bug 1197799 for removing much of the stage/prod apache configs, > so we use gunicorn there for everything. This bug probably doesn't need to > wait on that, for the reasons in comment 3, but we can check for sure on > stage :-) Actually, reading the Apache config more closely, I believe this does need to wait on bug 1197799, since the alias is remaining the same, even if the path on disk is changing. As such, it will still be intercepted before it reaches gunicorn, but now will fail to find a valid file on disk. eg from stage: Alias /static /data/www/treeherder.allizom.org/treeherder-service/treeherder/webapp/static ProxyPass /static ! Alias /media /data/www/treeherder.allizom.org/treeherder-service/treeherder/webapp/media ProxyPass /media !
Depends on: 1197799
Blocks: 1197796
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
I've removed the old treeherder/webapp/static/ directory for stage/prod from the admin node, so once this is deployed there will be no modified files in the working directory (given the .gitignore change).
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: