Commit 51d6c311 by e0d

Merge pull request #252 from edx/e0d/universal-scheduler

Changes for universal scheduler and bug fixes.
parents a87f2d61 d64d173b
......@@ -6,12 +6,12 @@ notifier_home: "/opt/wwc/notifier"
notifier_venv_dir: "{{ notifier_home }}/virtualenvs/notifier"
notifier_source_repo: "git@github.com:edx/notifier.git"
notifier_code_dir: "{{ notifier_home }}/src"
notifier_version: "rc/digests"
notifier_version: "master"
notifier_git_identity_path: "{{ secure_dir }}/files/git-identity"
notifier_requirements_file: "{{ notifier_code_dir }}/requirements.txt"
notifier_log_level: "INFO"
notifier_rsyslog_enabled: "yes"
notifier_digest_task_interval: "5"
notifier_digest_task_interval: "1440"
notifier_env: "Development"
......
......@@ -4,20 +4,20 @@
## for future compliance, when the API comes on line.
##
- name: notifier | install notifier-celery-beat
supervisorctl: name=notifier-celery-beat state=present
- name: notifier | install notifier-scheduler
supervisorctl: name=notifier-scheduler state=present
- name: notifier | install notifier-celery-workers
supervisorctl: name=notifier-celery-workers state=present
- name: notifier | restart notifier
supervisorctl: name=notifier-celery-beat state=restarted
supervisorctl: name=notifier-scheduler state=restarted
notify:
- notifier | install notifier-celery-workers
- notifier | install notifier-celery-beat
- notifier | install notifier-scheduler
- name: notifier | restart notifier-celery-beat
supervisorctl: name=notifier-celery-beat state=restarted
- name: notifier | restart notifier-scheduler
supervisorctl: name=notifier-scheduler state=restarted
- name: notifier | restart notifier-celery-workers
supervisorctl: name=notifier-celery-workers state=restarted
......@@ -26,8 +26,8 @@
- install
- update
- name: notifier | stop notifier-celery-beat
supervisorctl: name=notifier-celery-beat state=restarted
- name: notifier | stop notifier-scheduler
supervisorctl: name=notifier-scheduler state=restarted
- name: notifier | stop notifier-celery-workers
supervisorctl: name=notifier-celery-workers state=restarted
......
......@@ -159,13 +159,26 @@
- install
- update
- name: notifier | supervisord config for celery beat
- name: notifier | supervisord config for scheduler
template:
src=etc/supervisor/conf.d/notifier-celery-beat.conf.j2 dest=/etc/supervisor/conf.d/notifier-celery-beat.conf
notify: notifier | restart notifier-celery-beat
src=etc/supervisor/conf.d/notifier-scheduler.conf.j2 dest=/etc/supervisor/conf.d/notifier-scheduler.conf
notify: notifier | restart notifier-scheduler
tags:
- notifier
- install
- update
- name: notifier | add cron job
cron:
name="forums digest" hour={{ notifier_cron_hour }}
minute="{{ notifier_cron_minute }}" job="$HOME/forums_digest.sh 1440"
state="absent"
sudo: true
sudo_user: "{{ notifier_user }}"
tags:
- notifier
- install
- update
- clean
- include: deploy.yml
\ No newline at end of file
;
; {{ ansible_managed }}
;
[program:notifier-celery-beat]
[program:notifier-scheduler]
command={{ notifier_venv_dir }}/bin/python manage.py celery beat -l DEBUG
command={{ notifier_venv_dir }}/bin/python manage.py scheduler
process_name=%(program_name)s
numprocs=1
......@@ -18,15 +18,15 @@ stopsignal=TERM
stopwaitsecs=10
user=notifier
redirect_stderr=false
stdout_logfile={{ notifier_supervisor_log_dest }}/notifier-celery-beat-stdout.log
stdout_logfile={{ notifier_supervisor_log_dest }}/notifier-scheduler-stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile={{notifier_supervisor_log_dest }}/notifier-celery-beat-stderr.log
stderr_logfile={{notifier_supervisor_log_dest }}/notifier-scheduler-stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-celery-beat.pid',LANG=en_US.UTF-8,
environment=PID='/var/tmp/notifier-scheduler.pid',LANG=en_US.UTF-8,
{%- for name,value in notifier_env_vars.items() -%}
{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}
\ No newline at end of file
......@@ -3,7 +3,7 @@
;
[program:notifier-celery-workers]
command={{ notifier_venv_dir }}/bin/python manage.py celery worker -l DEBUG
command={{ notifier_venv_dir }}/bin/python manage.py celery worker -l {{ notifier_log_level }}
process_name=%(program_name)s
numprocs=1
......
;
; {{ ansible_managed }}
;
[program:notifier-scheduler]
command={{ notifier_venv_dir }}/bin/python manage.py scheduler
process_name=%(program_name)s
numprocs=1
directory={{ notifier_code_dir }}
umask=022
autostart=true
autorestart=true
startsecs=10
startretries=3
exitcodes=0,2
stopsignal=TERM
stopwaitsecs=10
user=notifier
redirect_stderr=false
stdout_logfile={{ notifier_supervisor_log_dest }}/notifier-scheduler-stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile={{notifier_supervisor_log_dest }}/notifier-scheduler-stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=PID='/var/tmp/notifier-scheduler.pid',LANG=en_US.UTF-8,
{%- for name,value in notifier_env_vars.items() -%}
{{name}}="{{value}}"{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment