Split the tasks into multiple queues on stg.pagure.io

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2018-04-23 16:38:04 +02:00
parent 724308a71a
commit e671d4a984
5 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,15 @@
[Unit]
Description=Pagure worker for backend git interaction
After=redis.target
Documentation=https://pagure.io/pagure
[Service]
ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info --autoreload -Q fast_workers -c 5
Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"
Type=simple
User=git
Restart=on-failure
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,15 @@
[Unit]
Description=Pagure worker for backend git interaction
After=redis.target
Documentation=https://pagure.io/pagure
[Service]
ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info --autoreload -Q medium_workers -c 5
Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"
Type=simple
User=git
Restart=on-failure
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,15 @@
[Unit]
Description=Pagure worker for backend git interaction
After=redis.target
Documentation=https://pagure.io/pagure
[Service]
ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info --autoreload -Q slow_workers -c 5
Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"
Type=simple
User=git
Restart=on-failure
[Install]
WantedBy=multi-user.target

View file

@ -190,6 +190,20 @@
- stunnel
- config
- name: Add the different service files for the different workers
copy: src={{ item }}.service
dest=/etc/systemd/system/{{ item }}.service
owner=root group=root mode=0755
when: env == 'pagure-staging'
with_items:
- pagure_fast_worker
- pagure_medium_worker
- pagure_slow_worker
notify:
- reload systemd
tags:
- pagure
# Set-up Pagure
@ -379,3 +393,16 @@
- pagure
- service
- postfix
- name: Start and enable the worker services
service: name={{ item }} enabled=yes state=started
with_items:
- pagure_fast_worker
- pagure_medium_worker
- pagure_slow_worker
when: env == 'pagure-staging'
ignore_errors: true
tags:
- pagure
- service
- postfix

View file

@ -286,3 +286,9 @@ CROSS_PROJECT_ACLS = [
BLACKLISTED_GROUPS = ['forks', 'group', 'rpms', 'modules', 'container', 'tests']
GITOLITE_CELERY_QUEUE = 'gitolite_queue'
{% if env == 'pagure-staging' %}
FAST_CELERY_QUEUE = 'fast_workers'
MEDIUM_CELERY_QUEUE = 'medium_workers'
SLOW_CELERY_QUEUE = 'slow_workers'
{% else %}
{% endif %}