Skip to content

Commit

Permalink
rename to cairn
Browse files Browse the repository at this point in the history
  • Loading branch information
regisb committed Jun 8, 2021
1 parent a9f2f70 commit e8d3008
Show file tree
Hide file tree
Showing 48 changed files with 295 additions and 295 deletions.
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variables:
TUTOR_PLUGIN: vision
TUTOR_IMAGES: vision-clickhouse vision-superset
TUTOR_PYPI_PRIVATE_PACKAGE: tutor-vision
TUTOR_PLUGIN: cairn
TUTOR_IMAGES: cairn-clickhouse cairn-superset
TUTOR_PYPI_PRIVATE_PACKAGE: tutor-cairn
OPENEDX_RELEASE: koa

include:
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
recursive-include tutorvision/patches *
recursive-include tutorvision/templates *
recursive-include tutorcairn/patches *
recursive-include tutorcairn/templates *
36 changes: 18 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Tutor Vision: scalable, real-time analytics for Open edX
Tutor Cairn: scalable, real-time analytics for Open edX
========================================================

TODO: Sweet readme
Expand All @@ -8,74 +8,74 @@ Installation

::

tutor license install tutor-vision
tutor license install tutor-cairn

Usage
-----

::

tutor plugins enable vision
tutor plugins enable cairn
tutor local quickstart

Create an admin user to access the frontend::

# You will be prompted for a new password
tutor local run vision-superset superset fab create-admin --username yourusername --email [email protected]
tutor local run cairn-superset superset fab create-admin --username yourusername --email [email protected]

You can then access the frontend with the user credentials you just created. Open http(s)://vision.<YOUR_LMS_HOST> in your browser. When running locally, this will be http://vision.local.overhang.io. The admin user will automatically be granted access to the "openedx" database in Superset and will be able to query all tables.
You can then access the frontend with the user credentials you just created. Open http(s)://data.<YOUR_LMS_HOST> in your browser. When running locally, this will be http://data.local.overhang.io. The admin user will automatically be granted access to the "openedx" database in Superset and will be able to query all tables.

Management
----------

Most of your users should probably not have access to all data from all courses. To restrict a given user to one or more courses or organizations, select the course IDs and/or organization IDS to which the user should have access and create a user with limited access to the datalake::

tutor local run vision-clickhouse vision createuser --course-id='course-v1:edX+DemoX+Demo_Course' --org-id='edX' yourusername
tutor local run cairn-clickhouse cairn createuser --course-id='course-v1:edX+DemoX+Demo_Course' --org-id='edX' yourusername

Then, create the corresponding user on the frontend::

tutor local run vision-superset vision createuser yourusername [email protected]
tutor local run cairn-superset cairn createuser yourusername [email protected]

Your frontend user will automatically be associated to the datalake database you created, provided they share the same name.

Vision comes with a convenient pre-built dashboard that you can add to any user account::
Cairn comes with a convenient pre-built dashboard that you can add to any user account::

tutor local run vision-superset vision bootstrap-dashboards yourusername /app/bootstrap/courseoverview.json
tutor local run cairn-superset cairn bootstrap-dashboards yourusername /app/bootstrap/courseoverview.json

Course block IDs and names are loaded from the Open edX modulestore into the datalake. After making changes to your course, you might want to refresh the course structure stored in the datalake. To do so, run::

tutor local init --limit=vision
tutor local init --limit=cairn

Or, if you want to avoid running the full plugin initialization::

tutor local run \
-v $(tutor config printroot)/env/plugins/vision/apps/openedx/scripts/:/openedx/scripts \
-v $(tutor config printroot)/env/plugins/vision/apps/clickhouse/auth.json:/openedx/clickhouse-auth.json \
-v $(tutor config printroot)/env/plugins/cairn/apps/openedx/scripts/:/openedx/scripts \
-v $(tutor config printroot)/env/plugins/cairn/apps/clickhouse/auth.json:/openedx/clickhouse-auth.json \
lms python /openedx/scripts/importcoursedata.py

When running on Kubernetes instead of locally, most commands above can be re-written with `tutor k8s exec service "command"` instead of `tutor local run service command`. For instance::

# Privileved user creation
tutor k8s exec vision-superset "superset fab create-admin --username yourusername --email [email protected]"
tutor k8s exec cairn-superset "superset fab create-admin --username yourusername --email [email protected]"
# Unprivileged user creation
tutor k8s exec vision-clickhouse "vision createuser --course-id='course-v1:edX+DemoX+Demo_Course' --org-id='edX' yourusername"
tutor k8s exec vision-superset "vision createuser yourusername [email protected]"
tutor k8s exec cairn-clickhouse "cairn createuser --course-id='course-v1:edX+DemoX+Demo_Course' --org-id='edX' yourusername"
tutor k8s exec cairn-superset "cairn createuser yourusername [email protected]"

Development
-----------


To reload Vector configuration after changes to vector.toml, run::

tutor config save && tutor local exec vision-vector sh -c "kill -s HUP 1"
tutor config save && tutor local exec cairn-vector sh -c "kill -s HUP 1"

To explore the clickhouse database as root, run::

tutor local run vision-clickhouse vision client
tutor local run cairn-clickhouse cairn client

To launch a Python shell in Superset, run::

tutor local run vision-superset superset shell
tutor local run cairn-superset superset shell


License
Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def load_readme():
def load_about():
about = {}
with io.open(
os.path.join(HERE, "tutorvision", "__about__.py"),
os.path.join(HERE, "tutorcairn", "__about__.py"),
"rt",
encoding="utf-8",
) as f:
Expand All @@ -25,22 +25,22 @@ def load_about():


setup(
name="tutor-vision",
name="tutor-cairn",
version=ABOUT["__version__"],
url="https://github.com/overhangio/tutor-vision",
url="https://github.com/overhangio/tutor-cairn",
project_urls={
"Code": "https://github.com/overhangio/tutor-vision",
"Issue tracker": "https://github.com/overhangio/tutor-vision/issues",
"Code": "https://github.com/overhangio/tutor-cairn",
"Issue tracker": "https://github.com/overhangio/tutor-cairn/issues",
},
license="AGPLv3",
author="Overhang.IO",
description="vision plugin for Tutor",
description="cairn plugin for Tutor",
long_description=load_readme(),
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
python_requires=">=3.5",
install_requires=["tutor-openedx"],
entry_points={"tutor.plugin.v0": ["vision = tutorvision.plugin"]},
entry_points={"tutor.plugin.v0": ["cairn = tutorcairn.plugin"]},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions tutorcairn/patches/caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Cairn
{{ CAIRN_HOST }}{% if not ENABLE_HTTPS %}:80{% endif %} {
reverse_proxy nginx:80
}
Loading

0 comments on commit e8d3008

Please sign in to comment.