이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 6. Running and Configuring Realtime Decision Server for OpenShift
You can make changes to Realtime Decision Server for OpenShift configuration in the image using either the S2I templates, or by using a modified Realtime Decision Server for OpenShift.
6.1. Using Realtime Decision Server for OpenShift Source-to-Image (S2I) Process 링크 복사링크가 클립보드에 복사되었습니다!
The recommended method to run and configure Realtime Decision Server for OpenShift is to use the OpenShift S2I process together with the application template parameters and environment variables.
The S2I process for Realtime Decision Server for OpenShift works as follows:
If there is a pom.xml file in the source repository, a Maven build is triggered with the contents of
$MAVEN_ARGS
environment variable.-
By default, the
package
goal is used with theopenshift
profile, including the system properties for skipping tests (-DskipTests
) and enabling the Red Hat GA repository (-Dcom.redhat.xpaas.repo.redhatga
).
-
By default, the
The results of a successful Maven build are installed into the local Maven repository, /home/jboss/.m2/repository/, along with all dependencies for offline usage. Realtime Decision Server for OpenShift will load the created kjars from this local repository.
- In addition to kjars resulting from the Maven build, any kjars found in the deployments source directory will also be installed into the local Maven repository. Kjars do not end up in the EAP_HOME/standalone/deployments/ directory.
- Any JAR (that is not a kjar), WAR, and EAR in the deployments source repository directory will be copied to the EAP_HOME/standalone/deployments directory and subsequently deployed using the JBoss EAP deployment scanner.
All files in the configuration source repository directory are copied to EAP_HOME/standalone/configuration.
NoteIf you want to use a custom JBoss EAP configuration file, it should be named standalone-openshift.xml.
- All files in the modules source repository directory are copied to EAP_HOME/modules.
Refer to the Artifact Repository Mirrors section for additional guidance on how to instruct the S2I process to utilize the custom Maven artifacts repository mirror.
6.2. Binary Builds 링크 복사링크가 클립보드에 복사되었습니다!
To deploy existing applications on OpenShift, you can use the binary source capability.
Prerequisite:
Get the application archive or build the application locally.
The following example uses both the hellorules and hellorules-client quickstarts.
Clone the source code.
git clone https://github.com/jboss-openshift/openshift-quickstarts.git
$ git clone https://github.com/jboss-openshift/openshift-quickstarts.git
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the Red Hat JBoss Middleware Maven repository.
Build the application — both the hellorules and hellorules-client quickstarts.
NoteThe output of
mvn clean package
command below has been shortened to contain just selected information.cd openshift-quickstarts/decisionserver/
$ cd openshift-quickstarts/decisionserver/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Prepare the directory structure on the local file system.
Application archives in the deployments/ subdirectory of the main binary build directory are copied directly to the standard deployments folder of the image being built on OpenShift. For the application to deploy, the directory hierarchy containing the web application data must be correctly structured.
Create main directory for the binary build on the local file system and deployments/ subdirectory within it. Copy both the previously built JAR archive for the hellorules quickstart, and WAR archive for the hellorules-client quickstart to the deployments/ subdirectory:
decisionserver]$ ls hellorules hellorules-client pom.xml
decisionserver]$ ls hellorules hellorules-client pom.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow mkdir -p ocp/deployments
$ mkdir -p ocp/deployments
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cp hellorules/target/decisionserver-hellorules-1.4.0.Final.jar ocp/deployments/
$ cp hellorules/target/decisionserver-hellorules-1.4.0.Final.jar ocp/deployments/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cp hellorules-client/target/decisionserver-hellorules-client-1.4.0.Final.war ocp/deployments/
$ cp hellorules-client/target/decisionserver-hellorules-client-1.4.0.Final.war ocp/deployments/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteLocation of the standard deployments directory depends on the underlying base image, that was used to deploy the application. See the following table:
Expand Table 6.1. Standard Location of the Deployments Directory Name of the Underlying Base Image(s) Standard Location of the Deployments Directory EAP for OpenShift 6.4 and 7.0
$JBOSS_HOME/standalone/deployments
Java S2I for OpenShift
/deployments
JWS for OpenShift
$JWS_HOME/webapps
Perform the following steps to run application consisting of binary input on OpenShift:
Login into OpenShift instance.
oc login
$ oc login
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a new project.
oc new-project ds-bin-demo
$ oc new-project ds-bin-demo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow (Optional) Identify the image stream for the particular image.
oc get is -n openshift | grep ^jboss-decisionserver | cut -f1 -d ' '
$ oc get is -n openshift | grep ^jboss-decisionserver | cut -f1 -d ' ' jboss-decisionserver62-openshift jboss-decisionserver63-openshift
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteSince the images from jboss-decisionserver62-openshift image stream are obsolete, we will use jboss-decisionserver63-openshift below.
Create new binary build, specifying image stream and application name.
NoteYou can change the default user name and password to access the REST interface of the KIE server by providing custom values for KIE_SERVER_USER and KIE_SERVER_PASSWORD environment variables.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the binary build. Instruct
oc
executable to use main directory of the binary build we created in previous step as the directory containing binary input for the OpenShift build.NoteThe output of the next command has been shortened for brevity.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a new OpenShift application based on the build.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Expose the service as route.
oc get svc -o name
$ oc get svc -o name service/ds-hr-app
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc expose svc/ds-hr-app
$ oc expose svc/ds-hr-app route "ds-hr-app" exposed
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Access the application.
You can get the list of available query string arguments of the hellorules application by accessing the URL http://ds-hr-app-ds-bin-demo.openshift.example.com/hellorules/.
Run the hellorules-client servlet using the URL http://ds-hr-app-ds-bin-demo.openshift.example.com/hellorules?command=runLocal.
NoteYou may verify the current KIE server state by accessing dedicated server/ page of the REST API: http://ds-hr-app-ds-bin-demo.openshift.example.com/kie-server/services/rest/server/. Use aforementioned user name and password to access this page (or any REST API method of the server in general).
6.3. Using a Modified Decision Server xPaaS Image 링크 복사링크가 클립보드에 복사되었습니다!
An alternative method is to make changes to the image, and then use that modified image in OpenShift. The templates currently provided, along with the interfaces they support, are listed below:
Template Name | Supported Interfaces |
---|---|
decisionserver63-basic-s2i.json | http-rest, jms-hornetq |
decisionserver63-https-s2i.json | http-rest, https-rest, jms-hornetq |
decisionserver63-amq-s2i.json | http-rest, https-rest, jms-activemq |
You can run Realtime Decision Server for OpenShift in Docker, make the required configuration changes using the JBoss EAP Management CLI (EAP_HOME/bin/jboss-cli.sh) included in Realtime Decision Server for OpenShift, and then commit the changed container as a new image. You can then use that modified image in OpenShift.
It is recommended that you do not replace the OpenShift placeholders in the JBoss EAP xPaaS configuration file, as they are used to automatically configure services (such as messaging, datastores, HTTPS) during a container’s deployment. These configuration values are intended to be set using environment variables.
Ensure that you follow the guidelines for creating images.