Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Warning
titleCatalogQT version

Since now, I am referring to sources inside: https://gforge6.eufus.eu/svngf/project/catalog_qt/branches/R2-newLL (branch develop)


Info

In following section I assume that

Code Block
$HOST_NAME            - points to location of MySQL/MariaDB server
user_with_root_access - is a name of MySQL's user name with root privileges
$UAL_USER             - is the name of the user who has access to itm_scheduler_db
                        (this user is create using create_scheduler_db.sql script)

I am using -p option while calling mysql - it means that you will be asked for password each time you want to log in to MySQL machine. Thus, it is not possible to use following samples in batch mode.

...

Code Block
> cd docs/dbschema

# this script will produce SQL script for creating machine
# dependent databases

> ./create_db.sh --db-user=# NOTE!
#
# - ual_user_001 \
   - is an arbitrary choice, you use different user name
# - jettc   --db-name=jettc \
       - is an arbitrary choice for the catalog database,  --host-name=$HOST_NAME \
                 --schema-name=itm_catalogyou use different name
# - itm_catalog_001 - is an arbitrary choice, you can decide for a different schema name

> ./create_db.sh --db-user=ual_user_001 \
                 --wsdb-address=https://address.of.itmcatalog.installation/itmcatalog/apiname=jettc \
                 --host-name=$HOST_NAME \
                 --storage=/this/is/the/location/where/all/users/can/write/to

> mysql -h $HOST_NAME -u user_with_root_access -p < drop_db_user_modified.sql
> mysql -h $HOST_NAME -u user_with_root_access -p < create_db_modified.sql

# Once database is created, make sure you can log inschema-name=itm_catalog_001 \
                 --ws-address=https://address.of.itmcatalog.installation/itmcatalog/api \
                 --storage=/this/is/the/location/where/all/users/can/write/to

> mysql -h $HOST_NAME -u ualuser_with_userroot_001access -p itm_catalog_001
Enter password: 
...
...
mysql> show tables;
+---< drop_db_user_modified.sql
> mysql -h $HOST_NAME -u user_with_root_access -p < create_db_modified.sql

# Once database is created, make sure you can log in

> mysql -h $HOST_NAME -u ual_user_001 -p itm_catalog_001
Enter password: 
...
...
mysql> show tables;
+---------------------------+
| Tables_in_itm_catalog_001 |
+---------------------------+
| annotations               |
| catalog_parameters        |
| entry                     |
| entry_data                |
| intervals                 |
| machines                  |
| outcome                   |
| scheduler                 |
| users                     |
| variables                 |
+---------------------------+
10 rows in set (0.00 sec)

...

Make sure to change directory to branches/R2-newLL.to develop (git checkout develop)

Code Block
# Make sure to load IMAS environment - following command may be system dependent
> module load imasenv
> imasdb test
 
# For bash
 
> export CATALOG_QT_HOME=`pwd`
> export CATALOG_QT_STORAGE=/this/is/the/location/where/all/users/can/write/to
> export CATALOG_QT_DB_PROPERTIES=${CATALOG_QT_HOME}/dbAPI
 
# For tcsh
> setenv CATALOG_QT_HOME `pwd`
> setenv CATALOG_QT_STORAGE /this/is/the/location/where/all/users/can/write/to
> setenv CATALOG_QT_DB_PROPERTIES ${CATALOG_QT_HOME}/dbAPI
 
# settingSet targetyour machine
# name
# unfortunately,Note therethat areyou fewneed placesto wherechange machinegateway dependentto locationssomething are usedelse
#  atit thedepends moment,on twoyour optionstarget aredeployment available:machine
#
#> setenv MACHINE gatewayyour_machine_name

# Make setenvsure MACHINE jet
#
# it might be, we need yet another one, with new machine settings
 
# make sure to create and properly configure gSOAP module
# this way, you will be able to use pkg-config, etc.
> module load gsoap/2.8
> make

Installation of UI - web client

Make sure you can access repository: https://gforge6.eufus.eu/svn/catalog_qt

Code Block
> svn co https://gforge6.eufus.eu/svn/catalog_qt

The tool requires the following components to work:

  • MySQL database management system
  • Apache HTTP Server
  • PHP server-side scripting language

Installation of server tools

The administrator should install the following packages on the server:

  • mysql-server or mariadb-server
  • php
  • libapache2-mod-php
  • apache2

Installation of web client

UI codes are available as a sub-project in the src directory

to have your gsoap module loaded
# Note that name of the module may differ and depends
# on your local configuration

> module load gsoap/2.8.debug
 
# You have to update three files, before you proceed any further
# (see below) 

Updating Makefile.common

Make sure to update Makefile.common such way there is an entry for your machine. Note that machine name is an arbitrary choice. Simply, make sure not to pick one that already exists. Please make sure to add your own entry without altering the others.

  1. You need an entry similar to this one
    ifeq ($(MACHINE),your_machine_name) # <- make sure to use the very same name as the name exported inside MACHINE variable
    WSDL_URL := https://address.of.itmcatalog.installation/itmcatalog/api/server.php?wsdl # <- you need these two entries
    WS_URL := https://address.of.itmcatalog.installation/itmcatalog/api/server.php
    else ifeq ($(MACHINE),gateway)
    ...
    ...

Updating dbAPI/database.properties 

Make sure to update dbAPI/database.properties - you will probably need to change first three lines only. Unless you have decided to change the name of the database where all the scheduled jobs are stored.

Code Block

#Properties for gateway database
SERVER=enter_your_host_name
USER=enter_sheduler_database_user_name
PASSWORD=enter_sheduler_database_user_password
SIMULDATABASE=itm_scheduler_db
CODEDATABASE=itm_code_catalog

Updating src/config.json 

Make sure to update src/config.json file. You have to make sure to put there all the info that will be used by PHP based WebServices.

Code Block
{
    "wsdl":"https://address.of.itmcatalog.installation/itmcatalog/api/server.php?wsdl",
    "ns":"https://address.of.itmcatalog.installation/itmcatalog/api",

    "db_server":"enter_your_host_name",
    "db_type":"mysql",
    "db_user":"enter_sheduler_database_user_name",
    "db_password":"enter_sheduler_database_user_password",
    "db_db":"itm_scheduler_db"
}

Building release of CatalogQT

Once all the pieces are in place, you can compile the code

Code Block
# make sure to create and properly configure gSOAP module
# this way, you will be able to use pkg-config, etc.

> make install

# Once compilation is finished, you can find all the compiled 
# codes inside directory "release"
> tree release
release
|-- bin
|   |-- catalogscheduler            - application that is used for scheduling requests;
|   |-- catalogUpdateProcess        - update process - this one should be run on service node
|   |                                 it periodically checks whether there are data for import
|   |                                 and in case data are there, it imports data into simulation db
|   |-- store_data.sh               - helper script for storing single pulse file
|   `-- store_machine.sh            - helper script for storing whole machine
|-- conf
|   `-- dbAPI
|       `-- database.properties     - database connection settings
|-- resources
|   `-- lib
|       `-- libcatalogWS.a         
`-- template
    |-- derivation.xml              - template files for derivation file (deprecated - it's no longer used during data 
    |                                 storage but is required inside parts of legacy code base)
    `-- input_template.xml          - input description (automatically filled with proper information by store_data.sh script)


Installation of UI - web client

Make sure you can access repository: https://gforge6.eufus.eu/svn/catalog_qt

Code Block
> git clone https://your_gateway_user_name@gforge6.eufus.eu/git/catalog_qt

The tool requires the following components to work:

  • MySQL database management system
  • Apache HTTP Server
  • PHP server-side scripting language

Installation of server tools

The administrator should install the following packages on the server:

  • mysql-server or mariadb-server
  • php
  • libapache2-mod-php
  • apache2

Installation of web client

UI codes are available as a sub-project in the src directory

Code Block
src
|-- api_1_0			- API routines
|-- client			- nusoap wrappers
|-- config.php		- main configuration file
|-- inc				- auxiliary scripts
|-- nusoap			- nusoap library
|-- test.php		- nusoap testing script
`-- ui2				- main UI scripts and 
Code Block
src
|-- api_1_0			- API routines
|-- client			- nusoap wrappers
|-- config.php		- main configuration file
|-- inc				- auxiliary scripts
|-- nusoap			- nusoap library
|-- test.php		- nusoap testing script
`-- ui2				- main UI scripts and web page

To install the UI, copy the src folder to the apache directory (usually it is  /var/www/html/, but it depends on the version and type of operating system)
It is best to add an alias in the httpd.conf file to access the page after a short link without entering the entire address.

After all, restart the apache server:

Code Block
> service apache2 restart

Configuration of UI

the fastest way:

...

the version and type of operating system)
It is best to add an alias in the httpd.conf file to access the page after a short link without entering the entire address.

After all, restart the apache server:

Code Block
> service apache2 restart

Configuration of UI

To have access to databases, you must modify the config.json file:

Code Block
{
    "wsdl":"http://portal.eufus.eu/itm/catalog_qt-dev/api_1_0_db/server.php?wsdl",
    "ns":"http://portal.eufus.eu

...

Code Block
./src/ui2/config.php
./src/config.php

You can configure access to the mysql database in a ./src/ui2/config.php file (The data should match those given in the section Creating db schema and Installation of MySQL/MariaDB).

Also configuration of API databases access should be similarly adapted:

Code Block
./src/config_scheduler_db.php/itm/catalog_qt-dev/api_1_0_db",

    "db_server":"mysql server or hostname",
    "db_type":"mysql or other type",
    "db_user":"mysql user",
    "db_password":"password for user",
    "db_db":"itm_scheduler_db"
}


After all, restart the apache server:

...