Commit 0565d399 authored by Maarten de Waard's avatar Maarten de Waard 🤘🏻
Browse files

Merge branch 'master' of code.greenhost.net:maarten/setting-up-edx

parents b6a360c4 b5e7775f
The MIT License (MIT)
Copyright (c) 2017 Maarten de Waard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Docker -- Creating a working docker setup for Open EdX
======================================================
Installation and preparing
--------------------------
Install ``docker`` and ``docker-compose`` according to the instructions on the
internet (docs.docker.com). You're going to need to download a binary blob from
githubu for docker-compose :(
We'll need the ansible playbooks and docker setup files for edx, these are
accessed by cloning the edx configuration repo: ``git clone
git@github.com:edx/configuration``. You can do this anywhere you want, but I
decided to do it from ``/var/tmp``, because that's what most edx playbooks do.
In the rest of this document, I'll assume the directory name ``configuration``
for the folder containing the configuration repo.
Starting docker
---------------
We'll be using ``docker-compose`` to setup and link all EdX's separate dockers.
cd to ``configuration/docker/compose/edx``, and you'll find a
``docker-compose.yml`` file there. This is the file that contains all the docker
containers that EdX is going to use.
Run ``docker-compose up`` to start everything. Now normally, when you a have
well working docker setup, this would set everything up and you'll be done after
this step. This, however is not the case, because you will see a couple of
erros.
Forum
+++++
Jun already submitted a pull request for this, but the first thing we see, is
that the _forum_ container has the wrong name. It tries to include edxops/forum,
but if you change the image-name in the ``docker-compose.yml`` file to
edxops/forums it will work.
Missing containers
++++++++++++++++++
The next problem you'll encounter is that the containers _nginx_ and _xqueue_ are
missing from the public registry/docker hub. You can build these containers from
the ``configuration`` directory, by running ``make docker.build.$container``.
run ``make help`` for more information.
For _nginx_, for example, one should run ``make docker.build.nginx``. After
running this, because the docker images are not made completely according to
standards, we still need to tag the new container. Check the output of make, and
run ``docker tag <container hash> edxops/nginx:v1`` to tag it. To find the
correct tag, you should take a look at the lines for the nginx container in the
``docker-compose.yml`` file.
Broken xqueue
+++++++++++++
Now, when running ``docker-compose up`` again, _xqueue_ seems to be restarting
constantly. To investigate the issue, we are going to try to read the logs.
Rerun docker-compose, but add the ``-d`` flag so you daemonise the process and
can take a look in the container: ``docker-compose up -d``. Open a terminal in
the container by running the following command:
.. code::bash
docker exec -it xqueue bash
The argument ``-i`` is for interactive, ``-t`` is for tty. Now, you can find and
read the xqueue log. The logs are located in the ``/edx/var/log`` directory.
There's an xqueue directory there, but it's probably empty. Take a look at the
xqueue files in the supervisor directory:
``tail -f /edx/var/log/supervisor/xqueue*``
Now you'll be able to see the problem: the connection with the db container is
failing. By taking a look at the xqueue ansible role variables, you can find
out that the username and password configured in the db container are wrong.
There's also not a 'link' to the db container in the description of xqueue.
Re-install the xqueue after making your config look like this. For db:
.. code::
db:
container_name: db
image: mysql:5.6
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=xqueue
- MYSQL_USER=xqueue001
- MYSQL_PASSWORD=password
volumes:
- ${DOCKER_DATA_ROOT}/mysql/data:/var/lib/mysql
ports:
- 3306:3306
And for xqueue:
.. code::
xqueue:
container_name: xqueue
image: edxops/xqueue:v1
ports:
- 8040:8040
- 18040:18040
volumes:
- ${DOCKER_EDX_ROOT}/xqueue:/edx/app/edxapp/xqueue
links:
- db:db.xqueue
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment