Install / Update

This page will guide you through the installation and update of your own instance of the Dojo.

Recommendations

  • Remember to check the compatibility and requirements updates if you do an update.
  • The Dojo backend needs a config file (.env). Remember to back it up before updating.
  • For better security, we recommend to use a reverse proxy with SSL/TLS that will redirect the requests to the backend container.

Backend

Gitlab configuration (only need at the first installation)

Gitlab Application

The Dojo use the Gitlab API to authenticate users and get their information. To do so, you need to create a Gitlab application in the Dojo base group. Here is the configuration information:

  • Name: The Dojo CLI
  • Redirect URI: http://localhost:30992/login
  • Confidential: No
  • Scopes:
    • api
    • create_runner
    • read_repository
    • write_repository

Once the application is created, you will get a Client ID and a Client Secret. Save them for later usage.

Gitlab Token

You need a token to interact with the Gitlab API. To do so, you need to create a token in the gitlab account with the api scope. Save it for later usage.

WARNING: This token has an expiration date. You need to renew it before it expires and update the backend with the new one.

Install

To install the backend, you need to clone the repository and run the Docker Compose file. Here are the steps to follow:

  1. Clone the repository:
    git clone --recurse-submodule https://gitedu.hesge.ch/dojo_project/projects/backend/dojobackend
    cd dojobackend
    
  2. Copy the .env.example file to .env and fill it with the necessary informations:
    cp .env.example .env
    nano .env
    
  3. Run the Docker Compose file:
    ./infra --run
    

Update

Pull (with recurse submodules) the new version of the backend and restart containers with the same command from the installation.

The Dojo access management

To modify access right of a Dojo user, you have to do it manually in the database (you can access to a adminer interface at the URL: <BACKEND_URL>/dojo/adminer/ or do it via mysql command on the server):

  1. The user must log in at least once to the Dojo platform to be created in the database.
  2. You have to find the user ID. For it, you can ask for his Gitlab ID or search it in the User table.
  3. Here is the SQL command to change the access right of a user:
    UPDATE `User` SET
    `role` = <ROLE_ID>
    WHERE `id` = '<USER_ID>';
    
    Here are the roles id list:
    • 1: Student
    • 2: Teacher
    • 3: Admin

Pipelines images generation (Docker Hub)

AssignmentChecker / ExerciseChecker

The two checkers have similar steps to generate the images. Here are the steps to follow:

  1. Clone the repository:
    • AssignmentChecker:
      git clone --recurse-submodule https://gitedu.hesge.ch/dojo_project/projects/pipelines/dojoassignmentchecker
      cd dojoassignmentchecker
      
    • ExerciseChecker:
      git clone --recurse-submodule https://gitedu.hesge.ch/dojo_project/projects/pipelines/dojoexercisechecker
      cd dojoexercisechecker
      
  2. Run the build and publish script. There is two options:
  • Interactive: Run the script with no values and follow the instructions:
    ./deploy_on_dockerhub.sh
    
  • Inline command: Run the script with the values (all forgotten value will be asked during the process):
    ./deploy_on_dockerhub.sh --dockerhub-user <DOCKERHUB_USER> --dockerhub-password <DOCKERHUB_PASSWORD> 
    --dockerhub-repo <DOCKERHUB_REPO> --backend-url <BACKEND_URL>
    

Update

Pull (with recurse submodules) the new version of the checkers and redo the build step.

DojoClI

As said in the introduction, the Dojo CLI doesn't need any adaptation because the user has to choose the instance to interact with or to specify the backend URL on the first launch of the CLI.

This can be changed with the command dojo settings api or by editing the state_v1.json5 file in the .DojoCLI directory in the user's home directory (for Linux users).

Add your instance in the preconfigured list of the CLI

If you want to add your instance in the preconfigured list of the CLI, you can do it by contacting The Dojo team (see on the help page).