Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

These instructions are based on using docker-compose overrides and copying/mounting the entire venv folder. This is no longer the

...

recommended approach.

This page will eventually be removed

prerequisite: have edx-plaform setup w/ tutor-nightly

  • Follow instructions to install nightly tutor for edx-platform development.

    • recommend using a docker-compose override to mount your local code and venv

      • tldr steps for mounting;

        • tutor dev bindmount lms /openedx/venv

        • cp -R "$(tutor config printroot)/volumes/venv" $HOME/tutor-venvs/edx-platform

          • output can be the directory of your choosing, $HOME/tutor-venvs is just an example

        • create a docker-compose.override.yml file (mine for example)

          Code Block
          languageyaml
          version: "3.7"
          services:
            lms:
              volumes:
                - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
                - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
            cms:
              volumes:
                - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
                - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
            lms-worker:
              volumes:
                - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
                - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
            cms-worker:
              volumes:
                - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
                - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv

Discovery Steps

  • To avoid issues with changing the tutor config I recommend stopping all services tutor dev stop

  • Install the nightly branch of the tutor-discovery plugin

    • git clone --branch=nightly https://github.com/overhangio/tutor-discovery.git

    • pip install -e ./tutor-discovery

    • warn: check the pip output to make sure your installed version of tutor is not modified from nightly to latest release.

  • Enable the discovery plugin tutor plugins enable discovery

  • Rebuild your tutor config tutor config save

  • Follow the same process you used for edx-plaform to mount a local venv and code

    • copy venv from container to your machine

      Code Block
      tutor dev bindmount discovery /openedx/venv/
    • move to a directory of your choosing. Note you can’t use to default output folder in tutor config since any service you run bindmount on will write here.

      Code Block
      cp -R "$(tutor config printroot)/volumes/venv" $HOME/tutor-venvs/discovery
    • override docker-compose to create a volume for your local discovery checkout and venv

    • $(tutor config printroot)/env/dev/docker-compose.override.yml

      Code Block
      languageyaml
      version: "3.7"
      services:
        lms:
          volumes:
            - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
            - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
        cms:
          volumes:
            - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
            - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
        lms-worker:
          volumes:
            - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
            - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
        cms-worker:
          volumes:
            - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
            - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
        discovery:
          volumes:
            - /Users/zhancock/workspace/course-discovery/:/openedx/discovery
            - /Users/zhancock/tutor-venvs/discovery/venv:/openedx/venv
  • Plugin scripts are run in a separate job container so we’ll need to mount volumes for these as well

  • $(tutor config printroot)/env/dev/docker-compose.jobs.override.yml

    Code Block
    languageyaml
    version: "3.7"
    services:
      discovery-job:
        volumes:
          - /Users/zhancock/workspace/course-discovery/:/openedx/discovery
          - /Users/zhancock/tutor-venvs/discovery/venv:/openedx/venv
      lms-job:
        volumes:
          - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
          - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
      cms-job:
        volumes:
          - /Users/zhancock/workspace/edx-platform/:/openedx/edx-platform
          - /Users/zhancock/tutor-venvs/edx-platform/venv:/openedx/venv
  • Install requirements based on local checkout

    Code Block
    tutor dev run discovery make requirements
  • (needs fix) change the partner code in the discovery plugin init script to ‘dev’

  • Run setup. This will handle database access, migrations, DOT application setup, sync courses etc

    Code Block
    tutor dev init -l discovery
  • Create a superuser to gain access to Django admin

    Code Block
    tutor dev run discovery ./manage.py createsuperuser
  • (needs fix) Disable production site configuration

Running Cache Programs

  • make sure the lms service user has the correct permissions

    • (needs fix) init does not create a user with correct perms

      Code Block
      tutor dev run lms ./manage.py lms manage_user lms_catalog_service_user lms_catalog_service_user@openedx --staff --superuser --unusable-password
  • run cache_programs

    Code Block
    tutor dev run lms ./manage.py lms cache_programs