Deployment of django-based version of linaro-license-protection

Bug #1020159 reported by Georgy Redkozubov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linaro-license-protection
Fix Released
High
Данило Шеган

Bug Description

Development has been done on Ubuntu 12.04 and some issues have been run into during deployment to earlier versions. There is currently an RT ticket open about deployment on mombin.l.o which runs Ubuntu 10.04: https://rt.linaro.org//Ticket/Display.html?id=504&results=09e0a26ab62c852ffef684e29f6a5163

10.04 has earlier version of two key components:
- The problem with Django in 10.04 is that it doesn’t contain the 'staticfiles' module. We only use staticfiles in deployment to package up the static files that we use so they are served up by Apache. We may be able to disable the module completely for deployment (take all references out of settings.py) and just change the Apache setting: Alias /static/ … to point to the static directory containing our icons.
- Apache mod_xsendfile doesn’t have the same options. 0.9 (the version in 10.04) finds files under the Apache config <Directory..> that it is enabled in. We can sort of work with this:

NameVirtualHost _default_
<VirtualHost _default_>
   Alias /static/ /home/dooferlad/linaro-license-protection/static/

   <Directory /home/dooferlad/linaro-license-protection/static>
     Order deny,allow
     Allow from all
   </Directory>

   ServerAdmin <email address hidden>
   WSGIScriptAlias / /home/dooferlad/linaro-license-protection/license_protected_downloads/wsgi.py
   WSGIDaemonProcess linaro-license-protection

   <Directory /home/dooferlad/linaro-license-protection/android>
       XSendFile on
       <Files ../license_protected_downloads/wsgi.py>
           Order deny,allow
           Allow from all
       </Files>
   </Directory>
</VirtualHost>

This will send files in /home/dooferlad/linaro-license-protection/android but, as you can see, it involves using a relative path to point to the wsgi file. Bit messy. Does work during testing though. If this works with soft links (untested) we can just link a directory in linaro-license-protection to /srv2/release.linaro.org/whatever (or /srv4/snapshots...).

The Updated mod_sendfile (in 12.04) is much more flexible and would allow us to have:
   <Directory /home/dooferlad/linaro-license-protection/license_protected_downloads>
       XSendFile on
       XSendFilePath /srv2/releases.linaro.org/whatever
       <Fileswsgi.py>
           Order deny,allow
           Allow from all
       </Files>
   </Directory>

This allows a pleasing split between files being served and the django app.

IS has nothing against upgrading mombin.l.o to 12.04:
[2012/07/02 17:47:37] <ChrisS> gesha: If it can't be made to work in 10.04 a VM is one option. Alternatively, we could upgrade mombin to precise (although given the number of things that machine gets used for, it might be a bit involved)

Creating VMs is not so easy:
[2012/07/02 18:50:09] <ChrisS> gesha: We tend to have dedicated VM hosts rather than adding them to existing systems, so it's not going be a straightforward process, I'm afraid.

RT ticket for setup staging servers: https://rt.linaro.org//Ticket/Display.html?id=518

Revision history for this message
Georgy Redkozubov (gesha) wrote :

I was able to install django-base license protection on 10.04 with small workarounds which are possible on mombin.l.o:
1) Update django using pip to version 1.3.1
2) Install django-openid-auth version 0.2 using pip
3) Install mod_xsendfile version 0.12 from sources https://tn123.org/mod_xsendfile/

The only issue will be left - unittests. We have developed them using python 2.7.3 but in Ubuntu 10.04 python is 2.6.5 and unittests don't have assertDictEqual, assertIn and assertRaises has different syntax.

Changed in linaro-license-protection:
importance: Undecided → High
assignee: nobody → Georgy Redkozubov (gesha)
status: New → In Progress
Revision history for this message
Georgy Redkozubov (gesha) wrote :

It's possible to support multiple sites on a single Django installation: https://docs.djangoproject.com/en/dev/ref/contrib/sites/?from=olddocs

David Zinman (dzinman)
Changed in linaro-license-protection:
milestone: 2012.07 → 2012.08
Revision history for this message
Georgy Redkozubov (gesha) wrote :

We are blocked by RT #518 being resolved by IS.

Revision history for this message
Georgy Redkozubov (gesha) wrote :

#518 is partially resolved, IS still has things to do on VMs. At least we can access staging.releases.linaro.org and staging.snapshots.linaro.org but we don't have any admin access on them, so any activity should be done with IS help. It is not what we expected from staging servers.
Admin access was requested in #518.

Revision history for this message
Georgy Redkozubov (gesha) wrote :

As discussed with Danilo, no admin access is needed.
Apache2 configurations were prepared and deployment steps added to README.

Changed in linaro-license-protection:
assignee: Georgy Redkozubov (gesha) → Данило Шеган (danilo)
status: In Progress → Fix Committed
Changed in linaro-license-protection:
status: Fix Committed → Fix Released
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.