Commit 5c42000d by John Jarvis

Merge pull request #147 from edx/jarv/single-instance-fixes

Jarv/single instance fixes
parents 49a36130 5326d93f
......@@ -49,7 +49,7 @@ cd configuration
pip install -r ansible-requirements.txt
cd playbooks
(adjust the settings in edx_sandbox.yml)
`ansible-playbook -vvv --user=ubuntu edx_sandbox.yml -i inventory.ini -e 'secure_dir=secure_example`
`ansible-playbook -vvv --user=ubuntu edx_sandbox.yml -i inventory.ini`
```
This will install the following services on a single instance
......
......@@ -4,10 +4,11 @@
gather_facts: False
vars:
keypair: continuous-integration
instance_type: m1.small
instance_type: m1.xlarge
security_group: sandbox
image: ami-d0f89fb9
region: us-east-1
instance_tags: '{"Name": "edx-sandbox"}'
roles:
- launch_instance
......@@ -17,10 +18,7 @@
gather_facts: True
vars:
migrate_db: True
vars_files:
- "{{ secure_dir }}/vars/edxapp_ref_users.yml"
- "{{ secure_dir }}/vars/edxapp_sandbox.yml"
mysql5_workaround: True
roles:
- common
- nginx
......
......@@ -28,6 +28,7 @@
- name: Copying ssh keys for admin users
authorized_key: user={{ item.user }} key="{{lookup('file', item.path)}}"
with_items: admin_keys
when: admin_keys is defined
tags:
- users
- admin_users
......
---
- include: create_users.yml
- name: Add user www-data
# This user should be created on the system by default
user: name=www-data
tags:
- pre_install
- update
- name: Create application root
# In the future consider making group edx r/t adm
file: path={{ app_base_dir }} state=directory owner=root group=adm mode=2775
......@@ -15,13 +22,13 @@
- update
- name: Create data dir
file: path={{ app_base_dir }}/data state=directory owner=root group=root
file: path={{ app_base_dir }}/data state=directory owner=www-data group=root
tags:
- pre_install
- update
- name: Create staticfiles dir
file: path={{ app_base_dir }}/staticfiles state=directory owner=root group=adm mode=2775
file: path={{ app_base_dir }}/staticfiles state=directory owner=www-data group=adm mode=2775
tags:
- pre_install
- update
......
......@@ -29,8 +29,7 @@
- update
- name: install a bunch of system packages on which LMS and CMS rely
apt: pkg={{item}} state=present
with_items: lms_debian_pkgs
apt: pkg={{','.join(lms_debian_pkgs)}} state=present
tags:
- lms
- cms
......
......@@ -15,10 +15,10 @@ edxapp_generic_auth_config: &edxapp_generic_auth
'AWS_SECRET_ACCESS_KEY': ''
'SECRET_KEY': ''
'XQUEUE_INTERFACE':
'basic_auth': [ 'noauth', 'noauth']
'basic_auth': [ 'edx', 'edx']
'django_auth': { 'password': 'password',
'username': 'lms'}
'url': 'https://localhost'
'url': 'https://localhost:18040'
'CONTENTSTORE':
'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore'
'OPTIONS':
......@@ -29,7 +29,7 @@ edxapp_generic_auth_config: &edxapp_generic_auth
'user': 'mongo'
'MODULESTORE':
'default':
'ENGINE': 'xmodule.modulestore.mongo.MongoModuleStore'
'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore'
'OPTIONS': &lms_modulestore_default_options
'collection': 'modulestore'
'db': 'edxapp'
......@@ -55,8 +55,8 @@ edxapp_generic_auth_config: &edxapp_generic_auth
'PORT': '3306'
'PEARSON_TEST_PASSWORD': ''
'OPEN_ENDED_GRADING_INTERFACE':
'url': ''
'password': ''
'url': 'http://localhost:18091'
'password': 'password'
'peer_grading': 'peer_grading'
'staff_grading': 'staff_grading'
'grading_controller': 'grading_controller'
......@@ -71,6 +71,8 @@ generic_env_config: &edxapp_generic_env
'BOOK_URL': ''
'CERT_QUEUE': 'certificates'
'LOCAL_LOGLEVEL': 'INFO'
# default email backed set to local SMTP
'EMAIL_BACKEND': 'django.core.mail.backends.smtp.EmailBackend'
'MITX_FEATURES':
'AUTH_USE_OPENID_PROVIDER': true
'CERTIFICATES_ENABLED': true
......@@ -92,7 +94,7 @@ generic_env_config: &edxapp_generic_env
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'
'KEY_FUNCTION': 'util.memcache.safe_key'
'KEY_PREFIX': 'sandbox_default'
'LOCATION': [ 'localhost' ]
'LOCATION': [ 'localhost:11211' ]
'general':
<<: *default_lms_cache
'KEY_PREFIX': 'sandbox_general'
......
......@@ -9,8 +9,59 @@ ease_venv_dir: "{{ venv_dir }}"
ora_gunicorn_workers: 4
ora_nginx_port: 18091
ora_gunicorn_port: 8091
ora_auth_config: {}
ora_env_config: {}
# ora_env_config and ora_auth_config
# should be overridden for your
# environment. The defaults are
# appropriate for running all edX
# services on a single server.
ora_env_config:
"LOGGING_ENV": "prod-grader"
"LOG_DIR": "/mnt/logs"
"REQUESTS_TIMEOUT": "5"
"QUEUES_TO_PULL_FROM": "open-ended"
"TIME_BETWEEN_XQUEUE_PULLS": "5"
"TIME_BETWEEN_EXPIRED_CHECKS": "1800"
"GRADER_SETTINGS_DIRECTORY": "grader_settings/"
"MAX_NUMBER_OF_TIMES_TO_RETRY_GRADING": "10"
"MIN_TO_USE_ML": "100"
"ML_PATH": "machine-learning/"
"ML_MODEL_PATH": "ml_models/"
"TIME_BETWEEN_ML_CREATOR_CHECKS": "300"
"TIME_BETWEEN_ML_GRADER_CHECKS": "5"
"MIN_TO_USE_PEER": "10"
"PEER_GRADER_COUNT": "3"
"PEER_GRADER_MINIMUM_TO_CALIBRATE": "3"
"PEER_GRADER_MAXIMUM_TO_CALIBRATE": "6"
"PEER_GRADER_MIN_NORMALIZED_CALIBRATION_ERROR": ".5"
"EXPIRE_SUBMISSIONS_AFTER": "1296000"
"RESET_SUBMISSIONS_AFTER": "600"
"LOCAL_LOGLEVEL": "DEBUG"
"DEBUG": false
"SYSLOG_SERVER": "localhost"
"USE_S3_TO_STORE_MODELS": false
"S3_BUCKETNAME": "openended-prod"
ora_auth_config:
"USERS":
"xqueue_pull": "password"
"lms": "password"
"XQUEUE_INTERFACE":
"django_auth":
"password": "password"
"username": "lms"
"basic_auth": [ "edx", "edx"]
"url": "http://localhost:18040"
"GRADING_CONTROLLER_INTERFACE":
"django_auth":
"password": "password"
"username": "lms"
"url": "http://localhost:18091"
'DATABASES':
'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'ora', 'USER': 'root', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '3306' }
'AWS_ACCESS_KEY_ID' : ''
'AWS_SECRET_ACCESS_KEY' : ''
ora_source_repo: https://github.com/edx/edx-ora.git
ora_version: 'HEAD'
ora_pre_requirements_file: "{{ ora_code_dir }}/pre-requirements.txt"
......
......@@ -14,6 +14,9 @@ rabbitmq_port: 5672
rabbitmq_auth_config:
erlang_cookie: "CHANGE ME"
admin:
- name: 'admin'
password: 'the example admin password'
# If the system is running out of an Amazon Web Services
# cloudformation stack, this group name can used to pull out
......
......@@ -10,9 +10,30 @@ xqueue_code_dir: "{{ app_base_dir }}/xqueue"
xqueue_nginx_port: 18040
xqueue_gunicorn_port: 8040
xqueue_env_config:
'XQUEUES':
# push queue
'edX-DemoX': 'http://localhost:18050'
# pull queues
'test-pull': !!null
'certificates': !!null
'open-ended': !!null
'XQUEUE_WORKERS_PER_QUEUE': 12
'LOGGING_ENV' : 'sandbox'
'LOG_DIR' : '/mnt/logs'
'SYSLOG_SERVER' : 'syslog.a.m.i4x.org'
'RABBIT_HOST' : 'localhost'
'S3_BUCKET_PREFIX' : 'sandbox-bucket'
xqueue_auth_config: {}
xqueue_env_config: {}
xqueue_auth_config:
'AWS_ACCESS_KEY_ID' : ''
'AWS_SECRET_ACCESS_KEY' : ''
'REQUESTS_BASIC_AUTH': ['edx', 'edx']
'USERS': {'lms': 'password'}
'RABBITMQ_USER': 'edx'
'RABBITMQ_PASS': 'edx'
'DATABASES':
'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'xqueue', 'USER': 'root', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '3306' }
xqueue_source_repo: https://github.com/edx/xqueue.git
xqueue_version: 'HEAD'
......
###############################################
# Sandbox configuration
#
# There should be nothing in this configuration
# that would be a problem if made public !!
#
# Configuration overview:
# - mysql installed on localhost
# - mongo installed on localhost
# - memcache installed on localhost
# - SES used for email (ses only perms)
#
# You must fill in credentials for sending
# mail using AWS
#
# Set the following before using this configuration
# configuration.
#
# * AWS_ACCESS_KEY_ID (lms, xqueue)
# * AWS_SECRET_ACCESS_KEY (lms, xqueue)
# * SESSION_COOKIE_DOMAIN
# * FEEDBACK_SUBMISSION_EMAIL
#
#Use YAML references (& and *) and hash merge <<: to factor out shared settings
#see http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
ora_env_config:
"LOGGING_ENV": "prod-grader"
"LOG_DIR": "/mnt/logs"
"REQUESTS_TIMEOUT": "5"
"QUEUES_TO_PULL_FROM": "open-ended"
"TIME_BETWEEN_XQUEUE_PULLS": "5"
"TIME_BETWEEN_EXPIRED_CHECKS": "1800"
"GRADER_SETTINGS_DIRECTORY": "grader_settings/"
"MAX_NUMBER_OF_TIMES_TO_RETRY_GRADING": "10"
"MIN_TO_USE_ML": "100"
"ML_PATH": "machine-learning/"
"ML_MODEL_PATH": "ml_models/"
"TIME_BETWEEN_ML_CREATOR_CHECKS": "300"
"TIME_BETWEEN_ML_GRADER_CHECKS": "5"
"MIN_TO_USE_PEER": "10"
"PEER_GRADER_COUNT": "3"
"PEER_GRADER_MINIMUM_TO_CALIBRATE": "3"
"PEER_GRADER_MAXIMUM_TO_CALIBRATE": "6"
"PEER_GRADER_MIN_NORMALIZED_CALIBRATION_ERROR": ".5"
"EXPIRE_SUBMISSIONS_AFTER": "1296000"
"RESET_SUBMISSIONS_AFTER": "600"
"LOCAL_LOGLEVEL": "DEBUG"
"DEBUG": false
"SYSLOG_SERVER": "localhost"
"USE_S3_TO_STORE_MODELS": false
"S3_BUCKETNAME": "openended-prod"
ora_auth_config:
"USERS":
"xqueue_pull": "password"
"lms": "password"
"XQUEUE_INTERFACE":
"django_auth":
"password": "password"
"username": "lms"
"basic_auth": [ "edx", "edx"]
"url": "http://localhost:18040"
"GRADING_CONTROLLER_INTERFACE":
"django_auth":
"password": "password"
"username": "lms"
"url": "http://localhost:18091"
'DATABASES':
'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'ora', 'USER': 'root', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '3306' }
'AWS_ACCESS_KEY_ID' : ''
'AWS_SECRET_ACCESS_KEY' : ''
xqueue_env_config:
'XQUEUES':
# push queue
'edX-DemoX': 'http://localhost:18050'
# pull queues
'test-pull': !!null
'certificates': !!null
'open-ended': !!null
'XQUEUE_WORKERS_PER_QUEUE': 12
'LOGGING_ENV' : 'sandbox'
'LOG_DIR' : '/mnt/logs'
'SYSLOG_SERVER' : 'syslog.a.m.i4x.org'
'RABBIT_HOST' : 'localhost'
'S3_BUCKET_PREFIX' : 'sandbox-bucket'
xqueue_auth_config:
'AWS_ACCESS_KEY_ID' : ''
'AWS_SECRET_ACCESS_KEY' : ''
'REQUESTS_BASIC_AUTH': ['edx', 'edx']
'USERS': {'lms': 'password'}
'RABBITMQ_USER': 'edx'
'RABBITMQ_PASS': 'edx'
'DATABASES':
'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'xqueue', 'USER': 'root', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '3306' }
edxapp_generic_auth_config: &edxapp_generic_auth
'CONTENTSTORE':
'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore'
'ANALYTICS_API_KEY': ''
'ZENDESK_USER': ''
'ZENDESK_API_KEY': ''
'CELERY_BROKER_USER': 'celery'
'CELERY_BROKER_PASSWORD': ''
# "ses-send" user on the main aws account, only
# has access to use ses
'AWS_ACCESS_KEY_ID': ''
'AWS_SECRET_ACCESS_KEY': ''
'CONTENTSTORE':
'OPTIONS':
'db': 'wwc'
'host': [ 'localhost' ]
'password': 'password'
'port': 27017
'user': 'mongo'
'DATABASES':
'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'wwc', 'USER': 'root', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '3306' }
'MODULESTORE':
'default':
'ENGINE': 'xmodule.modulestore.mongo.MongoModuleStore'
'OPTIONS': &lms_modulestore_default_options
'collection': 'modulestore'
'db': 'wwc'
'default_class': 'xmodule.hidden_module.HiddenDescriptor'
'fs_root': '/opt/wwc/data'
'host': ['localhost']
'password': 'password'
'port': 27017
'render_template': 'mitxmako.shortcuts.render_to_string'
'user': 'mongo'
# Needed for the CMS to be able to run update_templates
'direct':
'ENGINE': 'xmodule.modulestore.mongo.MongoModuleStore'
'OPTIONS': *lms_modulestore_default_options
'OPEN_ENDED_GRADING_INTERFACE': {
'url': '',
'password': '',
'peer_grading': 'peer_grading',
'staff_grading': 'staff_grading',
'grading_controller': 'grading_controller',
'username': 'lms'}
'PEARSON_TEST_PASSWORD': ''
'SECRET_KEY': 'secret'
'XQUEUE_INTERFACE':
'basic_auth': [ 'noauth', 'noauth']
'django_auth': { 'password': 'lms',
'username': 'lms'}
'url': ''
edxapp_generic_env_config: &edxapp_generic_env
'BOOK_URL': ''
'CERT_QUEUE': 'certificates'
'LOCAL_LOGLEVEL': 'INFO'
'MITX_FEATURES':
'AUTH_USE_OPENID_PROVIDER': true
'CERTIFICATES_ENABLED': true
'ENABLE_DISCUSSION_SERVICE': false
'ENABLE_INSTRUCTOR_ANALYTICS': false
'ENABLE_PEARSON_HACK_TEST': false
'SUBDOMAIN_BRANDING': false
'SUBDOMAIN_COURSE_LISTINGS': false
'WIKI_ENABLED': true
'SYSLOG_SERVER': 'syslog.a.m.i4x.org'
'SITE_NAME': 'example.com'
'LOG_DIR': '/mnt/logs/edx'
'MEDIA_URL': ''
'ANALYTICS_SERVER_URL': ''
'FEEDBACK_SUBMISSION_EMAIL': ''
'TIME_ZONE': 'America/New_York'
'CACHES': &lms_caches
'default':
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'
'KEY_FUNCTION': 'util.memcache.safe_key'
'KEY_PREFIX': 'sandbox'
'LOCATION': [ 'localhost:11211' ]
'general':
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'
'KEY_FUNCTION': 'util.memcache.safe_key'
'KEY_PREFIX': 'sandbox'
'LOCATION': [ 'localhost:11211' ]
'mongo_metadata_inheritance':
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'
'KEY_FUNCTION': 'util.memcache.safe_key'
'KEY_PREFIX': 'sandbox'
'LOCATION': [ 'localhost:11211' ]
'staticfiles':
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'
'KEY_FUNCTION': 'util.memcache.safe_key'
'KEY_PREFIX': 'sandbox'
'LOCATION': [ 'localhost:11211' ]
'celery':
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'
'KEY_FUNCTION': 'util.memcache.safe_key'
'KEY_PREFIX': 'sandbox'
'LOCATION': [ 'localhost:11211' ]
'CELERY_BROKER_TRANSPORT': 'amqp'
'CELERY_BROKER_HOSTNAME': ''
'COMMENTS_SERVICE_URL': ''
'LOGGING_ENV': 'sandbox'
'SESSION_COOKIE_DOMAIN': !!null
'COMMENTS_SERVICE_KEY': ''
lms_auth_config:
<<: *edxapp_generic_auth
lms_env_config:
<<: *edxapp_generic_env
lms_xml_auth_config:
<<: *edxapp_generic_auth
lms_xml_env_config:
<<: *edxapp_generic_env
cms_auth_config:
<<: *edxapp_generic_auth
cms_env_config:
<<: *edxapp_generic_env
lms_preview_auth_config:
<<: *edxapp_generic_auth
lms_preview_env_config:
<<: *edxapp_generic_env
rabbitmq_auth_config:
admin:
- name: 'admin'
password: 'the example admin password'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment