...
Local docker-compose debugging
Infowarning |
---|
Things you must do BEFORE building the image: |
Catalog WS in docker-compose debugging
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
spring.datasource.url=jdbc:mysql://localhost:3306/itm_catalog_qt?serverTimezone=UTC spring.datasource.username=itm_catalog_rw spring.datasource.password=itm_catalog_rw spring.jpa.properties.hibernate.jdbc.time_zone=UTC server.error.include-message=always spring.jpa.show-sql=false spring.jpa.hibernate.ddl-auto=none # This is additional http handler, on another port # We need this one, in case we plan to use https server.port=8081 # We have to change ports on our local instance, because 8080 is taken by container server.http.port=8082 server.http.interface=0.0.0.0 keycloak.realm = ******** keycloak.auth-server-url= ******* keycloak.resource= ********* keycloak.realm-key= ******** keycloak.bearer-only = true keycloak.public-client=true keycloak.principal-attribute=preferred_username spring.mvc.dispatch-options-request=true # These need to be commented # If you plan to use HTTPS, make sure to uncomment this one #server.ssl.key-store=file:///home/imas/cert/keystore.p12 #server.ssl.key-store-password=catalogqt #server.ssl.keyStoreType=PKCS12 #server.ssl.keyAlias=tomcat swagger-ui.authorization.header=true |
Infowarning |
---|
Change both ports in lines, because 8080 and 8081 is already taken by running docker container. |
Infowarning |
---|
Lines 18 - 21 should be filled with proper data! |
and then run this command:
Code Block |
---|
docker run -i \ -p 8080:8080 \ -p 3306:3306 \ -v `pwd`/imasdb:/home/imas/public/imasdb \ --name catalogqt_debug_ide -t catalogqt |
...
Code Block |
---|
# You need IMAS environment with Open JDK 11
> module purge
> module load cineca
> module load imasenv
> module unload itm-java
> module load openjdk
# You have to clone source repository (you need to request access if you haven't done so)
# https://gforge6.eufus.eu/gf/project/catalog_qt_2/ - and "Request to join project"
> git clone https://gforge6.eufus.eu/git/catalog_qt_2
Cloning into 'catalog_qt_2'...
Username for 'https://gforge6.eufus.eu': YOUR_GW_USER_NAME
Password for 'https://g2michal@gforge6.eufus.eu': YOUR_GW_PASSWORD
> cd catalog_qt_2/client/catalog-ws-client/
> mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file \
-Dfile=${IMAS_PREFIX}/jar/imas.jar \
-DgroupId=imas -DartifactId=imas \
-Dversion=1.0.0-SNAPSHOT -Dpackaging=jar \
-DlocalRepositoryPath=`pwd`/local-maven-repo
> mvn install -DskipTests
# You are ready to run Update Process
> java -jar ./target/catalogAPI.jar -startUpdateProcess --url http://catalog:8080
[main] INFO pl.psnc.catalog.client.cli.commands.StartUpdateProcess - Getting list of requests for processing from Catalog.
...
... |
Anatomy of application.properties file
Spring based Web Services are run inside Tomcat server. Configuration of services can be done using application.properties
file.
Code Block |
---|
# location of database - typically, it will point at localhost, but
# it's also possible to change location of MySQL server.
# Docker based installation (docker-compose) will change it to db:3306
# In case of docker-compose based installation, MySQL is visible as another host
# Note that you don't have to change anything
spring.datasource.url=jdbc:mysql://localhost:3306/itm_catalog_qt?serverTimezone=UTC
# Default user name and password for database connection. Note that this connection
# will not work (by default) for external hosts. This is why we don't quite care about
# user/pass - however, you can alter these and make sure they don't contain default values
spring.datasource.username=itm_catalog_rw
spring.datasource.password=itm_catalog_rw
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
# In case of errors we want to embed error message as well (so we better know what went wrong)
server.error.include-message=always
# We definitely don't want to log SQL queries. However, if you want to see them, feel free
# to enable this
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=none
# This is additional http handler, on another port
# We need this one, in case we plan to use https
server.port=8080
server.http.port=8081
server.http.interface=0.0.0.0
keycloak.realm = fair4fusion-docker-demo
keycloak.auth-server-url=https://sso.apps.paas-dev.psnc.pl/
keycloak.resource= catalogqt-cli
keycloak.realm-key= MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjOCDGJsBi7rxVjf0RQb8pm0LAGsEKFcH7g7mKSqpFvp1uOypUeiYe5dwlwkXAXaYeYs0J70LB8E6mtVUcykbmp+XrqD1nn3yfPxlVLSg7iCvJqMUq8udsUbsyT3M/32/kssXurgY7rX5JhdtkYeAgq+9ifIjLQZhALg+FvEsX9C+D30WQDAChEljlReb+Y4UTz2aIqz9C+90bqG1ZIX4o3Dli1PZDosTNM444CwDTbrFrenctOTDtGPodo9k2jze8McZFAIrdUYi9mKD8v0frs8NUUW/TQj9h62swXdvVAfzYTd+R7aMRG0eXMV3rJc38DfsCsF7bkqSg0b4l8GcaQIDAQAB
keycloak.bearer-only = true
keycloak.public-client=true
keycloak.principal-attribute=preferred_username
spring.mvc.dispatch-options-request=true
# If you plan to use HTTPS, make sure to uncomment this one
#server.ssl.key-store=file:///home/imas/cert/keystore.p12
#server.ssl.key-store-password=catalogqt
#server.ssl.keyStoreType=PKCS12
#server.ssl.keyAlias=tomcat
swagger-ui.authorization.header=true |