Running Docker-based Devstack


First, follow the instructions at https://github.com/edx/devstack


Frequently Asked Questions and Answers

The Hipchat room Devstack is a great place to get real-time help. However, please search for your problems below to see if another edX developer has already encountered such an issue

No Space Left on Device

Problem:

When you do "make pull", you encountered the error. The error message is something like:

ERROR: failed to register layer: Error processing tar file(exit status 1): write /edx/app/edxapp/venvs/edxapp/lib/python2.7/site-packages/twisted/words/protocols/jabber/client.pyc: no space left on device

Solution:

The docker VM is out of space. And you have dangling docker images. Do

docker image prune

Backing up docker data volumes

I've hit some troubles recently that have caused my docker data volumes to go bye-bye, which means I then lose an hour+ to re-provisioning my devstack.  So, here are some commands for making backups of data volumes:

docker run -it -v devstack_mysql_data:/volume -v /tmp:/backup ubuntu:xenial tar -czf /backup/devstack_mysql_data.tar.gz -C /volume ./
docker run -it -v devstack_mongo_data:/volume -v /tmp:/backup ubuntu:xenial tar -czf /backup/devstack_mongo_data.tar.gz -C /volume ./
docker run -it -v devstack_elasticsearch_data:/volume -v /tmp:/backup ubuntu:xenial tar -czf /backup/devstack_elasticsearch_data.tar.gz -C /volume ./

So those backups should now live under the /tmp directory on your host.  I recommend moving them somewhere more permanent (like ~/data/docker_volume_backups).  You should be able to restore these as follows:

docker run -it -v devstack_mysql_data:/volume -v /tmp:/backup ubuntu:xenial bash -c "rm -rf /volume/* ; tar -C /volume/ -xzf /backup/devstack_mysql_data.tar.gz"

Ideally, I would create a script to do the backups and then add it to a daily cron, rotating out old backups periodically.