Freeze break request: move staging improvements to production for askbot

Ankur Sinha sanjay.ankur at gmail.com
Thu May 23 14:27:08 UTC 2013


Hi,

We've tested a couple of things on the askbot staging instance that I
think could really improve the performance of askfedora:

1. Use python-django-post_office as email back end[1]:
We run a cron job to send out mails periodically using post-office
asynchronously. This reduces the delay in comment posting and operations
quite a bit.

2. Send periodic reminders to request people to accept the best answer
for questions they've asked.[2]
This should hopefully reduce the number of "unanswered" questions on the
forum, specially questions that have been answered but no answer
accepted.

The changes are minor ones and could wait for the freeze to finish, but
I expect them to  improve usability quite a bit. What do you folks
think?

[1] https://fedorahosted.org/fedora-infrastructure/ticket/3763
[2] https://fedorahosted.org/fedora-infrastructure/ticket/3762

Apart from the puppet changes below, the ask production database will
have to be updated to include python-post-office as explained here[3]. 

[3] https://pypi.python.org/pypi/django-post_office

Puppet changes:

diff --git a/modules/askbot/manifests/init.pp b/modules/askbot/manifests/init.pp
index 98afdb0..0c6e01e 100644
--- a/modules/askbot/manifests/init.pp
+++ b/modules/askbot/manifests/init.pp
@@ -26,11 +26,8 @@ class askbot {
     package { "python-psycopg2":
         ensure => present
     }
-    if $puppetEnvironment == 'staging' {
-    # cron job for reminders: #3762
-        package { "django-post_office":
-            ensure => present
-        }
+    package { "django-post_office":
+        ensure => present
     }
     fedmsg::certificate { "askbot":
         service => "askbot",
@@ -76,19 +73,17 @@ class askbot {
         target => '/usr/lib/python2.6/site-packages/askbot/static/admin/',
     }

-    if $puppetEnvironment == 'staging' {
-        file { "/etc/cron.d/cron-ask-send-reminders":
-            owner => "root",
-            group => "root",
-            mode => 0644,
-            source => "puppet:///askbot/cron-ask-send-reminders",
-        }
-        file { "/etc/cron.d/cron-post-office-send-mail":
-            owner => "root",
-            group => "root",
-            mode => 0644,
-            source => "puppet:///askbot/cron-post-office-send-mail"
-        }
+    file { "/etc/cron.d/cron-ask-send-reminders":
+        owner => "root",
+        group => "root",
+        mode => 0644,
+        source => "puppet:///askbot/cron-ask-send-reminders",
+    }
+    file { "/etc/cron.d/cron-post-office-send-mail":
+        owner => "root",
+        group => "root",
+        mode => 0644,
+        source => "puppet:///askbot/cron-post-office-send-mail"
     }

     exec { 'askbot_collectstatic':
diff --git a/modules/askbot/templates/settings.erb b/modules/askbot/templates/settings.erb
index f04615a..3dc543a 100644
--- a/modules/askbot/templates/settings.erb
+++ b/modules/askbot/templates/settings.erb
@@ -37,10 +37,7 @@ EMAIL_SUBJECT_PREFIX = ''
 EMAIL_HOST='bastion'
 EMAIL_PORT='25'
 EMAIL_USE_TLS=False
-EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
-<% if environment == "staging" %>
 EMAIL_BACKEND = 'post_office.EmailBackend'
-<% end %>

 #incoming mail settings
 #after filling out these settings - please
@@ -187,9 +184,7 @@ INSTALLED_APPS = (
     #'followit',
     # 'avatar',
     #requires setting of MEDIA_ROOT and MEDIA_URL
-<% if environment == "staging" %>
     'post_office',
-<% end %>
 )

 MEDIA_ROOT='/var/lib/askbot/upfiles/ask'

-- 
Thanks, 
Warm regards,
Ankur: "FranciscoD"

Please only print if necessary. 

Looking to contribute to Fedora? Look here: https://fedoraproject.org/wiki/Fedora_Join_SIG

http://fedoraproject.org/wiki/User:Ankursinha
http://ankursinha.in/blog

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20130524/d9f22ae9/attachment.sig>


More information about the infrastructure mailing list