Decision Management (ODM, ADS)

 View Only

How do I import a large project into Decision Center from CP4BA ?

By Johanne Sebaux posted Wed September 07, 2022 03:55 PM

  

Last updated: 2023, December the 21st 

PDF file version

By Johanne Sebaux

This article is part of an article series around Operational Decision Manager (ODM) topologies in context of Cloud Pak for Business Automation (CP4BA).  For more information about ODM environments and the topologies, see CP4BA ODM topologies on OpenShift.

This topology was tested on CP4BA 23.0.2 and 22.0.1.

Target audience: Operational Decision Manager user with ODM Administrator role

Estimated duration: 60 minutes

1. Introduction

Whether you have a Decision Service zip file larger than 20Mb to import or you have hit a "MaxUploadSizeExceededException" error in Decision Center (DC) pod logs, this article will have the answer to help you work out a solution. Indeed, this document aims to describe how to handle a situation where Decision Center is encountering a timeout while uploading a large project.


2. Symptoms

As ODM Administrator I have a large Decision Service zip file to import into DC. The import wizard while processing your request, throws an exception like the following:
The server returned an invalid response, probably due to a timeout or session expiration, but the decision service import might have been completed. To check, refresh the page.



After first investigation in DC pod logs, you have spotted a  MaxUploadSizeExceededException error with the following message:
"message":"org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size of 20000000 bytes exceeded; nested exception is org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (42540541) exceeds the configured maximum (20000000)"

Indeed, the Decision Service zip file size is limited at upload time to 20 MB by default in the CP4BA context for security reason. Therefore, before processing projects coming as zip file, a couple of customization and configuration updates need to be implemented.

3. Procedure 

Starting from CP4BA 22.0.1, the end user has the possibility to customize ODM production pattern deployment so that Decision Service zip file larger than 20 MB can be imported directly from DC user interface.
To do so, please follow the procedure described below.
3.1/Check ODM user role:

To be able to administrate DC, a user has to have some role setup in ZEN. 

Find more information about user configuration in IBM Cloud Pak for Business Automation documentation, configuring user access:

-       22.0.1 link

-       22.0.2 link

-       23.0.1 link

-       23.0.2 link

In the ZEN access control panel, your user should have ODM Administrator role applied, like in the following screenshot:


3.2/Check deployment size:

The import operation from DC consumes CPU. To have better performance, one must adjust his or her ODM deployment T-shirt size. The idea is to have a sufficiently large ODM deployment so that the import operation is efficient.

There are two straightforward ways to validate ODM T-shirt size of an actual deployment. The first one is by checking a Custom Resource (CR) parameter. The second one is to check ODM deployment details.
3.2.1/ Checking size parameter in CR:

Browse the CR YAML file of the deployment which can be found from OpenShift administration console under
"Operators > Installed Operators > IBM Cloud Pak for Business Automation (CP4BA) multi-pattern > CP4BA deployment > <CR_NAME>"

In the ODM configuration section, check the value of the parameter called "deployment_profile_size".
        • e.g:
          •   odm_configuration:
          •     deployment_profile_size: large
          •     ...

In the case where the deployment size is globalized at Cloud Pak level, the parameter will be placed in the shared configuration section and called "
sc_deployment_profile_size".
        • e.g:
          •   shared_configuration:
          •     sc_deployment_profile_size: medium
          •     ...

Please note that the
size parameter in ODM configuration section overrides size parameter in shared configuration section. For a production deployment type, the default is small.

3.2.2/ Checking size in terms of pods:

Each size corresponds to a fixed number of pods of each ODM service.

Browse the Decision Center deployment which can be found from OpenShift administration console under "Workloads > Deployments > <CR_NAME>-odm-decisioncenter > Pods”.

For instance, a ODM large deployment will consist of:

        
    • 2 Decision Center pods:
      • <crname>-odm-decisioncenter-xxx                     
      • <crname>-odm-decisioncenter-xxx        
3.3/ Adapt the import to your project:

Even when ODM deployment size is large enough, some default timeout settings can inhibit data manipulation. 

For instance, importing a large Decision Service zip file more than 20 MB could fail since the default max upload size is set at 20 MB and default transaction timeout is 600s.

To be able to import project zip file without encountering timeout, the settings have to be adjusted.
Let's see how to update these settings.
3.3.1/ Updating ODM production pattern deployment: 

The required update is described in the documentation, Customizing Decision Center:

-       22.0.1 link

-       22.0.2 link

-       23.0.1 link

-       23.0.2 link

Choose the values which fit your needs (size of your project zip file) and create a configmap.
oc create configmap my-odm-dc-web-configmap --from-file web-configuration.properties
configmap/my-odm-dc-web-configmap created
Once the configmap is created, it looks like:
      • oc describe cm my-odm-dc-web-configmap
      • Name:         my-odm-dc-web-configmap
      • Namespace:    <my_dba_project>
      • Labels:       <none>
      • Annotations:  <none>
      • Data
      • ====
      • web-configuration.properties:
      • ----
      • ilog.rules.teamserver.transaction.timeout=6000
      • maxUploadSize=50000000
      • Events:  <none>
At this stage, the configmap needs to be applied so that the changes can be taken into account.

Update your CR and assign the configmap to decisionCenter.webConfigRef.my-odm-dc-web-configmap parameter.
      •   odm_configuration:
        • ...
      •     deployment_profile_size: large
      •     decisionCenter:
      •       webConfigRef: my-odm-dc-web-configmap
If updating the CR from OCP administration console, the save button will apply the modification. However, if the CR is a local copy, it must be applied via command line:
oc apply -f cp4ba-cr.yaml
Once the updated CR applied, wait...
The configuration is taken into account when all of the DC pods restart.

Then in each DC pod log, one can check that the new values are reflected.

Browse the Decision Center pod logs which can be found from OpenShift administration console under "Workloads > Deployments > <CR_NAME>-odm-decisioncenter > Pods > <CR_NAME>-odm-decisioncenter-xxx > Logs > Raw”.

The logs should contain this statement:

Setting parameter ilog.rules.teamserver.transaction.timeout to 6000 in the web.xml file
  • replace maxUploadSize by 50000000 in /config/apps/decisioncenter.war/WEB-INF/spring/applicationContext.xml
3.3.2/ Updating DB configuration: 

Updating ODM deployment configuration is not enough to go through an import of a large zip file to DC. Indeed, default values while creating DB tables must be updated to handle logs files properly.

Find out more about external database configuration, Configuring an external database:

-       22.0.1 link

-       22.0.2 link

-       23.0.1 link

-       23.0.2 link



How do I find out my DB log file configuration requires an update?
When uploading zip file in DC, if the DC pod log contains this error:
Got exception :The transaction log for the database is full.. SQLCODE=-964

An IBM support article explains this on a similar use case:
https://www.ibm.com/support/pages/resolving-transaction-log-database-full-error
How do I update my DB configuration?
NB: the following example deals with a DB2 database
Connect to DB "MYODMDB"
  • db2 connect to MYODMDB
    •  Database Connection Information
    •  Database server        = DB2/LINUXX8664 11.5.7.0
    •  SQL authorization ID   = USERDB
    •  Local database alias   = MYODMDB
Check DB log file configuration values
db2 GET DB CFG
       Database Configuration for Database 
 ...
 Log file size (4KB)                         (LOGFILSIZ) = 1024 
 Number of primary log files                (LOGPRIMARY) = 13
 Number of secondary log files               (LOGSECOND) = 12
   ...
Update DB log file configuration
 db2 UPDATE DB CFG FOR MYODMDB USING LOGPRIMARY 128 IMMEDIATE;
             DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
db2 UPDATE DB CFG FOR MYODMDB USING LOGSECOND 64 IMMEDIATE;
             DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
Activate DB log file configuration
db2 GET DB CFG
       Database Configuration for Database 
 ...
 Log file size (4KB)                         (LOGFILSIZ) = 1024 
 Number of primary log files                (LOGPRIMARY) = 128
 Number of secondary log files               (LOGSECOND) = 64
   ...
Make changes effective
When updating the DB log file configuration, one can read this message:
"SQL1363W  One or more of the parameters submitted for immediate modification were not changed dynamically. For these configuration parameters, the database must be shutdown and reactivated before the configuration parameter changes become effective."
Hence, to activate these new parameter values, run the db2 commands DB2STOP then DB2START

4. Example: upload 40 MB zip file from DC user interface

Current example is describing the import of
a 40 MB zip file containing a 50k-rule Decision Service.
After login in DC with a user having ODM Administrator role, from the library page click on the "Import Decision Service" button
A wizard will popup  to help browsing your local zip file. 

Browse the Decision Center metrics view which can be found from OpenShift administration console under "Workloads > Deployments > <CR_NAME>-odm-decisioncenter > Metrics”.Important: the usage of Decision Governance Framework must be decided while importing, any direct conversion is impossible afterwards. Another row of importation would be required to activate this feature.


When clicking on the "Import button", the upload progress can be followed in the wizard window.

Please note that the user interface may timeout with the following message:


Despite this error, the upload operation goes on as a background activity. 
No activities surface on the UI nor in DC pod logs. However, the DC pod CPU load shows an ongoing activity. This metric can demonstrate the end of the import operation when the CPU resource usage drops.



Important: once the import wizard has timed out, the library page has to be manually refreshed to see the newly imported file. 

5. Conclusion

This article illustrates how to tune the different parts of your ODM production pattern environment. With the proper user role, DC customization and database configuration, one can easily import large projects from the user interface in DC. 

There might have some other consequences at runtime due to large Decision Services. The Execution Units (XU) timeout can also be customized as described in the IBM Cloud Pak for Business Automation documentation, Optimizing the execution unit (XU):

-       22.0.1 link

-       22.0.2 link

-       23.0.1 link

-       23.0.2 link 

If you liked this article, an equivalent one for addressing XU timeout could be provided!


#businessrules
#CloudPakforBusinessAutomation
#OperationalDecisionManager(ODM)

0 comments
154 views

Permalink