HyperKitty: the new version uses Django-Q
This commit is contained in:
parent
56ed4718e7
commit
76b2b5d7d7
7 changed files with 75 additions and 6 deletions
|
@ -17,7 +17,7 @@
|
||||||
- service: name=mailman3 state=stopped
|
- service: name=mailman3 state=stopped
|
||||||
|
|
||||||
|
|
||||||
- name: drop and re-create the staging dsb entirely
|
- name: drop and re-create the staging dbs entirely
|
||||||
hosts: db01.stg.phx2.fedoraproject.org
|
hosts: db01.stg.phx2.fedoraproject.org
|
||||||
user: root
|
user: root
|
||||||
become: yes
|
become: yes
|
||||||
|
|
|
@ -10,18 +10,21 @@ BASEDIR=`yamlget basedir $CONFFILE`
|
||||||
CONFDIR=`yamlget confdir $CONFFILE`
|
CONFDIR=`yamlget confdir $CONFFILE`
|
||||||
INDEXDIR=$BASEDIR/fulltext_index
|
INDEXDIR=$BASEDIR/fulltext_index
|
||||||
|
|
||||||
# Give database rights to the non-admin user (must be done before loading initial data)
|
|
||||||
sleep $[ ( $RANDOM % 10 ) + 1 ]s # avoid simultaneous lockups on parallel servers. Yes, this is dirty.
|
sleep $[ ( $RANDOM % 10 ) + 1 ]s # avoid simultaneous lockups on parallel servers. Yes, this is dirty.
|
||||||
$BASEDIR/bin/pg-give-rights.py > /dev/null
|
|
||||||
|
|
||||||
echo "Stop services"
|
echo "Stop services"
|
||||||
systemctl stop crond mailman3 httpd
|
systemctl stop webui-qcluster crond mailman3 httpd
|
||||||
|
|
||||||
echo "static files"
|
echo "static files"
|
||||||
django-admin collectstatic --clear --noinput --verbosity 0 --pythonpath $CONFDIR --settings settings
|
django-admin collectstatic --clear --noinput --verbosity 0 --pythonpath $CONFDIR --settings settings
|
||||||
django-admin compress --pythonpath $CONFDIR --settings settings
|
django-admin compress --pythonpath $CONFDIR --settings settings
|
||||||
echo "db migration"
|
echo "db migration"
|
||||||
django-admin migrate --pythonpath $CONFDIR --settings settings_admin --noinput
|
django-admin migrate --pythonpath $CONFDIR --settings settings_admin --noinput
|
||||||
|
|
||||||
|
echo "give database rights to the non-admin user"
|
||||||
|
# this must be done before loading initial data
|
||||||
|
$BASEDIR/bin/pg-give-rights.py > /dev/null
|
||||||
|
|
||||||
echo "load initial data"
|
echo "load initial data"
|
||||||
django-admin loaddata $CONFDIR/initial-data.json --pythonpath $CONFDIR --settings settings
|
django-admin loaddata $CONFDIR/initial-data.json --pythonpath $CONFDIR --settings settings
|
||||||
mkdir -p $INDEXDIR
|
mkdir -p $INDEXDIR
|
||||||
|
@ -36,4 +39,4 @@ echo "unit tests"
|
||||||
django-admin test --pythonpath $CONFDIR --settings settings_test hyperkitty postorius
|
django-admin test --pythonpath $CONFDIR --settings settings_test hyperkitty postorius
|
||||||
|
|
||||||
# Restart services
|
# Restart services
|
||||||
systemctl start httpd mailman3 crond
|
systemctl start httpd mailman3 crond webui-qcluster
|
||||||
|
|
|
@ -44,7 +44,38 @@ HAYSTACK_CONNECTIONS = {
|
||||||
}
|
}
|
||||||
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
|
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
|
||||||
|
|
||||||
LOGGING = {}
|
#
|
||||||
|
# Asynchronous tasks
|
||||||
|
#
|
||||||
|
Q_CLUSTER = {
|
||||||
|
'orm': 'default',
|
||||||
|
'sync': True,
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGING = {
|
||||||
|
'version': 1,
|
||||||
|
'disable_existing_loggers': False,
|
||||||
|
'handlers': {
|
||||||
|
'console': {
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'loggers': {
|
||||||
|
'hyperkitty': {
|
||||||
|
'handlers': ['console'],
|
||||||
|
'level': 'INFO',
|
||||||
|
'propagate': True,
|
||||||
|
},
|
||||||
|
'django_mailman3.lib.mailman': {
|
||||||
|
'handlers': ['console'],
|
||||||
|
'level': 'ERROR',
|
||||||
|
},
|
||||||
|
'django-q': {
|
||||||
|
'handlers': ['console'],
|
||||||
|
'level': 'WARNING',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
# Disable caching
|
# Disable caching
|
||||||
CACHES = {
|
CACHES = {
|
||||||
|
|
|
@ -7,3 +7,6 @@
|
||||||
|
|
||||||
- name: restart memcached
|
- name: restart memcached
|
||||||
service: name=memcached state=restarted
|
service: name=memcached state=restarted
|
||||||
|
|
||||||
|
- name: systemctl daemon-reload
|
||||||
|
command: /usr/bin/systemctl daemon-reload
|
||||||
|
|
|
@ -431,6 +431,15 @@
|
||||||
dest=/etc/yum/post-actions/hyperkitty.action
|
dest=/etc/yum/post-actions/hyperkitty.action
|
||||||
tags: mailman
|
tags: mailman
|
||||||
|
|
||||||
|
# Systemd
|
||||||
|
- name: install the systemd service file
|
||||||
|
template: src=webui-qcluster.service.j2 dest=/etc/systemd/system/webui-qcluster.service
|
||||||
|
notify:
|
||||||
|
- systemctl daemon-reload
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
- mailman
|
||||||
|
|
||||||
#
|
#
|
||||||
# Only run this on mailman01 for now.
|
# Only run this on mailman01 for now.
|
||||||
# TODO: run it on lists-dev too
|
# TODO: run it on lists-dev too
|
||||||
|
@ -469,5 +478,6 @@
|
||||||
- httpd
|
- httpd
|
||||||
- mailman3
|
- mailman3
|
||||||
- postfix
|
- postfix
|
||||||
|
- webui-qcluster
|
||||||
tags: mailman
|
tags: mailman
|
||||||
when: inventory_hostname.startswith('mailman01.phx2') or inventory_hostname.startswith('lists-dev')
|
when: inventory_hostname.startswith('mailman01.phx2') or inventory_hostname.startswith('lists-dev')
|
||||||
|
|
|
@ -66,6 +66,7 @@ INSTALLED_APPS = (
|
||||||
'allauth',
|
'allauth',
|
||||||
'allauth.account',
|
'allauth.account',
|
||||||
'allauth.socialaccount',
|
'allauth.socialaccount',
|
||||||
|
'django_q',
|
||||||
'django_mailman3.lib.auth.fedora',
|
'django_mailman3.lib.auth.fedora',
|
||||||
{% for service_name, service_data in mailman_login.items() %}
|
{% for service_name, service_data in mailman_login.items() %}
|
||||||
'allauth.socialaccount.providers.{{ service_data.provider }}',
|
'allauth.socialaccount.providers.{{ service_data.provider }}',
|
||||||
|
@ -314,6 +315,16 @@ HAYSTACK_CONNECTIONS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Asynchronous tasks
|
||||||
|
#
|
||||||
|
Q_CLUSTER = {
|
||||||
|
'timeout': 300,
|
||||||
|
'save_limit': 500,
|
||||||
|
'orm': 'default',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# A sample logging configuration. The only tangible logging
|
# A sample logging configuration. The only tangible logging
|
||||||
# performed by this configuration is to send an email to
|
# performed by this configuration is to send an email to
|
||||||
# the site admins on every HTTP 500 error when DEBUG=False.
|
# the site admins on every HTTP 500 error when DEBUG=False.
|
||||||
|
|
11
roles/mailman/templates/webui-qcluster.service.j2
Normal file
11
roles/mailman/templates/webui-qcluster.service.j2
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Mailman web UI async tasks runner
|
||||||
|
After=network.target remote-fs.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/django-admin qcluster --pythonpath {{ mailman_webui_confdir }} --settings settings
|
||||||
|
User=apache
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue