Skip to content
Snippets Groups Projects
Commit ee2f6248 authored by Benjamin Ledel's avatar Benjamin Ledel
Browse files

* restructure first info

parent 0330d202
No related branches found
No related tags found
No related merge requests found
# Polaris Installation and deployment # Polaris Learning Infrastructure Setup
Die Polaris Learning Infrastructure ist eine moderne, skalierbare Plattform zur Unterstützung digitaler Lernumgebungen. Sie ermöglicht die nahtlose Integration verschiedener Lernressourcen, Benutzerverwaltung und Analysefunktionen für ein effektives Lernmanagement.
```mermaid ## Systemvoraussetzungen
graph TD; Bevor Sie mit der Installation der Polaris Learning Infrastructure beginnen, stellen Sie sicher, dass Ihr System die folgenden Anforderungen erfüllt:
subgraph Polaris
Z[Docker Build]
end
Z[Docker Build] --> A(Ingress);
Z[Docker Build] --> B(Ingress);
subgraph GitLab
B[Container Registry] --> H(Images);
end
subgraph Server
A[Docker Pull] --> D(Traefik);
D[Traefik] --> E(Deployment:Analytics-Engine);
D[Traefik] --> F(Deployment:Rights-Engine);
D[Traefik] --> I(Deployment:Dashboard-SDK);
E(Deployment:Analytics-Engine)---id1[(MongoDB)]
F(Deployment:Rights-Engine)---id1[(MongoDB)]
I(Deployment:Dashboard-SDK)---id1[(MongoDB)]
end
```
# Getting started
Each folder contains one of the components of
## Local Deployment ### Empfohlene Systemanforderungen:
- Betriebssystem: Linux (Debian 11+, Ubuntu 20.04+ empfohlen)
- Prozessor: Mindestens 4 CPU-Kerne (8 empfohlen für größere Installationen)
- Arbeitsspeicher: Mindestens 8 GB RAM (16 GB oder mehr für größere Benutzerzahlen empfohlen)
- Festplattenspeicher: Mindestens 50 GB freier Speicherplatz (je nach Datenvolumen erweiterbar)
- Netzwerk: Stabile Internetverbindung für Updates und Container-Downloads
### Login in the docker registry ### Softwarevoraussetzungen:
If you are not already logged in, you need to authenticate to the Container Registry by using your GitLab username and password. If you have Two-Factor Authentication enabled, use a Personal Access Token instead of a password. - Docker (mindestens Version 20.10)
```bash - Docker Compose (mindestens Version 1.29)
docker login registry.git.rwth-aachen.de - Git (für das Herunterladen der Konfigurationsdateien)
``` - cURL oder Wget (für das Abrufen externer Abhängigkeiten)
### Create Docker network
Different containers communicate via a Docker network `web`, which must be created before Docker compose files are executed.
```bash
docker network create web
```
### Create private/public keys and .env ## Installation von Docker und Docker Compose
Falls Docker noch nicht installiert ist, können Sie es auf Debian oder Ubuntu mit folgenden Befehlen einrichten:
Please change all passwords in the configuration file and leave the passphrase empty.
```bash ```bash
ssh-keygen -b 4096 -f id_rsa # Add Docker's official GPG key:
cp .env.sample .env sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
``` ```
### Start containers Installieren von Docker und Docker Compose:
```bash ```bash
docker compose up -d sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
``` ```
Please check whether all services started successfully. Überprüfen, ob Docker installiert ist:
```bash ```bash
docker compose ps docker --version
docker-compose --version
sudo docker run hello-world
``` ```
After that you should be able to visit http://localhost:8004/ and see the rights engine.
### Migrate rights-engine database (only required once after first start) ## Docker-Login in die Registry von RWTH Aachen
Falls Sie noch nicht eingeloggt sind, müssen Sie sich mit Ihrem GitLab-Benutzernamen und Passwort authentifizieren.
Falls Sie die Zwei-Faktor-Authentifizierung (2FA) aktiviert haben, benötigen Sie stattdessen ein Personal Access Token (PAT).
```bash ```bash
docker compose exec -it rights-engine sh -c 'python3 manage.py sqlflush | sed s/TRUNCATE/DROP\ TABLE\ IF\ EXISTS/g | python3 manage.py dbshell && echo DROP\ TABLE\ IF\ EXISTS\ django_migrations\; | python3 manage.py dbshell && python3 manage.py migrate && python3 manage.py loaddata fixtures/initial_db.json' echo "IHR-TOKEN" | docker login registry.git.rwth-aachen.de -u IHR-BENUTZERNAME --password-stdin
``` ```
### Migrate analytics-engine database (only required once after first start) Nach erfolgreicher Anmeldung erscheint die Meldung:
```bash ```bash
docker compose exec -it scheduler sh -c 'scheduler create-db' Login Succeeded
``` ```
### Adding analytics engine jobs
Analytics engines jobs are configured via yml files and read from the `configuration` directory, which is a volume.
Example configuration file `configuration/h5p_engines.yml` ### Create private/public keys and .env
```yml
h5p_statements_count_engine:
crontab: "*/1 * * * *"
repo: "https://git.rwth-aachen.de/polaris/public/engines/activities.git"
analytics_token: "b6a4ec069ef9f688e781161d46c2a85c14a761a4eaf0074099656c7de44a65d9"
```
Example configuration file `configuration/moodle_engines.yml` Please change all passwords in the configuration file and leave the passphrase empty.
```yml
moodle_statements_count_engine:
crontab: "*/1 * * * *"
repo: "https://git.rwth-aachen.de/polaris/public/engines/activities.git"
analytics_token: "0482a0f3259c966dfddb38de867573a95995ee5e10898bb71f9ae0e99efe54ef"
```
Update analytics engine scheduler
```bash ```bash
docker compose exec -it scheduler sh -c 'scheduler read-configs' ssh-keygen -b 4096 -f id_rsa
cp .env.sample .env
``` ```
### Create visualization token ### Start containers
```bash ```bash
curl -X POST http://localhost:8004/api/v1/provider/visualization-tokens/create --data '{"engines": ["count_h5p_statements", "count_moodle_statements"]}' -H "Content-Type: application/json" docker compose up -d
``` ```
Returns JWT Token for dashboard Please check whether all services started successfully.
``` ```bash
{"token":[JWT_TOKEN]"} docker compose ps
``` ```
### Loading JSON statements After that you should be able to visit http://localhost:8004/ and see the rights engine.
### Infrastructure overview
It is recommended to import a set of sample statements into the LRS so that the analytics engines can work on this data. Furhtermore, users (user1@polaris.com and user2@polaris.com) can test the data disclousure and data deletion process.
```console ```mermaid
$ docker compose exec -it mongodb_container sh -c 'mongoimport --authenticationDatabase admin --username root --password CHANGE_ME --db lrs --collection statements --drop --file ./lrs_statements_dump.json' graph TD;
subgraph Polaris
Z[Docker Build]
end
Z[Docker Build] --> A(Ingress);
Z[Docker Build] --> B(Ingress);
subgraph GitLab
B[Container Registry] --> H(Images);
end
subgraph Server
A[Docker Pull] --> D(Traefik);
D[Traefik] --> E(Deployment:Analytics-Engine);
D[Traefik] --> F(Deployment:Rights-Engine);
D[Traefik] --> I(Deployment:Dashboard-SDK);
E(Deployment:Analytics-Engine)---id1[(MongoDB)]
F(Deployment:Rights-Engine)---id1[(MongoDB)]
I(Deployment:Dashboard-SDK)---id1[(MongoDB)]
end
``` ```
### Start dashboard
1. Clone ![https://git.rwth-aachen.de/polaris/entwicklung/dashboard-example](Dashboad SDK example)
- `cd dashboard-example`
2. Download latest `@polaris/dashboard-sdk-X.X.X.tgz` from registry and `npm install @polaris/dashboard-sdk-1.0.2.tgz` it (TODO: improve with npm login)
2. Update `TOKEN` in `dashboard-example/src/js/app.js`
3. Run `npm run dev`
3. Visit http://localhost:8005/
### (Optional) Filling DB with random statements ## Update Polaris to a newer version
Falls Sie eine neuere Version von Polaris installieren möchten, folgen Sie diesen Schritten. Stellen Sie sicher, dass Sie sich im Verzeichnis befinden, in dem sich Ihre docker-compose.yml-Datei befindet.
1. Clone rights-engine
2. Create provider config
```bash ```bash
$ cd rights-engine/tools/xapi-statement-generator docker compose down
$ cp provider_config.json.example provider_config.json docker compose pull
```` docker compose up -d
3. Open `provider_config.json` and insert Application Tokens (visible at http://localhost:8004 (Rights Engine UI), if you login as a provider) ```
4. Run `python generator.py -t http://localhost:8003/xapi/statements -r`
Prüfen Sie, ob die neuen Container laufen:
## Update Docker Images
```bash ```bash
docker compose pull docker compose ps
``` ```
Falls Polaris nicht wie erwartet startet, können Sie die Logs anzeigen:
```bash
docker compose logs -f
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment