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)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mdoglio, Assigned: mdoglio)
References
Details
Attachments
(1 file)
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.
Assignee | ||
Comment 1•10 years ago
|
||
The second setting to change is settings.MEDIA_ROOT, not ADMIN_ROOT. sorry :p
Updated•10 years ago
|
Assignee | ||
Comment 2•10 years ago
|
||
We don't need to change the apache vhost config for settings.STATIC_ROOT anymore, we now use whitenoise to serve the static files.
Comment 3•10 years ago
|
||
(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?
Assignee | ||
Comment 4•10 years ago
|
||
Yeah that would be great.
Assignee | ||
Comment 5•10 years ago
|
||
Attachment #8651736 -
Flags: review?(emorley)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → mdoglio
Status: NEW → ASSIGNED
Comment 6•10 years ago
|
||
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+
Comment 7•9 years ago
|
||
(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
Comment 9•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/b008a335ef78d7d27e29d6d8205317940e68901d
Bug 1124382 - Move static and media folders to treeherder/
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Comment 10•9 years ago
|
||
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.
Description
•