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.
On Open edX Devstack:
Clone this repo into your devstack's
src
folder:git clone git@github.com:open-craft/openedx-blockstore-relay.git
Install it into Studio's devstack python environment:
make studio-shell pip install -e /edx/src/openedx-blockstore-relay/
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.
On your host machine, create/edit edx-platform/cms/envs/private.py and add:
BLOCKSTORE_API_URL = "http://edx.devstack.blockstore:18250/api/v1/"
Any commands shown in this section should be run from the Studio docker shell (make studio-shell
).
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.
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"
- Go to http://localhost:18250/admin/bundles/bundle/ in a browser to see the newly created bundle.
Run the tests from the devstack CMS shell (make studio-shell
) using:
make -f /edx/src/openedx-blockstore-relay/Makefile validate
The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.
Please see LICENSE.txt
for details.
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
Please do not report security issues in public. Please email security@edx.org.
Have a question about this repository, or about Open edX in general? Please refer to this list of resources if you need any assistance.