이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 18. Migration of a PMML service to a Red Hat build of Kogito microservice
You can migrate PMML-based services to Red Hat build of Kogito microservices by moving the PMML resources from KJAR artifacts to the respective Red Hat build of Kogito project.
18.1. Major changes and migration considerations
The following table describes the major changes and features that affect migration from the KIE Server API and KJAR to Red Hat build of Kogito deployments:
Feature | In KIE Server API | In Red Hat build of Kogito artifact |
---|---|---|
PMML models |
stored in |
copy as is to |
Other configuration options |
configured using a system property or | only default values are considered and no override of configuration is supported. |
Command-based REST API |
use | not supported. |
Domain-driven REST API | not supported. | advanced support for PMML model-specific generation. |
The features that are not mentioned in the previous table are either not supported or not required in a cloud-native Red Hat build of Kogito deployment.
18.2. Migration strategy
The migration strategy includes the following steps:
- Migrate a KJAR that is deployed on the KIE Server to a Red Hat build of Kogito microservice.
- Deploy the Red Hat build of Kogito microservice using Red Hat OpenShift Container Platform.
- Modify the external application from client PMML API on the KIE Server to the REST API of the Red Hat build of Kogito deployment.
18.3. Migrating a PMML model KJAR to a Red Hat build of Kogito microservice
You can migrate a KJAR that is implemented using PMML model to a Red Hat build of Kogito microservice.
Procedure
Create a Maven project for your Red Hat build of Kogito microservice.
For the procedure about creating a Maven project, see Creating a Maven project for a Red Hat build of Kogito microservice.
The Maven project creates Kogito artifacts.
-
Copy the PMML models from the
src/main/resources
folder of the KJAR to thesrc/main/resources
folder of the Kogito artifact. Run the following command to execute the Red Hat build of Kogito application:
mvn clean install
After running the Red Hat build of Kogito application, you can retrieve the Swagger or OAS specification file. The Swagger or OAS specifications provide the same information as the REST endpoint along with the following implementation details:
- Base URL of the server where the API is available
- References Schemas names
You can use the provided implementation details when your external application is re-routed to the new URL.
After migrating a PMML model KJAR to a Red Hat build of Kogito microservice, you need to deploy the microservice using Red Hat OpenShift Container Platform. For deployment options with Openshift, see OpenShift deployment options with the RHPAM Kogito Operator.
18.4. Modifying an external application to a Red Hat build of Kogito microservice
After deploying the PMML microservice, you need to modify the external application to a Red Hat build of Kogito deployment.
Prerequisites
The original external application must be implemented on the KIE Server client API.
Figure 18.1. Example external application implementation on KIE Server
Procedure
Remove all the usage of the KIE Server client API and replace it with the HTTP communication. The following is an example of a non-Java request:
Ensure that any HTTP client Java library is used inside the external application to create a similar invocation and parse the result.
The following is an example of Java 11 HTTP client and Gson to convert the input data to JSON:
NoteAll the parameters that are required as the values of the parameters are embedded in the URL that is called.