Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

open-craft/openedx-blockstore-relay

Repository files navigation

Blockstore Relay for Open edX

PyPI Travis Codecov Documentation Supported Python versions License

An Open edX Django plugin application for transferring data between Open edX and Blockstore.

The current version provides a management command which transfers a Unit (vertical) to a Blockstore Bundle.

Setup Instructions

On Open edX Devstack:

  1. Clone this repo into your devstack's src folder:

    git clone git@github.com:open-craft/openedx-blockstore-relay.git
  2. Install it into Studio's devstack python environment:

    make studio-shell
    pip install -e /edx/src/openedx-blockstore-relay/
  3. Confirm that the Studio docker container can connect to blockstore (run this from the Studio shell):

    curl edx.devstack.blockstore:18250/api/v1/ -v

    If it doesn't work, check the Blockstore readme for setup instructions.

  4. On your host machine, create/edit edx-platform/cms/envs/private.py and add:

    BLOCKSTORE_API_URL = "http://edx.devstack.blockstore:18250/api/v1/"

Usage Instructions

Any commands shown in this section should be run from the Studio docker shell (make studio-shell).

  1. Create a collection to hold the content you wish to import:

    curl -d '{"title": "XBlock Collection"}' -H "Content-Type: application/json" -X POST http://edx.devstack.blockstore:18250/api/v1/collections

    Note the UUID of the new collection.

  2. To upload a unit into blockstore, use the management command like this:

    ./manage.py cms transfer_to_blockstore --settings=devstack_docker --verbosity=2 \
    --block-key "block-v1:edX+DemoX+Demo_Course+type@vertical+block@256f17a44983429fb1a60802203ee4e0" \
    --collection-uuid "cccccccc-cccc-cccc-cccc-cccccccccccc"
  3. Go to http://localhost:18250/admin/bundles/bundle/ in a browser to see the newly created bundle.

Test Instructions

Run the tests from the devstack CMS shell (make studio-shell) using:

make -f /edx/src/openedx-blockstore-relay/Makefile validate

License

The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.

Please see LICENSE.txt for details.

How To Contribute

Contributions are very welcome.

Please read How To Contribute for details.

Even though they were written with edx-platform in mind, the guidelines should be followed for Open edX code in general.

PR description template should be automatically applied if you are sending PR from github interface; otherwise you can find it it at PULL_REQUEST_TEMPLATE.md

Issue report template should be automatically applied if you are sending it from github UI as well; otherwise you can find it at ISSUE_TEMPLATE.md

Reporting Security Issues

Please do not report security issues in public. Please email security@edx.org.

Getting Help

Have a question about this repository, or about Open edX in general? Please refer to this list of resources if you need any assistance.

About

Django plugin application providing a data and signal relay between Open edX and Blockstore.

Resources

License

Stars

Watchers

Forks

Packages

No packages published