Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade codebase to koa.2 release #12

Open
wants to merge 9 commits into
base: open-release/steamvn.master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Stable code from KOA release, can build the image and work with tutor…
… on local machine
vthily committed Apr 11, 2021
commit 6efbafd754419a6e2fbe21540469afd7041ec4ff
The diff you're trying to view is too large. We only load the first 3000 changed files.
36 changes: 8 additions & 28 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -2,16 +2,12 @@
# ** DO NOT EDIT THIS FILE **
# ***************************
#
# This file was generated by edx-lint: https://github.com/edx/edx-lint
# This file was generated by edx-lint: http://github.com/edx/edx-lint
#
# If you want to change this file, you have two choices, depending on whether
# you want to make a local change that applies only to this repo, or whether
# you want to make a central change that applies to all repos using edx-lint.
#
# Note: If your pylintrc file is simply out-of-date relative to the latest
# pylintrc rules in edx-lint, ensure you have the latest edx-lint installed
# and then follow the steps for a "LOCAL CHANGE".
#
# LOCAL CHANGE:
#
# 1. Edit the local .editorconfig_tweaks file to add changes just to this
@@ -30,28 +26,17 @@
# 1. Edit the .editorconfig file in the edx-lint repo at
# https://github.com/edx/edx-lint/blob/master/edx_lint/files/.editorconfig
#
# 2. install the updated version of edx-lint (in edx-lint):
#
# $ pip install .
#
# 3. Run (in edx-lint):
#
# # uses .editorconfig_tweaks from edx-lint for linting in edx-lint
# # NOTE: Use Python 3.x, which no longer includes comments in the output file
# $ edx_lint write .editorconfig
#
# 4. Make a new version of edx_lint, submit and review a pull request with the
# .editorconfig update, and after merging, update the edx-lint version by
# creating a new tag in the repo (uses pbr).
# 2. Make a new version of edx_lint, which involves the usual steps of
# incrementing the version number, submitting and reviewing a pull
# request, and updating the edx-lint version reference in this repo.
#
# 5. In your local repo, install the newer version of edx-lint.
# 3. Install the newer version of edx-lint.
#
# 6. Run:
# 4. Run:
#
# # uses local .editorconfig_tweaks
# $ edx_lint write .editorconfig
#
# 7. This will modify the local file. Submit a pull request to get it
# 5. This will modify the local file. Submit a pull request to get it
# checked in so that others will benefit.
#
#
@@ -67,8 +52,6 @@
# SERIOUSLY.
#
# ------------------------------
# Generated by edx-lint version: 1.6
# ------------------------------
[*]
end_of_line = lf
insert_final_newline = true
@@ -94,10 +77,7 @@ trim_trailing_whitespace = false
[.git/*]
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 72

[*.rst]
max_line_length = 79

# f541be688d5bfddc4fdfc961a52e93edd05bc244
# a699cc442902ab24adc720ac080c00e9ee72f728
7 changes: 4 additions & 3 deletions .github/workflows/docker-compose.yml.mysqldbdump
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '3'
services:
mysql:
image: mysql:5.7
container_name: edx.devstack.mysql57
image: mysql:5.6
container_name: edx.devstack.mysql
ports:
- '3306:3306'
environment:
@@ -20,4 +20,5 @@ services:
volumes:
- ../../:/edx/app/edxapp/edx-platform
depends_on:
- mysql
mysql:
condition: service_healthy
29 changes: 13 additions & 16 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
########################
############################
Contributing to Open edX
########################
############################

Contributions to Open edX are very welcome, and strongly encouraged! We've
put together `some documentation that describes our contribution process`_,
@@ -99,24 +99,19 @@ to ask clarifying questions on the ticket as needed, too, if anything is unclear
Step 1: Sign a Contribution Agreement
=====================================

Before edX can accept any code contributions from you, you'll need to sign the
`Individual Contributor Agreement`_. This confirms that you have the authority
to contribute the code in the pull request and ensures that edX can re-license
it.

.. _Individual Contributor Agreement: https://openedx.org/cla
Before edX can accept any code contributions from you, you'll need to sign
the `individual contributor agreement`_ and send it in. This confirms
that you have the authority to contribute the code in the pull request and
ensures that edX can relicense it.

If you will be contributing code on behalf of your employer or another
institution you are affiliated with, please reach out by email to legal@edx.org
to request the Entity Contributor Agreement.

Once we have received and processed your agreement, we will reach out to you by
email to confirm. (Please make sure to indicate your email correctly in the
agreement.) After that we can begin reviewing and merging your work.
You should print out the agreement and sign it. Then scan (or photograph) the
signed agreement and email it to the email address indicated on the agreement.
Alternatively, you're also free to physically mail the agreement to the street
address on the agreement. Once we have your agreement in hand, we can begin
reviewing and merging your work.

Step 2: Fork, Commit, and Pull Request
======================================

GitHub has some great documentation on `how to fork a git repository`_. Once
you've done that, make your changes and `send us a pull request`_! Be sure to
include a detailed description for your pull request, so that a community
@@ -219,3 +214,5 @@ Expectations You Have of Us

3. Once we have determined through visual review that your code is not
malicious, we will run a Jenkins build on your branch.

.. _individual contributor agreement: https://open.edx.org/wp-content/uploads/2019/01/individual-contributor-agreement.pdf
20 changes: 1 addition & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -36,15 +36,11 @@ RUN apt-get update && \
libxml2-dev \
libxmlsec1-dev \
libxslt1-dev \
# lynx: Required by https://github.com/edx/edx-platform/blob/b489a4ecb122/openedx/core/lib/html_to_text.py#L16
lynx \
ntp \
pkg-config \
python3-pip \
python3 \
python3-dev \
python3-venv \
-qy && rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
@@ -60,10 +56,6 @@ ENV PATH /edx/app/edxapp/edx-platform/bin:${PATH}
ENV SETTINGS production
RUN mkdir -p /edx/etc/

# TODO: Install requirements before copying in code.
RUN pip install setuptools==39.0.1 pip==21.0.1
RUN pip install -r requirements/edx/base.txt

ENV VIRTUAL_ENV=/edx/app/edxapp/venvs/edxapp
RUN python3.8 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
@@ -105,16 +97,6 @@ FROM lms as lms-newrelic
RUN pip install newrelic
CMD newrelic-admin run-program gunicorn -c /edx/app/edxapp/edx-platform/lms/docker_lms_gunicorn.py --name lms --bind=0.0.0.0:8000 --max-requests=1000 --access-logfile - lms.wsgi:application


FROM lms as lms-devstack
# TODO: This compiles static assets.
# However, it's a bit of a hack, it's slow, and it's inefficient because makes the final Docker cache layer very large.
# We ought to be able to this higher up in the Dockerfile, and do it the same for Prod and Devstack.
RUN mkdir -p test_root/log
ENV DJANGO_SETTINGS_MODULE ""
RUN NO_PREREQ_INSTALL=1 paver update_assets lms --settings devstack_decentralized
ENV DJANGO_SETTINGS_MODULE lms.envs.devstack_decentralized

FROM lms as lms-devstack
# TODO: This compiles static assets.
# However, it's a bit of a hack, it's slow, and it's inefficient because makes the final Docker cache layer very large.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -67,9 +67,7 @@ pre-requirements: ## install Python requirements for running pip-tools
pip install -qr requirements/edx/pip-tools.txt

requirements: pre-requirements ## install development environment requirements
# The "$(wildcard..)" is to include private.txt if it exists, and make no mention
# of it if it does not. Shell wildcarding can't do that with default options.
pip-sync -q requirements/edx/development.txt $(wildcard requirements/edx/private.txt)
pip-sync -q requirements/edx/development.txt requirements/edx/private.*

shell: ## launch a bash shell in a Docker container with all edx-platform dependencies installed
docker run -it -e "NO_PYTHON_UNINSTALL=1" -e "PIP_INDEX_URL=https://pypi.python.org/simple" -e TERM \
@@ -132,3 +130,4 @@ docker_push: docker_tag docker_auth ## push to docker hub
docker push "openedx/edx-platform:${GITHUB_SHA}-newrelic"
docker push 'openedx/edx-platform:latest-devstack'
docker push "openedx/edx-platform:${GITHUB_SHA}-devstack"

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -86,5 +86,5 @@ Reporting Security Issues
Please do not report security issues in public. Please email
security@edx.org.

.. _individual contributor agreement: https://openedx.org/cla
.. _individual contributor agreement: https://openedx.org/wp-content/uploads/2019/01/individual-contributor-agreement.pdf
.. _CONTRIBUTING: https://github.com/edx/edx-platform/blob/master/CONTRIBUTING.rst
2 changes: 1 addition & 1 deletion cms/__init__.py
Original file line number Diff line number Diff line change
@@ -21,4 +21,4 @@
# This will make sure the app is always imported when Django starts so
# that shared_task will use this app, and also ensures that the celery
# singleton is always configured for the CMS.
from .celery import APP as CELERY_APP # lint-amnesty, pylint: disable=wrong-import-position
from .celery import APP as CELERY_APP
33 changes: 33 additions & 0 deletions cms/celery.py
Original file line number Diff line number Diff line change
@@ -8,8 +8,41 @@

import os

from openedx.core.lib.celery.routers import AlternateEnvironmentRouter

# Set the default Django settings module for the 'celery' program
# and then instantiate the Celery singleton.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cms.envs.production')
from openedx.core.lib.celery import APP # pylint: disable=wrong-import-position,unused-import

# Import after autodiscovery has had a chance to connect to the import_module signal
# so celery doesn't miss any apps getting installed.
from django.conf import settings # pylint: disable=wrong-import-position,wrong-import-order


class Router(AlternateEnvironmentRouter):
"""
An implementation of AlternateEnvironmentRouter, for routing tasks to non-cms queues.
"""

@property
def alternate_env_tasks(self):
"""
Defines alternate environment tasks, as a dict of form { task_name: alternate_queue }
"""
# The tasks below will be routed to the default lms queue.
return {
'completion_aggregator.tasks.update_aggregators': 'lms',
'openedx.core.djangoapps.content.block_structure.tasks.update_course_in_cache': 'lms',
'openedx.core.djangoapps.content.block_structure.tasks.update_course_in_cache_v2': 'lms',
}

@property
def explicit_queues(self):
"""
Defines specific queues for tasks to run in (typically outside of the cms environment),
as a dict of form { task_name: queue_name }.
"""
return {
'lms.djangoapps.grades.tasks.compute_all_grades_for_course': settings.POLICY_CHANGE_GRADES_ROUTING_KEY,
}
2 changes: 1 addition & 1 deletion cms/conftest.py
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ def _django_clear_site_cache():
clearing mechanism actually works. So override this fixture to not mess
with what has been working for us so far.
"""
pass # lint-amnesty, pylint: disable=unnecessary-pass
pass


@pytest.fixture(autouse=True)
7 changes: 5 additions & 2 deletions cms/devstack.yml
Original file line number Diff line number Diff line change
@@ -78,6 +78,9 @@ CACHES:
KEY_PREFIX: 1001c6274ca4_general
LOCATION:
- edx.devstack.memcached:11211
CAS_ATTRIBUTE_CALLBACK: ''
CAS_EXTRA_LOGIN_PARAMS: ''
CAS_SERVER_URL: ''
CELERY_BROKER_HOSTNAME: localhost
CELERY_BROKER_PASSWORD: celery
CELERY_BROKER_TRANSPORT: amqp
@@ -351,7 +354,7 @@ MODULESTORE:
OPTIONS:
default_class: xmodule.hidden_module.HiddenDescriptor
fs_root: /edx/var/edxapp/data
render_template: common.djangoapps.edxmako.shortcuts.render_to_string
render_template: edxmako.shortcuts.render_to_string
- DOC_STORE_CONFIG:
authsource: ''
collection: modulestore
@@ -371,7 +374,7 @@ MODULESTORE:
OPTIONS:
default_class: xmodule.hidden_module.HiddenDescriptor
fs_root: /edx/var/edxapp/data
render_template: common.djangoapps.edxmako.shortcuts.render_to_string
render_template: edxmako.shortcuts.render_to_string
ORA2_FILE_PREFIX: default_env-default_deployment/ora2
PARSE_KEYS: {}
PARTNER_SUPPORT_EMAIL: ''
2 changes: 1 addition & 1 deletion cms/djangoapps/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# lint-amnesty, pylint: disable=missing-module-docstring
# pylint: disable=missing-module-docstring
default_app_config = 'cms.djangoapps.api.apps.ApiConfig'
Loading