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
edx
configuration
Commits
385273fd
Commit
385273fd
authored
May 22, 2018
by
Fred Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add workers wrapper script
parent
6d51d69c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
3 deletions
+25
-3
playbooks/roles/edxapp/tasks/deploy.yml
+1
-0
playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2
+1
-1
playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2
+1
-1
playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2
+21
-0
playbooks/roles/edxapp/templates/edx/app/supervisor/conf.d.available/workers.conf.j2
+1
-1
No files found.
playbooks/roles/edxapp/tasks/deploy.yml
View file @
385273fd
...
...
@@ -330,6 +330,7 @@
with_items
:
-
"
lms.sh"
-
"
cms.sh"
-
"
worker.sh"
tags
:
-
install
-
install:configuration
...
...
playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2
View file @
385273fd
...
...
@@ -12,7 +12,7 @@
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
export
NEW_RELIC_APP_NAME
=
"{{ EDXAPP_NEWRELIC_CMS_APPNAME }}"
export
NEW_RELIC_CONFIG_FILE
=
"{{ edxapp_app_dir }}/newrelic.ini"
,
export
NEW_RELIC_CONFIG_FILE
=
"{{ edxapp_app_dir }}/newrelic.ini"
if
command
-v
ec2metadata
>
/dev/null 2>&1
;
then
INSTANCEID
=
$(
ec2metadata
--instance-id
)
;
HOSTNAME
=
$(
hostname
)
...
...
playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2
View file @
385273fd
...
...
@@ -12,7 +12,7 @@
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
export
NEW_RELIC_APP_NAME
=
"{{ EDXAPP_NEWRELIC_LMS_APPNAME }}"
export
NEW_RELIC_CONFIG_FILE
=
"{{ edxapp_app_dir }}/newrelic.ini"
,
export
NEW_RELIC_CONFIG_FILE
=
"{{ edxapp_app_dir }}/newrelic.ini"
if
command
-v
ec2metadata
>
/dev/null 2>&1
;
then
INSTANCEID
=
$(
ec2metadata
--instance-id
)
;
HOSTNAME
=
$(
hostname
)
...
...
playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2
0 → 100644
View file @
385273fd
#!/usr/bin/env bash
# {{ ansible_managed }}
{
%
set
edxapp_venv_bin
=
edxapp_venv_dir +
"/bin"
%
}
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
{
%
set
executable
=
edxapp_venv_bin +
'/newrelic-admin run-program '
+ edxapp_venv_bin +
'/python'
%
}
{
%
else
%
}
{
%
set
executable
=
edxapp_venv_bin +
'/python'
%
}
{
% endif %
}
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
export
NEW_RELIC_CONFIG_FILE
=
"{{ edxapp_app_dir }}/newrelic.ini"
if
command
-v
ec2metadata
>
/dev/null 2>&1
;
then
INSTANCEID
=
$(
ec2metadata
--instance-id
)
;
HOSTNAME
=
$(
hostname
)
export
NEW_RELIC_PROCESS_HOST_DISPLAY_NAME
=
"
$HOSTNAME
-
$INSTANCEID
"
fi
{
% endif -%
}
{{
executable
}}
{{
edxapp_code_dir
}}
/manage.py
$@
playbooks/roles/edxapp/templates/edx/app/supervisor/conf.d.available/workers.conf.j2
View file @
385273fd
...
...
@@ -7,7 +7,7 @@ directory={{ edxapp_code_dir }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log
command={
% if COMMON_ENABLE_NEWRELIC_APP %}NEW_RELIC_PROCESS_HOST_DISPLAY_NAME=`hostname`-`ec2metadata --instance-id`;{% endif -%}{{ edxapp_venv_dir + '/bin/newrelic-admin run-program ' if w.monitor and COMMON_ENABLE_NEWRELIC_APP else ''}}{{ edxapp_venv_bin }}/python {{ edxapp_code_dir }}/manage.py
{{ w.service_variant }} --settings={{ worker_django_settings_module }} celery worker --loglevel=info --queues=edx.{{ w.service_variant }}.core.{{ w.queue }} --hostname=edx.{{ w.service_variant }}.core.{{ w.queue }}.%%h --concurrency={{ w.concurrency }} {{ '--maxtasksperchild ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }}
command={
{ edxapp_app_dir }}/worker.sh
{{ w.service_variant }} --settings={{ worker_django_settings_module }} celery worker --loglevel=info --queues=edx.{{ w.service_variant }}.core.{{ w.queue }} --hostname=edx.{{ w.service_variant }}.core.{{ w.queue }}.%%h --concurrency={{ w.concurrency }} {{ '--maxtasksperchild ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }}
killasgroup=true
stopwaitsecs={{ w.stopwaitsecs | default(EDXAPP_WORKER_DEFAULT_STOPWAITSECS) }}
; Set autorestart to `true`. The default value for autorestart is `unexpected`, but celery < 4.x will exit
...
...
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