fli-iam / shanoir-ng

Shanoir (SHAring iN vivO Imaging Resources)
GNU General Public License v3.0
21 stars 21 forks source link

Shanoir-NG - Import, manage and share neuroimaging data

Shanoir-NG (Next Generation) is a software that helps neuroimaging analysis researchers, radiologists, and MRI operators to organize and share neuroimaging datasets.

GitHub is a tool for developers if you are seeking information at a user level view please visit http://shanoir.org.

Shanoir-NG is a complete technological remake of the first version of the Shanoir application, maintaining the key concepts of Shanoir, enhancing the functionalities and the user interface and providing a great flexibility for further improvements.

Shanoir-NG is copyrighted by Inria and is now open source under the GNU General Public License v3.0. See the LICENCE file at the root of this project. If you want to contribute, please see the following page : Contribution Workflow.

:warning: Disclaimers :warning:

About Shanoir NG's architecture

Many thanks to all these giants, on their shoulders we are standing to develop Shanoir-NG !

Access to REST-API on using Swagger3/OpenAPI

You can easily connect and investigate the REST-interface of Shanoir-NG using Swagger3. Depending on your server domain just call (e.g. for Neurinfo server):

Intialize Shanoir Downloader

Clone the shanoir-ng repository, the shanoir-downloader/ folder will be empty ; two commands must be run to get the code:

Then the shanoir-downloader project can be simply managed as a normal git repo (as if it were a separated project) ; meaning that once your are in the shanoir-downloader/ folder, you can just git pull to get the latest changes, and commit some changes.

Windows User

Shanoir : https://shanoir-ng-nginx/shanoir-ng/home

Keycloak : http://localhost:8080/auth/admin/master/console/#/realms/shanoir-ng/roles

DEPLOY

If you want to login, please configure a user in Keycloak :

Please note, that the MS Users does for security reasons not publicly expose his REST-interface.

Requirements

To build and deploy Shanoir, you will need:

Installation of Shanoir NG

The installation of Shanoir NG happens in three steps :

The TL;DR section gives the minimal for bootstrapping a development environment. The following sections give detailed informations about each step.

TL;DR

The default docker-compose configuration is well-suited for a development environment. Each microservice is hosted in a separate container and the application data are stored in named volumes.

Before deploying, some configuration is required:

The bootstrap.sh script automates the build and the deployment of shanoir.

WARNING: this script is destructive (as it will wipe out the external volumes configured in the docker-compose.yml). It is not recommended to use on a production host.

To deploy shanoir from scratch on a development machine you can just launch the following command and have a coffee.

./bootstrap.sh --clean

Once the bootstrap is complete, go on to the FIRST RUN section to create the initial users.

BUILD

The build consists of two stages: build the microservices and build the docker images.

In the source tree, each microservice is located in a separate shanoir-ng-*/ directory containing a maven project. shanoir-ng-parent is a meta-project that includes all the other projects. The contextes of the docker images are located in the docker-compose/*/ directories.

Procedure:

CONFIGURE

Shanoir is configured with environment variables. It is mostly handled with a a set of facade variables named SHANOIR_* (which cover the most typical setups).

Name Value Description
SHANOIR_URL_HOST hostname hostname where shanoir is reachable
SHANOIR_URL_SCHEME http\|https https (over TLS), http (plain text, NOT RECOMMENDED)
SHANOIR_SMTP_HOST hostname SMTP relay for outgoing e-mails
SHANOIR_ADMIN_EMAIL e-mail address contact address of the administrator (for outgoing e-mails)
SHANOIR_ADMIN_NAME name name of the administrator (for outgoing e-mails)
SHANOIR_PREFIX slug (optional) prefix for container names (needed if you deploy multiple shanoir instances on the same host)
SHANOIR_X_FORWARDED generate\|trust configures whether the nginx container generates the X-Forwarded-* HTTP headers (if running stand-alone) or trusts the existing headers (if located behind another reverse-proxy)
SHANOIR_CERTIFICATE auto\|manual auto-generates a self-signed TLS certificate (NOT RECOMMENDED) or use a manually installed certificate
SHANOIR_MIGRATION auto\|init\|never\|manual\|export\|import Normal runs should use auto in development and never in production. Other values are for controlling deployment and migrations (see below).
SHANOIR_KEYCLOAK_USER
SHANOIR_KEYCLOAK_PASSWORD
username/password Keycloak admin account used by shanoir for managing user accounts
SHANOIR_VIEWER_OHIF_URL_SCHEME http\|https https (over TLS), http (plain text, NOT RECOMMENDED)
SHANOIR_VIEWER_OHIF_URL_HOST hostname hostname where the OHFI-Viewer is reachable

Notes

DEPLOY

  1. ensure all containers are stopped and all volumes are destroyed (CAUTION: this destroys all external volumes defined in docker-compose.yml)

    fig down -v
  2. deploy the database containers and wait until they are ready to accept incoming connections

    docker-compose up -d database keycloak-database
  3. initialise the keycloak container, then start it

    docker-compose run --rm -e SHANOIR_MIGRATION=init keycloak
    docker-compose up -d keycloak
  4. initialise each microservice

    for ms in users studies datasets import preclinical ; do
       docker-compose run --rm -e SHANOIR_MIGRATION=init "$ms"
    done
  5. start the remaining containers

    docker-compose up -d

FIRST RUN

New user accounts need to be validated by a shanoir admin. However, on the first run, there is not admin account so you will need to create it on the keycloak server directly:

  1. go to Keycloak admin interface: http://localhost:8080/auth/admin/
  2. sign in with the credentials configured in SHANOIR_KEYCLOAK_USER/SHANOIR_KEYCLOAK_PASSWORD' (default isadmin/&a1A&a1A`)
  3. go to the shanoir-ng realm
  4. create/edit the new user and grant the relevant role (eg. ROLE_ADMIN). By default, new user accounts are created in Keycloak by the users microservice with temporary passwords, you may reset the password in keycloak's admin interface and receive the new password is by e-mail. In development, if you do hot have a configured SMTP relay, then you may choose to overide the password manually and set Temporary password: No to make it persistent. Go to the "Attributes" tab of your User page and create a new attribute "userId" and set the value with a random number not taken by another user.

PACS dcm4chee

Access to the backup PACS dcm4chee 5 arc-light: http://localhost:8081/dcm4chee-arc/ui2/

Local data

This installation uses Docker named volumes, find more here to handle your local data: https://docs.docker.com/storage/volumes/

Migrations

TODO