Skip to content
Snippets Groups Projects
Commit 3e220cb9 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Adding documentation

parent d06a9345
No related branches found
No related tags found
No related merge requests found
The CoreManager is a server component that acts as a front end to the VIPSCore system.
The main tasks are authencication, authorization, scaling and logging of activities
in the VIPSCore system. All requests to VIPSCore are routed through VIPSCoreManager.
\ No newline at end of file
# VIPSCoreManager
The CoreManager is a server component that acts as a frontend to the VIPSCore system.
The main tasks of the manager are authencication, authorization, scaling and logging of activities in the VIPSCore system. All requests to VIPSCore are (or rather, may be) routed through VIPSCoreManager.
![How VIPSCore and VIPSCoreManager fits into the whole VIPS architecture](./docs/illustrations/VIPS_whole_architecture.png "All VIPS system parts")
Requests to and replies from VIPSCoreManager are identical to VIPSCore, except that you need to provide credentials as part of the request body.
## Build and deploy
### Database
So make sure you have PostgreSQL >= 10 installed. As the db superuser (`postgres` on Ubuntu), create a user/role `vipscoremanager`. Then, initialize the database as in the example below:
```sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.4 (Ubuntu 14.4-0ubuntu0.22.04.1)
-- Dumped by pg_dump version 14.4 (Ubuntu 14.4-0ubuntu0.22.04.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
DROP DATABASE vipscoremanager;
--
-- Name: vipscoremanager; Type: DATABASE; Schema: -; Owner: vipscoremanager
--
CREATE DATABASE vipscoremanager WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'en_US.UTF-8';
ALTER DATABASE vipscoremanager OWNER TO vipscoremanager;
```
### The code
You need Maven installed.
Clone and build the [VIPSCommon package](https://gitlab.nibio.no/VIPS/VIPSCommon)
Clone and build this project
Download and install [WildFly](https://www.wildfly.org/) >= 25.0.1
Add the db credentials to Wildfly's configuration file `[WILDFLY_HOME]/standalone/configuration/standalone.xml`, e.g. like this:
```xml
<profile>
<!-- [...] -->
<subsystem xmlns="urn:jboss:domain:datasources:6.0">
<datasource jta="true" jndi-name="java:jboss/datasources/vipscoremanager" pool-name="Postgres-vipscoremanager-pool" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:postgresql://localhost:5432/vipscoremanager</connection-url>
<driver>postgresql</driver>
<security>
<user-name>vipscoremanager</user-name>
<password>foobar</password>
</security>
</datasource>
<drivers>
<!-- [...] -->
<driver name="postgresql" module="org.postgresql">
<driver-class>org.postgresql.Driver</driver-class>
</driver>
</drivers>
</subsystem>
<!-- [...] -->
</profile>
```
Also, install the JDBC driver for PostgreSQL in `[WILDFLY_HOME]`/modules/ (See [Wildfly's class loading documentation](https://docs.wildfly.org/25/Developer_Guide.html#Class_Loading_in_WildFly))
Deploy the build from this project in Wildfly. Wildfly should run on Java >= 11.
### Configuration
These system properties must be set in the WildFly config file `[WILDFLY_HOME]/standalone/configuration/standalone.xml`:
```xml
<system-properties>
<property name="no.nibio.vips.coremanager.VIPSCORE_URL" value="http://localhost:8080/VIPSCore"/>
<property name="no.nibio.vips.coremanager.VIPSBATCH_ALLOWED_IPS" value="127.0.0.1"/>
<property name="no.nibio.vips.coremanager.MD5_SALT" value="FooBarFooBarFooBar"/>
<!-- [...] -->
</system-properties>
```
Explanation of the properties:
```properties
# Where to find the VIPSCore service
no.nibio.vips.coremanager.VIPSCORE_URL=http://localhost:8080/VIPSCore
# From which IP adresses we accept batch operation requests
no.nibio.vips.coremanager.VIPSBATCH_ALLOWED_IPS=127.0.0.1
# Password hash salt
no.nibio.vips.coremanager.MD5_SALT=FooBarFooBarFooBar
```
### Initialization
The code includes database migrations by Flyway, so the database structure will be created automatically on the first successfull deployment.
In order to use the service, you need to add at least one organization and at least one user. This is done by SQL directly in the database.
docs/illustrations/VIPS_whole_architecture.png

167 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment