Split the tasks into multiple queues on stg.pagure.io
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
parent
724308a71a
commit
e671d4a984
5 changed files with 78 additions and 0 deletions
15
roles/pagure/frontend/files/pagure_fast_worker.service
Normal file
15
roles/pagure/frontend/files/pagure_fast_worker.service
Normal 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
|
||||||
|
|
15
roles/pagure/frontend/files/pagure_medium_worker.service
Normal file
15
roles/pagure/frontend/files/pagure_medium_worker.service
Normal 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
|
||||||
|
|
15
roles/pagure/frontend/files/pagure_slow_worker.service
Normal file
15
roles/pagure/frontend/files/pagure_slow_worker.service
Normal 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
|
||||||
|
|
|
@ -190,6 +190,20 @@
|
||||||
- stunnel
|
- stunnel
|
||||||
- config
|
- 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
|
# Set-up Pagure
|
||||||
|
|
||||||
|
@ -379,3 +393,16 @@
|
||||||
- pagure
|
- pagure
|
||||||
- service
|
- service
|
||||||
- postfix
|
- 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
|
||||||
|
|
|
@ -286,3 +286,9 @@ CROSS_PROJECT_ACLS = [
|
||||||
BLACKLISTED_GROUPS = ['forks', 'group', 'rpms', 'modules', 'container', 'tests']
|
BLACKLISTED_GROUPS = ['forks', 'group', 'rpms', 'modules', 'container', 'tests']
|
||||||
|
|
||||||
GITOLITE_CELERY_QUEUE = 'gitolite_queue'
|
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 %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue