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
aa8165a5
Commit
aa8165a5
authored
Oct 27, 2015
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2414 from edx/feanil/programs_pre_supervisor
Feanil/programs pre supervisor
parents
b2f44baa
a32d4937
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
playbooks/roles/supervisor/files/pre_supervisor_checks.py
+15
-4
playbooks/roles/supervisor/templates/etc/init/pre_supervisor.conf.j2
+7
-1
No files found.
playbooks/roles/supervisor/files/pre_supervisor_checks.py
View file @
aa8165a5
...
...
@@ -15,6 +15,7 @@ MIGRATION_COMMANDS = {
'cms'
:
"{python} {code_dir}/manage.py cms migrate --noinput --settings=aws --db-dry-run --merge"
,
'xqueue'
:
"{python} {code_dir}/manage.py xqueue migrate --noinput --settings=aws --db-dry-run --merge"
,
'ecommerce'
:
". {env_file}; {python} {code_dir}/manage.py migrate --noinput --list"
,
'programs'
:
". {env_file}; {python} {code_dir}/manage.py migrate --noinput --list"
,
'insights'
:
". {env_file}; {python} {code_dir}/manage.py migrate --noinput --list"
,
'analytics_api'
:
". {env_file}; {python} {code_dir}/manage.py migrate --noinput --list"
}
...
...
@@ -89,6 +90,15 @@ if __name__ == '__main__':
ecom_migration_args
.
add_argument
(
"--ecommerce-code-dir"
,
help
=
"Location to of the ecommerce code."
)
programs_migration_args
=
parser
.
add_argument_group
(
"programs_migrations"
,
"Args for running programs migration checks."
)
programs_migration_args
.
add_argument
(
"--programs-python"
,
help
=
"Path to python to use for executing migration check."
)
programs_migration_args
.
add_argument
(
"--programs-env"
,
help
=
"Location of the programs environment file."
)
programs_migration_args
.
add_argument
(
"--programs-code-dir"
,
help
=
"Location to of the programs code."
)
insights_migration_args
=
parser
.
add_argument_group
(
"insights_migrations"
,
"Args for running insights migration checks."
)
insights_migration_args
.
add_argument
(
"--insights-python"
,
...
...
@@ -156,8 +166,8 @@ if __name__ == '__main__':
play
=
play
,
instance_id
=
instance_id
)
break
except
:
print
(
"Failed to get EDP for {}
"
.
format
(
instance_id
))
except
Exception
as
e
:
print
(
"Failed to get EDP for {}
: {}"
.
format
(
instance_id
,
str
(
e
)
))
# With the time limit being 2 minutes we will
# try 5 times before giving up.
time
.
sleep
(
backoff
)
...
...
@@ -185,8 +195,8 @@ if __name__ == '__main__':
"cluster"
:
play
,
"instance-id"
:
instance_id
,
"created"
:
volume
.
create_time
})
except
:
msg
=
"Failed to tag volumes associated with {}
"
.
format
(
instance_id
)
except
Exception
as
e
:
msg
=
"Failed to tag volumes associated with {}
: {}"
.
format
(
instance_id
,
str
(
e
)
)
print
(
msg
)
if
notify
:
notify
(
msg
)
...
...
@@ -216,6 +226,7 @@ if __name__ == '__main__':
else
:
new_services
=
{
"ecommerce"
:
{
'python'
:
args
.
ecommerce_python
,
'env_file'
:
args
.
ecommerce_env
,
'code_dir'
:
args
.
ecommerce_code_dir
},
"programs"
:
{
'python'
:
args
.
programs_python
,
'env_file'
:
args
.
programs_env
,
'code_dir'
:
args
.
programs_code_dir
},
"insights"
:
{
'python'
:
args
.
insights_python
,
'env_file'
:
args
.
insights_env
,
'code_dir'
:
args
.
insights_code_dir
},
"analytics_api"
:
{
'python'
:
args
.
analytics_api_python
,
'env_file'
:
args
.
analytics_api_env
,
'code_dir'
:
args
.
analytics_api_code_dir
}
}
...
...
playbooks/roles/supervisor/templates/etc/init/pre_supervisor.conf.j2
View file @
aa8165a5
...
...
@@ -5,4 +5,10 @@ task
setuid {{ supervisor_user }}
exec {{ supervisor_venv_dir }}/bin/python {{ supervisor_app_dir }}/pre_supervisor_checks.py --available={{ supervisor_available_dir }} --enabled={{ supervisor_cfg_dir }} {% if SUPERVISOR_HIPCHAT_API_KEY is defined %}--hipchat-api-key {{ SUPERVISOR_HIPCHAT_API_KEY }} --hipchat-room {{ SUPERVISOR_HIPCHAT_ROOM }} {% endif %} {% if edxapp_code_dir is defined %}--edxapp-python {{ COMMON_BIN_DIR }}/python.edxapp --edxapp-code-dir {{ edxapp_code_dir }}{% endif %} {% if xqueue_code_dir is defined %}--xqueue-code-dir {{ xqueue_code_dir }} --xqueue-python {{ COMMON_BIN_DIR }}/python.xqueue {% endif %} {% if ecommerce_code_dir is defined %}--ecommerce-env {{ ecommerce_home }}/ecommerce_env --ecommerce-code-dir {{ ecommerce_code_dir }} --ecommerce-python {{ COMMON_BIN_DIR }}/python.ecommerce {% endif %} {% if insights_code_dir is defined %}--insights-env {{ insights_home }}/insights_env --insights-code-dir {{ insights_code_dir }} --insights-python {{ COMMON_BIN_DIR }}/python.insights {% endif %} {% if analytics_api_code_dir is defined %}--analytics-api-env {{ analytics_api_home }}/analytics_api_env --analytics-api-code-dir {{ analytics_api_code_dir }} --analytics-api-python {{ COMMON_BIN_DIR }}/python.analytics_api {% endif %}
{% if programs_code_dir is defined %}
{% set programs_command = "--programs-env " + programs_home + "/programs_env --programs-code-dir " + programs_code_dir + " --programs-python " + COMMON_BIN_DIR + "/python.programs" %}
{% else %}
{% set programs_command = "" %}
{% endif %}
exec {{ supervisor_venv_dir }}/bin/python {{ supervisor_app_dir }}/pre_supervisor_checks.py --available={{ supervisor_available_dir }} --enabled={{ supervisor_cfg_dir }} {% if SUPERVISOR_HIPCHAT_API_KEY is defined %}--hipchat-api-key {{ SUPERVISOR_HIPCHAT_API_KEY }} --hipchat-room {{ SUPERVISOR_HIPCHAT_ROOM }} {% endif %} {% if edxapp_code_dir is defined %}--edxapp-python {{ COMMON_BIN_DIR }}/python.edxapp --edxapp-code-dir {{ edxapp_code_dir }}{% endif %} {% if xqueue_code_dir is defined %}--xqueue-code-dir {{ xqueue_code_dir }} --xqueue-python {{ COMMON_BIN_DIR }}/python.xqueue {% endif %} {% if ecommerce_code_dir is defined %}--ecommerce-env {{ ecommerce_home }}/ecommerce_env --ecommerce-code-dir {{ ecommerce_code_dir }} --ecommerce-python {{ COMMON_BIN_DIR }}/python.ecommerce {% endif %} {% if insights_code_dir is defined %}--insights-env {{ insights_home }}/insights_env --insights-code-dir {{ insights_code_dir }} --insights-python {{ COMMON_BIN_DIR }}/python.insights {% endif %} {% if analytics_api_code_dir is defined %}--analytics-api-env {{ analytics_api_home }}/analytics_api_env --analytics-api-code-dir {{ analytics_api_code_dir }} --analytics-api-python {{ COMMON_BIN_DIR }}/python.analytics_api {% endif %} {{ programs_command }}
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