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
cb0ada46
Commit
cb0ada46
authored
Oct 12, 2017
by
muhammad-ammar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video worker role
parent
e3fae697
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
216 additions
and
0 deletions
+216
-0
playbooks/roles/video_worker/defaults/main.yml
+56
-0
playbooks/roles/video_worker/meta/main.yml
+25
-0
playbooks/roles/video_worker/tasks/main.yml
+98
-0
playbooks/roles/video_worker/templates/edx/app/ecomworker/ecomworker.sh.j2
+18
-0
playbooks/roles/video_worker/templates/edx/app/ecomworker/ecomworker_env.j2
+7
-0
playbooks/roles/video_worker/templates/edx/app/supervisor/conf.d.available/ecomworker.conf.j2
+12
-0
No files found.
playbooks/roles/video_worker/defaults/main.yml
0 → 100644
View file @
cb0ada46
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
# Defaults for role video_worker.
#
VIDEO_WORKER_GIT_IDENTITY
:
!!null
VIDEO_WORKER_VERSION
:
'
master'
VIDEO_WORKER_REPOS
:
-
PROTOCOL
:
'
{{
COMMON_GIT_PROTOCOL
}}'
DOMAIN
:
'
{{
COMMON_GIT_MIRROR
}}'
PATH
:
'
{{
COMMON_GIT_PATH
}}'
REPO
:
edx-video-worker.git
VERSION
:
'
{{
VIDEO_WORKER_VERSION
}}'
DESTINATION
:
'
{{
video_worker_code_dir
}}'
SSH_KEY
:
'
{{
VIDEO_WORKER_GIT_IDENTITY
}}'
# Requires that New Relic be enabled via COMMON_ENABLE_NEWRELIC, and that
# a key be provided via NEWRELIC_LICENSE_KEY.
VIDEO_WORKER_NEWRELIC_APPNAME
:
'
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}-{{
video_worker_service_name
}}'
VIDEO_WORKER_BROKER_USERNAME
:
'
celery'
VIDEO_WORKER_BROKER_PASSWORD
:
'
celery'
# Used as the default RabbitMQ IP.
VIDEO_WORKER_BROKER_HOST
:
'
{{
ansible_default_ipv4.address
}}'
# Used as the default RabbitMQ port.
VIDEO_WORKER_BROKER_PORT
:
5672
VIDEO_WORKER_BROKER_URL
:
'
amqp://{{
VIDEO_WORKER_BROKER_USERNAME
}}:{{
VIDEO_WORKER_BROKER_PASSWORD
}}@{{
VIDEO_WORKER_BROKER_HOST
}}:{{
VIDEO_WORKER_BROKER_PORT
}}'
VIDEO_WORKER_CONCURRENCY
:
4
video_worker_environment
:
WORKER_CONFIGURATION_MODULE
:
'
video_worker.configuration.production'
video_worker_cfg
:
'
{{
COMMON_CFG_DIR
}}/{{
video_worker_service_name
}}.yml'
video_worker_service_name
:
'
video_worker'
video_worker_user
:
'
{{
video_worker_service_name
}}'
video_worker_home
:
'
{{
COMMON_APP_DIR
}}/{{
video_worker_service_name
}}'
video_worker_code_dir
:
'
{{
video_worker_home
}}/{{
video_worker_service_name
}}'
video_worker_log_dir
:
'
{{
COMMON_LOG_DIR
}}/{{
video_worker_service_name
}}'
video_worker_requirements_base
:
'
{{
video_worker_code_dir
}}/requirements'
video_worker_requirements
:
-
production.txt
-
optional.txt
# OS packages
video_worker_debian_pkgs
:
[]
oe
video_worker_redhat_pkgs
:
[]
playbooks/roles/video_worker/meta/main.yml
0 → 100644
View file @
cb0ada46
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
# Includes for role video_worker.
#
dependencies
:
-
common
-
supervisor
-
role
:
edx_service
edx_service_name
:
"
{{
ecommerce_worker_service_name
}}"
edx_service_config
:
"
{{
ECOMMERCE_WORKER_SERVICE_CONFIG
}}"
edx_service_repos
:
"
{{
ECOMMERCE_WORKER_REPOS
}}"
edx_service_user
:
"
{{
ecommerce_worker_user
}}"
edx_service_home
:
"
{{
ecommerce_worker_home
}}"
edx_service_packages
:
debian
:
"
{{
ecommerce_worker_debian_pkgs
}}"
redhat
:
"
{{
ecommerce_worker_redhat_pkgs
}}"
playbooks/roles/video_worker/tasks/main.yml
0 → 100644
View file @
cb0ada46
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
# Tasks for role ecommerce_worker.
#
-
name
:
install application requirements
pip
:
requirements
:
'
{{
ecommerce_worker_requirements_base
}}/{{
item
}}'
virtualenv
:
'
{{
ecommerce_worker_home
}}/venvs/{{
ecommerce_worker_service_name
}}'
state
:
present
become_user
:
'
{{
ecommerce_worker_user
}}'
with_items
:
"
{{
ecommerce_worker_requirements
}}"
tags
:
-
install
-
install:app-requirements
-
name
:
write out the supervisor wrapper
template
:
src
:
edx/app/ecomworker/ecomworker.sh.j2
dest
:
'
{{
ecommerce_worker_home
}}/{{
ecommerce_worker_service_name
}}.sh'
mode
:
0650
owner
:
'
{{
supervisor_user
}}'
group
:
'
{{
common_web_user
}}'
tags
:
-
install
-
install:configuration
-
name
:
write supervisord config
template
:
src
:
edx/app/supervisor/conf.d.available/ecomworker.conf.j2
dest
:
'
{{
supervisor_available_dir
}}/{{
ecommerce_worker_service_name
}}.conf'
owner
:
'
{{
supervisor_user
}}'
group
:
'
{{
common_web_user
}}'
mode
:
0644
tags
:
-
install
-
install:configuration
-
name
:
setup the ecommerce_worker env file
template
:
src
:
'
./{{
ecommerce_worker_home
}}/ecomworker_env.j2'
dest
:
'
{{
ecommerce_worker_home
}}/ecomworker_env'
owner
:
'
{{
ecommerce_worker_user
}}'
group
:
'
{{
ecommerce_worker_user
}}'
mode
:
0644
tags
:
-
install
-
install:configuration
-
name
:
enable supervisor script
file
:
src
:
'
{{
supervisor_available_dir
}}/{{
ecommerce_worker_service_name
}}.conf'
dest
:
'
{{
supervisor_cfg_dir
}}/{{
ecommerce_worker_service_name
}}.conf'
state
:
link
force
:
yes
when
:
not disable_edx_services
tags
:
-
install
-
install:configuration
-
name
:
update supervisor configuration
shell
:
'
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
update'
when
:
not disable_edx_services
tags
:
-
manage
-
manage:start
-
name
:
create symlinks from the venv bin dir
file
:
src
:
'
{{
ecommerce_worker_home
}}/venvs/{{
ecommerce_worker_service_name
}}/bin/{{
item
}}'
dest
:
'
{{
COMMON_BIN_DIR
}}/{{
item
}}.ecommerce_worker'
state
:
link
with_items
:
-
python
-
pip
tags
:
-
install
-
install:app-requirements
-
name
:
restart the applicaton
supervisorctl
:
state
:
restarted
supervisorctl_path
:
'
{{
supervisor_ctl
}}'
config
:
'
{{
supervisor_cfg
}}'
name
:
'
{{
ecommerce_worker_service_name
}}'
when
:
not disable_edx_services
become_user
:
'
{{
supervisor_service_user
}}'
tags
:
-
manage
-
manage:start
playbooks/roles/video_worker/templates/edx/app/ecomworker/ecomworker.sh.j2
0 → 100644
View file @
cb0ada46
#!/usr/bin/env bash
# {{ ansible_managed }}
{
%
set
ecommerce_worker_venv_bin
=
ecommerce_worker_home +
'/venvs/'
+ ecommerce_worker_service_name +
'/bin'
%
}
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
{
%
set
executable
=
ecommerce_worker_venv_bin +
'/newrelic-admin run-program '
+ ecommerce_worker_venv_bin +
'/celery'
%
}
{
%
else
%
}
{
%
set
executable
=
ecommerce_worker_venv_bin +
'/celery'
%
}
{
% endif %
}
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
export
NEW_RELIC_APP_NAME
=
'{{ ECOMMERCE_WORKER_NEWRELIC_APPNAME }}'
export
NEW_RELIC_LICENSE_KEY
=
'{{ NEWRELIC_LICENSE_KEY }}'
{
% endif -%
}
source
{{
ecommerce_worker_home
}}
/
{{
ecommerce_worker_service_name
}}
_env
{{
executable
}}
-A
ecommerce_worker worker
--app
ecommerce_worker.celery_app:app
--concurrency
={{
ECOMMERCE_WORKER_CONCURRENCY
}}
--loglevel
=
info
--queue
=
fulfillment,email_marketing
playbooks/roles/video_worker/templates/edx/app/ecomworker/ecomworker_env.j2
0 → 100644
View file @
cb0ada46
# {{ ansible_managed }}
{% for name,value in ecommerce_worker_environment.items() -%}
{%- if value -%}
export {{ name }}="{{ value }}"
{% endif %}
{%- endfor %}
playbooks/roles/video_worker/templates/edx/app/supervisor/conf.d.available/ecomworker.conf.j2
0 → 100644
View file @
cb0ada46
#
# {{ ansible_managed }}
#
[program:{{ ecommerce_worker_service_name }}]
command={{ ecommerce_worker_home }}/{{ ecommerce_worker_service_name }}.sh
user={{ common_web_user }}
directory={{ ecommerce_worker_code_dir }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log
killasgroup=true
stopasgroup=true
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