Skip to content

Latest commit

 

History

History
113 lines (91 loc) · 7.83 KB

File metadata and controls

113 lines (91 loc) · 7.83 KB

Build Status codecov Quality Gate Status

Fuse (on Spring Boot) to create a prototype to integrate JPA (with external DB), JMA (AMQ Broker), Drools (remote invocation), Rest APIs, Swagger.

Installation

OKD

  1. install OKD 3.11 following these instructions
  2. oc cluster up
  3. oc login -u system:admin
  4. oc project openshift

Red Hat Registry Service Account

  1. Set up and download an Openshift registry service account following the instructions from https://access.redhat.com/RegistryAuthentication#registry-service-accounts-for-shared-environments-4
  2. oc create -f <secret>.yaml (<secret> is the name of the downloaded Openshift registry service account)
  3. oc secrets link default <secret> --for=pull
  4. oc secrets link builder <secret> --for=pull

Red Hat Decision Manager

Instructions from https://access.redhat.com/documentation/en-us/red_hat_decision_manager/7.3/html-single/deploying_a_red_hat_decision_manager_authoring_or_managed_server_environment_on_red_hat_openshift_container_platform/index#dm-openshift-prepare-con

  1. Download from https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?downloadType=distributions&product=rhdm&productChanged=yes and unzip
  2. oc create -f ./Downloads/rhdm-7.3-openshift-templates/rhdm73-image-streams.yaml
  3. oc import-image rhdm73-decisioncentral-openshift:1.0
  4. oc import-image rhdm73-kieserver-openshift:1.0

Red Hat AMQ Broker

Instructions from https://access.redhat.com/documentation/en-us/red_hat_amq/7.3/html-single/deploying_amq_broker_on_openshift_container_platform/index#installing-broker-ocp_broker-ocp

  1. oc replace --force -f https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/73-7.3.0.GA/amq-broker-7-image-streams.yaml
  2. oc import-image amq-broker-7/amq-broker-73-openshift --from=registry.redhat.io/amq-broker-7/amq-broker-73-openshift --confirm
  3. for template in amq-broker-73-basic.yaml amq-broker-73-ssl.yaml amq-broker-73-custom.yaml amq-broker-73-persistence.yaml amq-broker-73-persistence-ssl.yaml amq-broker-73-persistence-clustered.yaml amq-broker-73-persistence-clustered-ssl.yaml; do oc replace --force -f https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/73-7.3.0.GA/templates/${template}; done

Red Hat Fuse

Instructions from https://access.redhat.com/documentation/en-us/red_hat_fuse/7.3/html-single/fuse_on_openshift_guide/index#get-started-admin-install

  1. BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.fuse-730065-redhat-00002
  2. oc create -n openshift -f ${BASEURL}/fis-image-streams.json
  3. for template in eap-camel-amq-template.json eap-camel-cdi-template.json eap-camel-cxf-jaxrs-template.json eap-camel-cxf-jaxws-template.json eap-camel-jpa-template.json karaf-camel-amq-template.json karaf-camel-log-template.json karaf-camel-rest-sql-template.json karaf-cxf-rest-template.json spring-boot-camel-amq-template.json spring-boot-camel-config-template.json spring-boot-camel-drools-template.json spring-boot-camel-infinispan-template.json spring-boot-camel-rest-sql-template.json spring-boot-camel-teiid-template.json spring-boot-camel-template.json spring-boot-camel-xa-template.json spring-boot-camel-xml-template.json spring-boot-cxf-jaxrs-template.json spring-boot-cxf-jaxws-template.json ; do oc create -n openshift -f https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.fuse-730065-redhat-00002/quickstarts/${template}; done

Deployment

OCP templates

Using OCP Web UI

  1. click on Create Project button to create a new project
  2. use migration-analytics as value for the name
  3. once the project has been created and added to the list of the available project, click on migration-analytics
  4. from the migration-analytics Overview page, click on Import YAML / JSON button
  5. copy and paste the content of the analytics_template.json (using the Raw button will let you have the plain text version of this file)
  6. click on Create button
  7. check that Process the template is selected (no need to select Save template)
  8. click on Continue button
  9. click on Create button (No need to change the form values unless the user wants to customize them)

Using oc command line tool

  1. oc login -u developer
  2. oc new-project migration-analytics
  3. oc create -f <secret>.yaml
  4. oc secrets link default <secret> --for=pull
  5. oc secrets link builder <secret> --for=pull
  6. oc process -f https://raw.githubusercontent.com/project-xavier/xavier-integration/master/src/main/resources/okd/analytics_template.json| oc create -f -

Decision Manager

  1. go to Application -> Routes page and click on the URL in the Hostname column beside the myapp-rhdmcentr service
  2. login with adminUser-SxNhwF2!
  3. click on Design link
  4. click on Import Project button
  5. in the Repository URL field paste https://github.com/project-xavier/xavier-analytics.git
  6. select sample-analytics box and click the OK button on the upper right side
  7. once the import has finished, click the Build & Install button from the upper right Build menu
  8. once the build has been successfully done, click on the Deploy button

Development

How to deploy local code to local OKD instance

  1. build an image with your local code

    mvn -gs ./configuration/settings.xml clean package fabric8:build -DskipTests

  2. check the image xavier/xavier-integration:latest has been created running

    docker image ls xavier/xavier-integration:latest

    (pay attention to the CREATED column value)

  3. you have to change the tag for this image in order to be able to push it to your local environment

    docker tag xavier/xavier-integration:latest 172.30.1.1:5000/ma/analytics-integration:latest

  4. the first time you push the image, you need to login to OKD's repository, so execute the command

    docker login -p <token> 172.30.1.1:5000

    where value is the one you can get from the OKD UI using the "Copy Login Command" from the user menu

  5. now you're ready to push your image to your local OKD instance

    docker push 172.30.1.1:5000/ma/analytics-integration:latest

  6. once the push finishes, the deployment of a new integration pod to run the new image will start automatically in your OKD instance

Manage

PostgreSQL

  1. Go to Resources -> Secrets page and select postgresql secret for the list of the secrets
  2. Select Reveal Secret link to get the database-name value
  3. Go to PostgreSQL pod's Terminal tab to log in doing psql <database-name>
  4. To get the report entries persisted execute select * from report_data_model;
  5. To DELETE ALL the report entries execute truncate table report_data_model;

AMQ Broker

AMQ Web Console

Camel routes

To enable the DEBUG level for logging, please add the environment variable logging.level.org (or whatever package you want) with value DEBUG to the the analytics-integration deployment configuration.

Undeploy

  1. oc delete all,pvc,secrets -l application=migration-analytics -n migration-analytics

Sonar

  1. https://sonarcloud.io/dashboard?id=project-xavier_xavier-integration
  2. mvn clean verify -Psonar -Dsonar.login={{token generated for the user on SonarCloud}}

References