이 콘텐츠는 선택한 언어로 제공되지 않습니다.

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:

Table 18.1. PMML migration considerations
FeatureIn KIE Server APIIn Red Hat build of Kogito artifact

PMML models

stored in src/main/resources of KJAR.

copy as is to src/main/resources.

Other configuration options

configured using a system property or kmodule.xml file.

only default values are considered and no override of configuration is supported.

Command-based REST API

use ApplyPmmlModelCommand to request PMML evaluation.

not supported.

Domain-driven REST API

not supported.

advanced support for PMML model-specific generation.

Note

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:

  1. Migrate a KJAR that is deployed on the KIE Server to a Red Hat build of Kogito microservice.
  2. Deploy the Red Hat build of Kogito microservice using Red Hat OpenShift Container Platform.
  3. 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

  1. 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.

  2. Copy the PMML models from the src/main/resources folder of the KJAR to the src/main/resources folder of the Kogito artifact.
  3. 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

    screen capture of the external application implementation on KIE Server

Procedure

  1. 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:

    Example non-java request
  2. 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:

    Example of Java 11 HTTP client
    Note

    All the parameters that are required as the values of the parameters are embedded in the URL that is called.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.