Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
2b556f2b
Commit
2b556f2b
authored
Nov 24, 2014
by
Carson Gee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert xqueue gunicorn configuration to file
parent
b9362da8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
10 deletions
+27
-10
playbooks/roles/xqueue/defaults/main.yml
+1
-1
playbooks/roles/xqueue/tasks/deploy.yml
+6
-0
playbooks/roles/xqueue/templates/xqueue.conf.j2
+1
-9
playbooks/roles/xqueue/templates/xqueue_gunicorn.py.j2
+19
-0
No files found.
playbooks/roles/xqueue/defaults/main.yml
View file @
2b556f2b
...
...
@@ -3,7 +3,7 @@
---
XQUEUE_NGINX_PORT
:
18040
XQUEUE_GUNICORN_WORKERS_EXTRA
:
"
"
XQUEUE_GUNICORN_
EXTRA
:
"
"
XQUEUE_GUNICORN_
WORKERS_EXTRA_CONF
:
"
"
XQUEUE_QUEUES
:
# push queue
'
edX-Open_DemoX'
:
'
http://localhost:18050'
...
...
playbooks/roles/xqueue/tasks/deploy.yml
View file @
2b556f2b
...
...
@@ -13,6 +13,12 @@
with_items
:
[
'
xqueue'
,
'
xqueue_consumer'
]
when
:
not disable_edx_services
-
name
:
"
add
gunicorn
configuration
file"
template
:
>
src=xqueue_gunicorn.py.j2 dest={{ xqueue_app_dir }}/xqueue_gunicorn.py
sudo_user
:
"
{{
xqueue_user
}}"
notify
:
-
restart xqueue
-
name
:
create xqueue application config
template
:
src=xqueue.env.json.j2 dest={{ xqueue_app_dir }}/xqueue.env.json mode=0644
...
...
playbooks/roles/xqueue/templates/xqueue.conf.j2
View file @
2b556f2b
...
...
@@ -6,15 +6,7 @@
{% set executable = xqueue_venv_bin + '/gunicorn' %}
{% endif %}
{% if XQUEUE_WORKERS -%}
command={{ executable }} --preload -b {{ xqueue_gunicorn_host }}:{{ xqueue_gunicorn_port }} -w {{ XQUEUE_WORKERS }} --timeout=300 --pythonpath={{ xqueue_code_dir }} {{ XQUEUE_GUNICORN_WORKERS_EXTRA }} xqueue.wsgi
{% else -%}
{% if ansible_processor|length > 0 %}
command={{ executable }} --preload -b {{ xqueue_gunicorn_host }}:{{ xqueue_gunicorn_port }} -w {{ ansible_processor|length * 2 }} --timeout=300 --pythonpath={{ xqueue_code_dir }} {{ XQUEUE_GUNICORN_EXTRA }} xqueue.wsgi
{% else -%}
command={{ executable }} --preload -b {{ xqueue_gunicorn_host }}:{{ xqueue_gunicorn_port }} -w 2 --timeout=300 --pythonpath={{ xqueue_code_dir }} {{ XQUEUE_GUNICORN_EXTRA }} xqueue.wsgi
{% endif -%}
{% endif -%}
command={{ executable }} -c {{ xqueue_app_dir }}/xqueue_gunicorn.py {{ XQUEUE_GUNICORN_WORKERS_EXTRA }} xqueue.wsgi
user={{ common_web_user }}
directory={{ xqueue_code_dir }}
...
...
playbooks/roles/xqueue/templates/xqueue_gunicorn.py.j2
0 → 100644
View file @
2b556f2b
"""
gunicorn configuration file: http://docs.gunicorn.org/en/develop/configure.html
{{ ansible_managed }}
"""
import multiprocessing
preload_app = True
timeout = 300
bind = "{{ xqueue_gunicorn_host }}:{{ xqueue_gunicorn_port }}"
pythonpath = "{{ xqueue_code_dir }}"
{% if XQUEUE_WORKERS %}
workers = {{ XQUEUE_WORKERS }}
{% else %}
workers = (multiprocessing.cpu_count()-1) * 2 + 2
{% endif %}
{{ XQUEUE_GUNICORN_WORKERS_EXTRA_CONF }}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment