Merge pull request #1853 from edx/db/update-comments
Updating comments and docs for MITx -> edX transition
This commit is contained in:
@@ -11,7 +11,7 @@ from auth.authz import _copy_course_group
|
||||
|
||||
|
||||
#
|
||||
# To run from command line: rake cms:clone SOURCE_LOC=MITx/111/Foo1 DEST_LOC=MITx/135/Foo3
|
||||
# To run from command line: rake cms:clone SOURCE_LOC=edX/111/Foo1 DEST_LOC=edX/135/Foo3
|
||||
#
|
||||
class Command(BaseCommand):
|
||||
"""Clone a MongoDB-backed course to another location"""
|
||||
|
||||
@@ -7,7 +7,7 @@ from contentstore.utils import delete_course_and_groups
|
||||
|
||||
|
||||
#
|
||||
# To run from command line: rake cms:delete_course LOC=MITx/111/Foo1
|
||||
# To run from command line: rake cms:delete_course LOC=edX/111/Foo1
|
||||
#
|
||||
class Command(BaseCommand):
|
||||
help = '''Delete a MongoDB backed course'''
|
||||
@@ -23,7 +23,7 @@ class Command(BaseCommand):
|
||||
commit = args[1] == 'commit'
|
||||
|
||||
if commit:
|
||||
print 'Actually going to delete the course from DB....'
|
||||
print('Actually going to delete the course from DB....')
|
||||
|
||||
if query_yes_no("Deleting course {0}. Confirm?".format(course_id), default="no"):
|
||||
if query_yes_no("Are you sure. This action cannot be undone!", default="no"):
|
||||
|
||||
@@ -67,11 +67,11 @@ ENABLE_JASMINE = False
|
||||
|
||||
|
||||
############################# SET PATH INFORMATION #############################
|
||||
PROJECT_ROOT = path(__file__).abspath().dirname().dirname() # /mitx/cms
|
||||
PROJECT_ROOT = path(__file__).abspath().dirname().dirname() # /edx-platform/cms
|
||||
REPO_ROOT = PROJECT_ROOT.dirname()
|
||||
COMMON_ROOT = REPO_ROOT / "common"
|
||||
LMS_ROOT = REPO_ROOT / "lms"
|
||||
ENV_ROOT = REPO_ROOT.dirname() # virtualenv dir /mitx is in
|
||||
ENV_ROOT = REPO_ROOT.dirname() # virtualenv dir /edx-platform is in
|
||||
|
||||
GITHUB_REPO_ROOT = ENV_ROOT / "data"
|
||||
|
||||
@@ -230,7 +230,7 @@ USE_I18N = False
|
||||
USE_L10N = True
|
||||
|
||||
# Localization strings (e.g. django.po) are under this directory
|
||||
LOCALE_PATHS = (REPO_ROOT + '/conf/locale',) # mitx/conf/locale/
|
||||
LOCALE_PATHS = (REPO_ROOT + '/conf/locale',) # edx-platform/conf/locale/
|
||||
|
||||
# Messages
|
||||
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
|
||||
|
||||
@@ -4,7 +4,7 @@ sessions. Assumes structure:
|
||||
|
||||
/envroot/
|
||||
/db # This is where it'll write the database file
|
||||
/mitx # The location of this repo
|
||||
/edx-platform # The location of this repo
|
||||
/log # Where we're going to write log files
|
||||
"""
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ def replace_static_urls(text, data_directory, course_id=None, static_asset_path=
|
||||
# if we're running with a MongoBacked store course_namespace is not None, then use studio style urls
|
||||
elif (not static_asset_path) and course_id and modulestore().get_modulestore_type(course_id) != XML_MODULESTORE_TYPE:
|
||||
# first look in the static file pipeline and see if we are trying to reference
|
||||
# a piece of static content which is in the mitx repo (e.g. JS associated with an xmodule)
|
||||
# a piece of static content which is in the edx-platform repo (e.g. JS associated with an xmodule)
|
||||
|
||||
exists_in_staticfiles_storage = False
|
||||
try:
|
||||
|
||||
@@ -128,7 +128,7 @@ class GraphicalSliderToolModule(GraphicalSliderToolFields, XModule):
|
||||
html_string with their divs. Html_string is content of <render> tag
|
||||
inside <graphical_slider_tool> tag. Documentation on how information in
|
||||
<render> tag is organized and processed is located in:
|
||||
mitx/docs/build/html/graphical_slider_tool.html.
|
||||
edx-platform/docs/build/html/graphical_slider_tool.html.
|
||||
|
||||
Args:
|
||||
html_string: content of <render> tag, with controls as xml tags,
|
||||
|
||||
@@ -88,17 +88,17 @@ qthelp:
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MITx.qhcp"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/edX.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MITx.qhc"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/edX.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/MITx"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MITx"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/edX"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/edX"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
|
||||
@@ -97,9 +97,9 @@ Instead, hit /migrate/modules to see a list of all modules loaded, and click on
|
||||
github (or other equivalent git-based repository systems) used for
|
||||
course content can be setup to trigger an automatic reload when changes are pushed. Here is how:
|
||||
|
||||
1. Each content directory in mitx_all/data should be a clone of a git repo
|
||||
1. Each content directory in edx_all/data should be a clone of a git repo
|
||||
|
||||
2. The user running the mitx gunicorn process should have its ssh key registered with the git repo
|
||||
2. The user running the edx gunicorn process should have its ssh key registered with the git repo
|
||||
|
||||
3. The list settings.ALLOWED_GITRELOAD_IPS should contain the IP address of the git repo originating the gitreload request.
|
||||
By default, this list is ['207.97.227.253', '50.57.128.197', '108.171.174.178'] (the github IPs).
|
||||
@@ -109,9 +109,9 @@ course content can be setup to trigger an automatic reload when changes are push
|
||||
|
||||
{ "repository" : { "name" : reload_dir }
|
||||
|
||||
where reload_dir is the directory name of the content to reload (ie mitx_all/data/reload_dir should exist)
|
||||
where reload_dir is the directory name of the content to reload (ie edx_all/data/reload_dir should exist)
|
||||
|
||||
The mitx server will then do "git reset --hard HEAD; git clean -f -d; git pull origin" in that directory. After the pull,
|
||||
The edx server will then do "git reset --hard HEAD; git clean -f -d; git pull origin" in that directory. After the pull,
|
||||
it will reload the modulestore for that course.
|
||||
|
||||
Note that the gitreload-based workflow is not meant for deployments on AWS (or elsewhere) which use collectstatic, since collectstatic is not run by a gitreload event.
|
||||
|
||||
@@ -101,8 +101,6 @@ The LMS is a django site, with root in `lms/`. It runs in many different enviro
|
||||
|
||||
- ajax calls go to `module_render.py:handle_xblock_callback()`, which passes it to one of the `XBlock`s handler functions
|
||||
|
||||
- [This diagram](https://github.com/MITx/mitx/wiki/MITx-Architecture) visually shows how the clients communicate with problems + modules.
|
||||
|
||||
- See `lms/urls.py` for the wirings of urls to views.
|
||||
|
||||
- Tracking: there is support for basic tracking of client-side events in `lms/djangoapps/track`.
|
||||
|
||||
@@ -2,7 +2,7 @@ Grades can be pushed to a remote gradebook, and course enrollment membership can
|
||||
|
||||
1. Definitions
|
||||
|
||||
An "xserver" is a web-based server that is part of the MITx eco system. There are a number of "xserver" programs, including one which does python code grading, an xqueue server, and graders for other coding languages.
|
||||
An "xserver" is a web-based server that is part of the edX ecosystem. There are a number of "xserver" programs, including one which does python code grading, an xqueue server, and graders for other coding languages.
|
||||
|
||||
"Stellar" is the MIT on-campus gradebook system.
|
||||
|
||||
@@ -14,10 +14,10 @@ The remote gradebook xserver should be specified in the lms.envs configuration u
|
||||
|
||||
Each course, in addition, should define the name of the gradebook being used. A class "section" may also be specified. This goes in the policy.json file, eg:
|
||||
|
||||
"remote_gradebook": {
|
||||
"name" : "STELLAR:/project/mitxdemosite",
|
||||
"section" : "r01"
|
||||
},
|
||||
"remote_gradebook": {
|
||||
"name" : "STELLAR:/project/edxdemosite",
|
||||
"section" : "r01"
|
||||
},
|
||||
|
||||
3. The API for the remote gradebook xserver is an almost RESTful service model, which only employs POSTs, to the xserver url, with form data for the fields:
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import os, json
|
||||
import os
|
||||
import json
|
||||
from path import path
|
||||
|
||||
# BASE_DIR is the working directory to execute django-admin commands from.
|
||||
# Typically this should be the 'mitx' directory.
|
||||
# Typically this should be the 'edx-platform' directory.
|
||||
BASE_DIR = path(__file__).abspath().dirname().joinpath('..').normpath()
|
||||
|
||||
# LOCALE_DIR contains the locale files.
|
||||
# Typically this should be 'mitx/conf/locale'
|
||||
LOCALE_DIR = BASE_DIR.joinpath('conf', 'locale')
|
||||
# Typically this should be 'edx-platform/conf/locale'
|
||||
LOCALE_DIR = BASE_DIR.joinpath('conf', 'locale')
|
||||
|
||||
|
||||
class Configuration:
|
||||
"""
|
||||
@@ -61,7 +63,7 @@ class Configuration:
|
||||
def get_messages_dir(self, locale):
|
||||
"""
|
||||
Returns the name of the directory holding the po files for locale.
|
||||
Example: mitx/conf/locale/fr/LC_MESSAGES
|
||||
Example: edx-platform/conf/locale/fr/LC_MESSAGES
|
||||
"""
|
||||
return LOCALE_DIR.joinpath(locale, 'LC_MESSAGES')
|
||||
|
||||
@@ -69,7 +71,7 @@ class Configuration:
|
||||
def source_messages_dir(self):
|
||||
"""
|
||||
Returns the name of the directory holding the source-language po files (English).
|
||||
Example: mitx/conf/locale/en/LC_MESSAGES
|
||||
Example: edx-platform/conf/locale/en/LC_MESSAGES
|
||||
"""
|
||||
return self.get_messages_dir(self.source_locale)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
necessary as part of the build process since these .mofiles are
|
||||
needed by Django when serving the web app.
|
||||
|
||||
The configuration file (in mitx/conf/locale/config) specifies which
|
||||
The configuration file (in edx-platform/conf/locale/config) specifies which
|
||||
languages to generate.
|
||||
"""
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# $ ./make_dummy.py ../conf/locale/en/LC_MESSAGES/django.po
|
||||
#
|
||||
# generates output to
|
||||
# mitx/conf/locale/eo/LC_MESSAGES/django.po
|
||||
# edx-platform/conf/locale/eo/LC_MESSAGES/django.po
|
||||
|
||||
import os, sys
|
||||
import polib
|
||||
|
||||
@@ -9,14 +9,14 @@ def user_is_article_course_staff(user, article):
|
||||
"""
|
||||
The root of a course wiki is /<course_number>. This means in case there
|
||||
are two courses which have the same course_number they will end up with
|
||||
the same course wiki root e.g. MITX/Phy101/Spring and HarvardX/Phy101/Fall
|
||||
the same course wiki root e.g. MITx/Phy101/Spring and HarvardX/Phy101/Fall
|
||||
will share /Phy101.
|
||||
|
||||
This looks at the course wiki root of the article and returns True if
|
||||
the user belongs to a group whose name starts with 'instructor_' or
|
||||
'staff_' and contains '/<course_wiki_root_slug>/'. So if the user is
|
||||
staff on course MITX/Phy101/Spring they will be in
|
||||
'instructor_MITX/Phy101/Spring' or 'staff_MITX/Phy101/Spring' groups and
|
||||
staff on course MITx/Phy101/Spring they will be in
|
||||
'instructor_MITx/Phy101/Spring' or 'staff_MITx/Phy101/Spring' groups and
|
||||
so this will return True.
|
||||
"""
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5 # seconds
|
||||
PROJECT_ROOT = path(__file__).abspath().dirname().dirname() # /edx-platform/lms
|
||||
REPO_ROOT = PROJECT_ROOT.dirname()
|
||||
COMMON_ROOT = REPO_ROOT / "common"
|
||||
ENV_ROOT = REPO_ROOT.dirname() # virtualenv dir /mitx is in
|
||||
ENV_ROOT = REPO_ROOT.dirname() # virtualenv dir /edx-platform is in
|
||||
COURSES_ROOT = ENV_ROOT / "data"
|
||||
|
||||
DATA_DIR = COURSES_ROOT
|
||||
@@ -245,7 +245,7 @@ STATUS_MESSAGE_PATH = ENV_ROOT / "status_message.json"
|
||||
############################ OpenID Provider ##################################
|
||||
OPENID_PROVIDER_TRUSTED_ROOTS = ['cs50.net', '*.cs50.net']
|
||||
|
||||
################################## MITXWEB #####################################
|
||||
################################## EDX WEB #####################################
|
||||
# This is where we stick our compiled template files. Most of the app uses Mako
|
||||
# templates
|
||||
from tempdir import mkdtemp_clean
|
||||
@@ -490,7 +490,7 @@ MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
|
||||
# gitreload is used in LMS-workflow to pull content from github
|
||||
# gitreload requests are only allowed from these IP addresses, which are
|
||||
# the advertised public IPs of the github WebHook servers.
|
||||
# These are listed, eg at https://github.com/MITx/mitx/admin/hooks
|
||||
# These are listed, eg at https://github.com/edx/edx-platform/admin/hooks
|
||||
|
||||
ALLOWED_GITRELOAD_IPS = ['207.97.227.253', '50.57.128.197', '108.171.174.178']
|
||||
|
||||
@@ -821,7 +821,7 @@ STATICFILES_IGNORE_PATTERNS = (
|
||||
|
||||
PIPELINE_YUI_BINARY = 'yui-compressor'
|
||||
|
||||
# Setting that will only affect the MITx version of django-pipeline until our changes are merged upstream
|
||||
# Setting that will only affect the edX version of django-pipeline until our changes are merged upstream
|
||||
PIPELINE_COMPILE_INPLACE = True
|
||||
|
||||
################################# CELERY ######################################
|
||||
|
||||
@@ -4,7 +4,7 @@ sessions. Assumes structure:
|
||||
|
||||
/envroot/
|
||||
/db # This is where it'll write the database file
|
||||
/mitx # The location of this repo
|
||||
/edx-platform # The location of this repo
|
||||
/log # Where we're going to write log files
|
||||
"""
|
||||
|
||||
@@ -158,9 +158,9 @@ if os.path.isdir(DATA_DIR):
|
||||
]
|
||||
|
||||
|
||||
################################# mitx revision string #####################
|
||||
################################# edx-platform revision string #####################
|
||||
|
||||
MITX_VERSION_STRING = os.popen('cd %s; git describe' % REPO_ROOT).read().strip()
|
||||
EDX_PLATFORM_VERSION_STRING = os.popen('cd %s; git describe' % REPO_ROOT).read().strip()
|
||||
|
||||
############################ Open ended grading config #####################
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ sessions. Assumes structure:
|
||||
|
||||
/envroot/
|
||||
/db # This is where it'll write the database file
|
||||
/mitx # The location of this repo
|
||||
/edx-platform # The location of this repo
|
||||
/log # Where we're going to write log files
|
||||
"""
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Assumptions:
|
||||
|
||||
Dir structure:
|
||||
/envroot/
|
||||
/mitx # The location of this repo
|
||||
/edx-platform # The location of this repo
|
||||
/log # Where we're going to write log files
|
||||
|
||||
"""
|
||||
|
||||
@@ -10,7 +10,7 @@ COURSE_TITLE = "edx4edx: edX Author Course"
|
||||
EDX4EDX_ROOT = ENV_ROOT / "data/edx4edx"
|
||||
|
||||
### Dark code. Should be enabled in local settings for devel.
|
||||
ENABLE_MULTICOURSE = True # set to False to disable multicourse display (see lib.util.views.mitxhome)
|
||||
ENABLE_MULTICOURSE = True # set to False to disable multicourse display (see lib.util.views.edxhome)
|
||||
###
|
||||
PIPELINE_CSS_COMPRESSOR = None
|
||||
PIPELINE_JS_COMPRESSOR = None
|
||||
|
||||
@@ -4,7 +4,7 @@ sessions. Assumes structure:
|
||||
|
||||
/envroot/
|
||||
/db # This is where it'll write the database file
|
||||
/mitx # The location of this repo
|
||||
/edx-platform # The location of this repo
|
||||
/log # Where we're going to write log files
|
||||
"""
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ sessions. Assumes structure:
|
||||
|
||||
/envroot/
|
||||
/db # This is where it'll write the database file
|
||||
/mitx # The location of this repo
|
||||
/edx-platform # The location of this repo
|
||||
/log # Where we're going to write log files
|
||||
"""
|
||||
|
||||
@@ -221,7 +221,7 @@ STATICFILES_DIRS.append(("uploads", MEDIA_ROOT))
|
||||
|
||||
new_staticfiles_dirs = []
|
||||
# Strip out any static files that aren't in the repository root
|
||||
# so that the tests can run with only the mitx directory checked out
|
||||
# so that the tests can run with only the edx-platform directory checked out
|
||||
for static_dir in STATICFILES_DIRS:
|
||||
# Handle both tuples and non-tuple directory definitions
|
||||
try:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Mapping of
|
||||
#
|
||||
# From the /mitx directory:
|
||||
# From the /edx-platform directory:
|
||||
# /usr/local/Cellar/nginx/1.2.2/sbin/nginx -p `pwd`/ -c nginx.conf
|
||||
|
||||
worker_processes 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Python libraries to install that are local to the mitx repo
|
||||
# Python libraries to install that are local to the edx-platform repo
|
||||
-e common/lib/calc
|
||||
-e common/lib/capa
|
||||
-e common/lib/chem
|
||||
|
||||
@@ -5,7 +5,7 @@ import os
|
||||
import sys
|
||||
|
||||
# I want this:
|
||||
# ERROR: test_update_and_fetch (mitx.cms.djangoapps.contentstore.tests.test_course_settings.CourseDetailsViewTest)
|
||||
# ERROR: test_update_and_fetch (edx-platform.cms.djangoapps.contentstore.tests.test_course_settings.CourseDetailsViewTest)
|
||||
# to become:
|
||||
# test --settings=cms.envs.test --pythonpath=. -s cms/djangoapps/contentstore/tests/test_course_settings.py:CourseDetailsViewTest.test_update_and_fetch
|
||||
|
||||
@@ -38,7 +38,7 @@ def main(argv):
|
||||
else:
|
||||
test_method = words[0]
|
||||
test_path = words[1].split('.')
|
||||
if test_path[0] == 'mitx':
|
||||
if test_path[0] == 'edx-platform':
|
||||
del test_path[0]
|
||||
test_class = test_path[-1]
|
||||
del test_path[-1]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Create symlinks from ~/mitx_all/data or $ROOT/data, with root passed as first arg
|
||||
# to all the test courses in mitx/common/test/data/
|
||||
# Create symlinks from ~/edx_all/data or $ROOT/data, with root passed as first arg
|
||||
# to all the test courses in edx-platform/common/test/data/
|
||||
|
||||
# posix compliant sanity check
|
||||
if [ -z $BASH ] || [ $BASH = "/bin/sh" ]; then
|
||||
@@ -9,20 +9,20 @@ echo "Please use the bash interpreter to run this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ROOT="${1:-$HOME/mitx_all}"
|
||||
ROOT="${1:-$HOME/edx_all}"
|
||||
|
||||
if [[ ! -d "$ROOT" ]]; then
|
||||
echo "'$ROOT' is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$ROOT/mitx" ]]; then
|
||||
echo "'$ROOT' is not the root mitx_all directory"
|
||||
if [[ ! -d "$ROOT/edx-platform" ]]; then
|
||||
echo "'$ROOT' is not the root edx_all directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$ROOT/data" ]]; then
|
||||
echo "'$ROOT' is not the root mitx_all directory"
|
||||
echo "'$ROOT' is not the root edx_all directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -30,7 +30,7 @@ echo "ROOT is $ROOT"
|
||||
|
||||
cd $ROOT/data
|
||||
|
||||
for course in $(/bin/ls ../mitx/common/test/data/)
|
||||
for course in $(/bin/ls ../edx-platform/common/test/data/)
|
||||
do
|
||||
# Get rid of the symlink if it already exists
|
||||
if [[ -L "$course" ]]; then
|
||||
@@ -39,7 +39,7 @@ do
|
||||
fi
|
||||
echo "Make link to '$course'"
|
||||
# Create it
|
||||
ln -s "../mitx/common/test/data/$course"
|
||||
ln -s "../edx-platform/common/test/data/$course"
|
||||
done
|
||||
|
||||
# go back to where we came from
|
||||
|
||||
Reference in New Issue
Block a user