Skip to content

jakobschroeber/bachelor_thesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assessment MS

Assessment MS is a Docker-based assessment microservice for Moodle Learning Management Systems. The installation comes with an instance of bitnami Moodle and an instance of Cassandra, but allows for configuration of instances of these databases. It assumes though a Moodle LMS version 3.x is running mySQL 5.x and a Cassandra version 2.x.

Installation

  1. Open a new terminal window, and change to the location where you want the installation directory to be
cd Drive:/my/location
  1. Clone GitHub repository into that location
git clone https://github.com/jakobschroeber/bachelor_thesis.git
  1. Open a new terminal window, change to the installation folder "Drive:/my/location/bachelor_thesis" and start building images and run docker-compose setup
docker-compose up -d
  1. Wait for Moodle instance to become available at http://localhost:10080 (this may take up to 30 minutes the first time you run the docker-compose setup because Moodle installation takes some time)

  2. Use the default MOODLE_USERNAME 'user' and default MOODLE_PASSWORD 'bitnami' to populate the Moodle instance with courses and users (for example, by creating a backup file of a course in the Mount Orange school demo and restoring it inside your Moodle instance.

  3. Create migration files (databases are initially empty)

docker exec assessment_ms sh -c "python manage.py makemigrations"
  1. Apply migrations to the application database (SQLite)
docker exec assessment_ms sh -c "python manage.py migrate"
  1. Apply migrations to the export database (Cassandra)
docker exec assessment_ms sh -c "python manage.py sync_cassandra"
  1. Check whether courses and their users are availbale at http://localhost:8000/administration/courses/ (reload the page if you can see the page, but not your courses)

  2. Populate the application database with some initial indicators, constructs and schedules

docker exec assessment_ms sh -c "python manage.py loaddata initial_data.json"
  1. Open a new terminal window, change to the installation folder "Drive:/my/location/bachelor_thesis" and start celery worker in order to carry out periodic assessments and exports
docker exec assessment_ms sh -c "celery -A app worker -l info --concurrency=1"
  1. Open a new terminal window, change to the installation folder "Drive:/my/location/bachelor_thesis" and start celery-beat in order to provide celery with task messages
docker exec assessment_ms sh -c "celery -A app beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
  1. Check at http://localhost:8000/assessment/indicators (Click on "Show results from database") whether assessment results are written to the application database (this is a setting of each indictor)

  2. Connect to Cassandra at port 9042 to check whether assessment results are exported as expected (this is supposed to happen every ten minutes)

  3. Check at http://localhost:8000/assessment/indicators (Click on "Show results from database") whether the already exported assessment results are deleted from the application database (this is supposed to happen once per hour)

  4. The settings of when assessment results are exported and when already exported assessment results are deleted can be changed at http://localhost:8000/admin ("Periodic tasks"), in order to access it you need to create a Django admin account

docker exec -it assessment_ms python manage.py createsuperuser

Cleaning up

       Stop docker-compose setup from running

docker-compose down

       Stop all running containers (if there is a problem)

docker ps -qa | xargs docker stop

       Clean up all built images, networks, caches, etc.

docker system prune -a

       Stop all running instances of celery worker

docker exec assessment_ms sh -c "celery -A app control shutdown"

       Stop celery-beat from sending task messages

docker exec assessment_ms sh -c "kill $(cat celerybeat.pid)"

       Remove all celery tasks from task queue

docker exec -it assessment_ms sh -c "celery -A app purge"

About

Docker-based assessment microservice for Moodle LMS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published