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
54784bea
Commit
54784bea
authored
Sep 20, 2013
by
e0d
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding analytics experiments role
parent
baa9d2ce
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
323 additions
and
0 deletions
+323
-0
playbooks/roles/analytics-experiments/files/git_ssh.sh
+2
-0
playbooks/roles/analytics-experiments/handlers/main.yml
+22
-0
playbooks/roles/analytics-experiments/tasks/deploy.yml
+98
-0
playbooks/roles/analytics-experiments/tasks/main.yml
+102
-0
playbooks/roles/analytics-experiments/templates/etc/init/analytics.conf
+21
-0
playbooks/roles/analytics-experiments/templates/etc/init/analytics.conf.j2
+21
-0
playbooks/roles/analytics-experiments/templates/opt/wwc/analytics-experiments/analytics-experiments_env.j2
+8
-0
playbooks/roles/analytics-experiments/vars/main.yml
+49
-0
No files found.
playbooks/roles/analytics-experiments/files/git_ssh.sh
0 → 100644
View file @
54784bea
#!/bin/sh
exec
/usr/bin/ssh
-o
StrictHostKeyChecking
=
no
-i
/etc/git-identity
"
$@
"
playbooks/roles/analytics-experiments/handlers/main.yml
0 → 100644
View file @
54784bea
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Handlers for role analytics-experiments
#
# Overview:
#
#
-
name
:
analytics-experiments | stop the analytics service
service
:
name=analytics state=stopped
-
name
:
analytics-experiments | restart the analytics service
service
:
name=analytics state=started
playbooks/roles/analytics-experiments/tasks/deploy.yml
0 → 100644
View file @
54784bea
#
# TODO: Needed while this repo is private
#
-
name
:
analytics-experiments | upload ssh script
copy
:
src=git_ssh.sh dest=/tmp/git_ssh.sh
force=yes owner=root group=adm mode=750
tags
:
-
analytics-experiments
-
deploy
-
install
-
update
#
# TODO: Needed while this repo is private
#
-
name
:
analytics-experiments | install read-only ssh key required for checkout
copy
:
src={{ ax_git_identity_path }} dest=/etc/git-identity
force=yes owner=ubuntu group=adm mode=60
tags
:
-
analytics-experiments
-
deploy
-
install
-
update
-
name
:
analytics-experiments | checkout code
git
:
dest={{ ax_code_dir }} repo={{ ax_source_repo }}
version={{ ax_version }}
environment
:
GIT_SSH
:
/tmp/git_ssh.sh
notify
:
analytics-experiments | restart the analytics service
tags
:
-
analytics-experiments
-
deploy
-
install
-
update
#
# TODO: Needed while this repo is private
#
-
name
:
analytics-experiments | update src permissions
file
:
path={{ ax_code_dir }} state=directory owner={{ ax_user }}
group={{ ax_web_user }} mode=2750 recurse=yes
tags
:
-
analytics-experiments
-
deploy
-
install
-
update
#
# TODO: Needed while this repo is private
#
-
name
:
analytics-experiments | remove read-only ssh key for the content repo
file
:
path=/etc/git-identity state=absent
tags
:
-
analytics-experiments
-
deploy
-
install
-
update
#
# TODO: Needed while this repo is private
#
-
name
:
analytics-experiments | remove ssh script
file
:
path=/tmp/git_ssh.sh state=absent
tags
:
-
analytics-experiments
-
deploy
-
install
-
update
-
name
:
analytics-experiments | install application requirements
pip
:
requirements={{ ax_requirements_file }}
virtualenv={{ ax_venv_dir }} state=present
sudo
:
true
sudo_user
:
"
{{
ax_user
}}"
tags
:
-
analytics-experiments
-
deploy
-
install
-
update
#- name: analytics-experiments | syncdb
# shell: >
# cd {{ ax_code_dir }} && {{ ax_venv_dir }}/bin/python manage.py syncdb
# sudo: true
# sudo_user: "{{ ax_user }}"
# notify:
# - analytics-experiments | restart analytics-experiments
# tags:
# - analytics-experiments
# - deploy
# - install
# - update
playbooks/roles/analytics-experiments/tasks/main.yml
0 → 100644
View file @
54784bea
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Tasks for role analytics-experiments
#
# Overview:
#
#
# Dependencies:
#
#
# Example play:
#
#
-
name
:
analytics-experiments | install system packages
apt
:
pkg={{','.join(ax_debian_pkgs)}} state=present
tags
:
-
analytics-experiments
-
install
-
update
-
name
:
analytics-experiments | create analytics-experiments user {{ ax_user }}
user
:
name={{ ax_user }} state=present shell=/bin/bash
home={{ ax_home }} createhome=yes
tags
:
-
analytics-experiments
-
install
-
update
-
name
:
analytics-experiments | setup the analytics-experiments env
template
:
src=opt/wwc/analytics-experiments/{{ ax_env }}.j2
dest={{ ax_home }}/{{ ax_env }}
owner="{{ ax_user }}" group="{{ ax_user }}"
tags
:
-
analytics-experiments
-
install
-
update
-
name
:
analytics-experiments | drop a bash_profile
copy
:
>
src=../../common/files/bash_profile
dest={{ ax_home }}/.bash_profile
owner={{ ax_user }}
group={{ ax_user }}
-
name
:
analytics-experiments | ensure .bashrc exists
shell
:
touch {{ ax_home }}/.bashrc
sudo
:
true
sudo_user
:
"
{{
ax_user
}}"
tags
:
-
analytics-experiments
-
install
-
update
-
name
:
analytics-experiments | add source of analytics-experiments_env to .bashrc
lineinfile
:
dest={{ ax_home }}/.bashrc
regexp='. {{ ax_home }}/analytics-experiments_env'
line='. {{ ax_home }}/analytics_experiments_env'
tags
:
-
analytics-experiments
-
install
-
update
-
name
:
analytics-experiments | add source venv to .bashrc
lineinfile
:
dest={{ ax_home }}/.bashrc
regexp='. {{ ax_venv_dir }}/bin/activate'
line='. {{ ax_venv_dir }}/bin/activate'
tags
:
-
analytics-experiments
-
install
-
update
-
name
:
analytics-experiments | install global python requirements
pip
:
name={{ item }}
with_items
:
ax_pip_pkgs
tags
:
-
analytics-experiments
-
install
-
update
-
name
:
analtyics-experiments | install service
template
:
src=etc/init/analytics.conf.j2 dest=/etc/init/analytics.conf
owner=root group=root
-
include
:
deploy.yml
\ No newline at end of file
playbooks/roles/analytics-experiments/templates/etc/init/analytics.conf
0 → 100644
View file @
54784bea
# gunicorn
description
"Analytics server under gunicorn"
start
on
runlevel
[
2345
]
stop
on
runlevel
[!
2345
]
respawn
respawn
limit
3
30
env
SERVICE_VARIANT
={{
ax_service_variant
}}
env
PID
=/
var
/
tmp
/
analytics
.
pid
env
WORKERS
={{
ax_workers
}}
env
PORT
={{
ax_server_port
}}
env
LANG
={{
ax_env_lang
}}
env
DJANGO_SETTINGS_MODULE
={{
ax_django_settings
}}
chdir
{{
ax_code_dir
}}
setuid
{{
ax_web_user
}}
exec
{{
ax_venv_dir
}}/
bin
/
gunicorn
-
b
0
.
0
.
0
.
0
:$
PORT
-
w
$
WORKERS
--
pythonpath
={{
ax_code_dir
}}/
anserv
anserv
.
wsgi
playbooks/roles/analytics-experiments/templates/etc/init/analytics.conf.j2
0 → 100644
View file @
54784bea
# gunicorn
description "Analytics server under gunicorn"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 3 30
env SERVICE_VARIANT={{ ax_service_variant }}
env PID=/var/tmp/analytics.pid
env WORKERS={{ ax_workers }}
env PORT={{ ax_server_port }}
env LANG={{ ax_env_lang }}
env DJANGO_SETTINGS_MODULE={{ ax_django_settings }}
chdir {{ ax_code_dir }}
setuid {{ ax_web_user }}
exec {{ ax_venv_dir }}/bin/gunicorn -b 0.0.0.0:$PORT -w $WORKERS --pythonpath={{ ax_code_dir }}/anserv anserv.wsgi
playbooks/roles/analytics-experiments/templates/opt/wwc/analytics-experiments/analytics-experiments_env.j2
0 → 100644
View file @
54784bea
# {{ ansible_managed }}
{% for name,value in ax_env_vars.items() %}
{% if value %}
export {{ name }}="{{ value }}"
{% endif %}
{% endfor %}
\ No newline at end of file
playbooks/roles/analytics-experiments/vars/main.yml
0 → 100644
View file @
54784bea
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
# Vars for role analytics-experiments
# vars are namespace with the module name.
#
ax_role_name
:
"
analytics-experiments"
ax_user
:
"
analytics-experiments"
ax_home
:
"
/opt/wwc/analytics-experiments"
ax_venv_dir
:
"
{{
ax_home
}}/virtualenvs/analytics-experiments"
ax_source_repo
:
"
git@github.com:MITx/analytics-experiments.git"
ax_code_dir
:
"
{{
ax_home
}}/src"
ax_version
:
"
e0d/requirements-update"
ax_git_identity_path
:
"
{{
secure_dir
}}/files/git-identity"
ax_requirements_file
:
"
{{
ax_code_dir
}}/requirements.txt"
ax_log_level
:
"
INFO"
ax_rsyslog_enabled
:
"
yes"
ax_web_user
:
"
www-data"
ax_env
:
"
analytics-experiments_env"
ax_service_variant
:
'
analytics'
ax_workers
:
'
4'
ax_server_port
:
'
9000'
ax_env_lang
:
'
en_US.UTF-8'
ax_django_settings
:
'
anserv.settings'
ax_env_vars
:
ANALYTICS_EXPERIMENTS_LOG_LEVEL
:
"
{{
ax_log_level
}}"
#
# OS packages
#
ax_debian_pkgs
:
-
mongodb-clients
-
zip
ax_redhat_pkgs
:
[]
ax_pip_pkgs
:
-
git+https://github.com/s3tools/s3cmd.git#egg=s3cmd
\ No newline at end of file
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