You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

1. Table of contents

2. What are we going to do?

This section of documentation explains how to install server part components of Catalogue QT. I am discussing here:

  • MySQL installation,
  • Spring Boot installation (execution of Spring Boot based application),
  • Exposing RESTful Web Services.

Schema of components used by RESTful WS server

3. Starting RESTful based Web Services - Catalogue QT server

Catalogue QT Web Services are hosted using Spring-Boot framework. In order to start server you have to clone the repository with source code. Source code of all the components can be downloaded from the code repository (Catalog QT2).

> git clone https://YOUR_USER_NAME_AT_GATEWAY@gforge6.eufus.eu/git/catalog_qt_2

If you don't have access yet, make sure to request for the access.

3.1. Requirements

Catalogue QT ver. 2 requires following components to be installed on the machine where it will be started

Java         - openjdk 11.0.2 - you can use JDK from Oracle as well
Apache Maven - 3.6.3          - you can use Apache Maven distributed with project as well
mysql        - 8.0.20         - you can use MariaDB instead (we haven't tested it thoug)

3.2. Creating database

Catalog QT ver. 2 requires access to database that will store all the imported data. You have to create this database. Schema for creating database is located inside project structure: sql/schema/catalog_qt_db.sql.

To create DB schema inside mysql you will need root password for your MySQL installation. Then, you can run following:

# WARNING! This line will drop schema: itm_catalog_qt and create it from the scratch. Make sure you are not destroying things!

> mysql -u root -p < sql/schema/catalog_qt_db.sql

This script will create two users: itm_catalog_ro/itm_catalog_ro and user itm_catalog_rw/itm_catalog_rw with read-only and read-write privileges, respectively.

It's a good idea to check whether you can access your newly created database. Make sure you can successfully connect there.

> mysql -u itm_catalog_rw -p -h localhost itm_catalog_qt
Enter password:
...
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6318
Server version: 8.0.20 MySQL Community Server - GPL

...
...

mysql> show tables;
+----------------------------+
| Tables_in_itm_catalog_test |
+----------------------------+
| annotation                 |
| catalog_parameters         |
| entry                      |
| entry_data                 |
| experiment                 |
| outcome                    |
| reference                  |
| replace                    |
| request                    |
| tag                        |
| tag_entry                  |
| user                       |
| variable                   |
+----------------------------+
13 rows in set (0.00 sec)

mysql>

In case you have issues while accessing your MySQL installation, please consult your sys admin to resolve the issue.

3.3. Starting WS API server

In order to run Catalogue QT ver. 2 Web Services API server you have to start Spring-Boot application. Make sure to go inside directory: ws/catalog-ws and execute > mvn spring-boot:run

> cd ws/catalog-ws
> mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< pl.psnc.catalog:catalog-ws >---------------------
[INFO] Building catalog-ws 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
...
...
 .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.3.0.RELEASE)

2020-06-05 13:21:31.533  INFO 17919 --- [           main] p.p.c.catalogws.CatalogWsApplication     : Starting CatalogWsApplication on catalog.eufus.eu with PID 17919
...
...

3.4. Running tests

You can run unit tests by changing directory to: ws/catalog-ws and running.

> mvn test

Test code doesn't use MySQL server based database. It's safe to run tests even after database is already created. Tests will not touch your production database.

4. Starting Catalogue Update Process

Catalogue Update Process serves the purpose of reading data (MDSPlus pulse files, UDA, etc.) and populating Catalogue QT with the content of summary IDS. Catalogue Update Process is the only component that requires access to input data and to IMAS infrastructure. This is related to the fact that data are read from the structures created and maintained by IMAS based components.

4.1. Requirements

Catalogue QT Update Process requires following components to be installed on target machine:

Java - openjdk 11.0.2 - you can use JDK from Oracle as well
Apache Maven - 3.6.3 - you can use Apache Maven distributed with project as well

4.2. Starting Catalogue QT Update Process

4.2.1. Installation of Catalog QT CLI based client

I assume that you have already cloned the source code repository. In that case, all you have to do follows:

Java based bridge to IMAS

Note that Catalogue QT Update Process requires IMAS based components. You have to import IMAS based JAR file into your local Maven repository. It's not something that will make you suffer. All you have to do is to run one command, and you have to make sure you have imas.jar file.

> cd catalog_qt_2/client/catalog-ws-client

Make sure to import imas.jar into your local Maven repository. All you have to do is to run following command

> mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file  \
    -Dfile=${LOCATION_OF_YOUR_IMAS_JAR}/imas.jar \
    -DgroupId=imas -DartifactId=imas \
    -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar \
    -DlocalRepositoryPath=`pwd`/local-maven-repo

Once imas.jar is in place you can build and run Catalog QT CLI based client.

> mvn install -DskipTests
> java -jar ./target/catalogAPI.jar -help



  • No labels