The Connected Learning Analytics toolkit (new django architecture, superseeding https://github.com/kirstykitto/CLAtoolkit-oldPrototypes)
- Create/Assign all participants to groups (Working - Manually)
- CoI Interface: Messages to be classified by everyone - order messages received to be different order for every group
If you're running OSX or Windows installing Docker, Docker Compose, and Machine via Docker Toolbox is the easiest method.
Install Docker following the instructions here.
Along with Docker we will be using:
- Docker Compose for orchestrating a multi-container application into a single app, and
- Docker Machine for creating Docker hosts both locally and in the cloud.
Follow the directions here and here to install Docker Compose and Machine, respectively.
Test if docker-machine and docker-compose are installed:
λ docker-machine --version
docker-machine version 0.5.3, build 4d39a66
λ docker-compose --version
docker-compose version 1.5.2, build e5cf49d
Clone the project from the repository using git and enter the directory:
λ git clone https://github.com/kirstykitto/CLAtoolkit.git
λ cd CLAtoolkit
Create a virtual machine for our project to live in:
λ docker-machine create -d virtualbox dev;
Select the dev VM as the machine we want to run commands against:
Linux/OSX:
λ eval "$(docker-machine env dev)"
Windows:
If you're using cmd.exe replace 'powershell' with 'cmd'
λ docker-machine.exe env --shell powershell dev
$Env:DOCKER_TLS_VERIFY = "1"
$Env:DOCKER_HOST = "tcp://192.168.99.100:2376"
$Env:DOCKER_CERT_PATH = "C:\Users\n-\.docker\machine\machines\dev"
$Env:DOCKER_MACHINE_NAME = "dev"
# Run this command to configure your shell:
# E:\Program Files\Docker Toolbox\docker-machine.exe env --shell powershell dev | Invoke-Expression
Run the outputted command to configure your shell:
λ docker-machine env --shell powershell dev | Invoke-Expression
To get the containers started build the images and start the services:
λ docker-compose build
λ docker-compose up -d
This will take quite some time to complete the first time you run it. Subsequent builds will be far quicker as the results are cached from the first build.
Run Django database migrations:
λ docker-compose run -d clatoolkit_project python manage.py migrate
Grab the IP associated with the Docker Machine we created:
λ docker-machine ip dev
192.168.99.100
Navigate to the IP in your browser, which in my case is 192.168.99.100 and you should be greeted with the login page to the toolkit.
Along with Docker we will be using:
- Docker Compose for orchestrating a multi-container application into a single app
Follow the directions here to install Docker Compose.
Test if docker-compose is installed:
λ docker-compose --version
docker-compose version 1.5.2, build e5cf49d
Clone the project from the repository using git and enter the directory:
λ git clone https://github.com/kirstykitto/CLAtoolkit.git
λ cd CLAtoolkit
To get the containers started build the images and start the services:
λ docker-compose build
λ docker-compose -f production.yml up -d
This will take quite some time to complete the first time you run it. Subsequent builds will be far quicker as the results are cached from the first build.
Run Django database migrations:
λ docker-compose run -d clatoolkit_project python manage.py migrate
The server should now be running on port 80
List the running images:
λ docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------
clatoolkit_clatoolkit_project_1 /usr/local/bin/gunicorn cl ... Up 8000/tcp
clatoolkit_clatoolkit_project_run_1 python manage.py migrate Up 8000/tcp
clatoolkit_data_1 /docker-entrypoint.sh true Up 5432/tcp
clatoolkit_nginx_1 /usr/sbin/nginx Up 0.0.0.0:80->80/tcp
clatoolkit_postgres_1 /docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
Copy the seeded database into the postgres container:
λ docker cp cladevdbase.bak clatoolkit_postgres_1:/cladevdbase.bak
Enter a bash prompt in the postgres container:
λ docker exec -it clatoolkit_postgres_1 bash
Create the default admin account:
root@96245826afca:/# createuser -U postgres --interactive
Enter name of role to add: aneesha
Shall the new role be a superuser? (y/n) y
Restore the seeded database to the default postgres database (or whichever is being currently used):
psql -U postgres postgres < cladevdbase.bak
Use restart-containers.sh to have the server reflect changes made in the code (this should eventually be done using docker volumes instead):
λ ./script_name.sh
To see which environment variables are available to the clatoolkit_project service, run:
λ docker-compose run clatoolkit_project env
To view the logs:
λ docker-compose logs