From a6af8a4e0f0897ffc531f7ab3040359f2c2e969b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= <regis@behmo.com> Date: Thu, 16 Sep 2021 15:29:08 +0200 Subject: [PATCH] docs: add tutorial on running tutor edge --- docs/local.rst | 2 ++ docs/tutorials.rst | 1 + docs/tutorials/edge.rst | 57 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 docs/tutorials/edge.rst diff --git a/docs/local.rst b/docs/local.rst index bd76d55..b29b876 100644 --- a/docs/local.rst +++ b/docs/local.rst @@ -5,6 +5,8 @@ Local deployment This method is for deploying Open edX locally on a single server, where docker images are orchestrated with `docker-compose <https://docs.docker.com/compose/overview/>`_. +.. _tutor_root: + In the following, environment and data files will be generated in a user-specific project folder which will be referred to as the "**project root**". On Linux, the default project root is ``~/.local/share/tutor``. An alternative project root can be defined by passing the ``--root=...`` option to the ``tutor`` command, or defining the ``TUTOR_ROOT=...`` environment variable:: tutor --root=/path/to/tutorroot run ... diff --git a/docs/tutorials.rst b/docs/tutorials.rst index 88b7cfd..fe3301e 100644 --- a/docs/tutorials.rst +++ b/docs/tutorials.rst @@ -9,6 +9,7 @@ Open edX customization tutorials/theming tutorials/edx-platform-settings + tutorials/edge System administration --------------------- diff --git a/docs/tutorials/edge.rst b/docs/tutorials/edge.rst new file mode 100644 index 0000000..a34b0ea --- /dev/null +++ b/docs/tutorials/edge.rst @@ -0,0 +1,57 @@ +.. _edge: + +Running Open edX on the master branch ("edge") +============================================== + +Tutor was designed to make it easy for everyone to run the latest release of Open edX. But sometimes, you want to run the latest, bleeding edge version of Open edX. This is what we call "running master", as opposed to running the release branch. Running the master branch in production is strongly **not** recommended, unless you are an Open edX expert and you really know what you are doing. But Open edX developers frequently need to run the master branch locally to implement and test new features. Thus, Tutor makes it easy to run Open edX on the master branch: this is called "Tutor Edge". + +Installing Tutor Edge +--------------------- + +Running Tutor Edge requires more than setting a few configuration variables: because there are so many Open edX settings, version numbers, etc. which may change between the latest release and the current master branch, Tutor Edge is actually maintained as a separate branch of the Tutor repository. To install Tutor Edge, you should install Tutor from the "edge" branch of the source repository. To do so, run:: + + git clone --branch=edge https://github.com/overhangio/tutor.git + pip install -e ./tutor + +As usual, it is strongly recommended to run the command above in a `Python virtual environment <https://docs.python.org/3/tutorial/venv.html>`__. + +All Tutor plugins that you wish to use should likewise be installed from the "edge branch". For instance, the `MFE plugin <https://github.com/overhangio/tutor-mfe>`__:: + + git clone --branch=edge https://github.com/overhangio/tutor-mfe.git + pip install -e ./tutor-mfe + +You can then run the usual ``tutor`` commands :: + + tutor local quickstart + tutor local stop + tutor dev runserver lms + # ... + +Upgrading to the latest version of Open edX +------------------------------------------- + +To pull the latest upstream changes, you should first upgrade Tutor Edge:: + + cd ./tutor + git pull + +Then, you will have to generate a more recent version of the edge Docker images. Images for running Tutor Edge are published daily to docker.io (see `here <https://hub.docker.com/r/overhangio/openedx/tags?page=1&ordering=last_updated&name=edge>`__). You can fetch the latest images with:: + + tutor images pull all + +Alternatively, you may want to build the images yourself. As usual, this is done with:: + + tutor images build all + +However, these images include the application master branch at the point in time when the image was built. The Docker layer caching mechanism might cause the ``git clone`` step from the build to be skipped. In such cases, you will have to bypass the caching mechanism with:: + + tutor images build --no-cache all + +Running Tutor Edge alongside the latest release +----------------------------------------------- + +When running Tutor Edge, you usually do not want to override your existing Tutor installation. That's why a Tutor Edge installation has the following differences from a regular release installation: + +- The default Tutor project root is different in Tutor Edge. By default it is set to ``~/.local/share/tutor-edge`` on Linux (instead of ``~/.local/share/tutor``). To modify this location check the :ref:`corresponding documentation <tutor_root>`. +- The plugins root is set to ``~/.local/share/tutor-edge-plugins`` on Linux (instead of ``~/.local/share/tutor-plugins``). This location may be modified by setting the ``TUTOR_PLUGINS_ROOT`` environment variable. +- The default docker-compose project name is set to ``tutor_edge_local`` (instead of ``tutor_local``). This value may be modified by manually setting the ``LOCAL_PROJECT_NAME``.