You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: decisioncenter/dynamicdomain/README-KUBERNETES.md
+83-39Lines changed: 83 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -5,31 +5,28 @@ This README explains how to run the BOM dynamic domain sample in Kubernetes.
5
5
# Configuring the sample in Kubernetes
6
6
## 1. Build the sample code
7
7
8
-
The instructions below enable to build the JAR using a Docker container featuring Maven and a JDK version 17.
8
+
The instructions below enable to build the JAR using a Docker container featuring Maven and a JDK version 21.
9
9
10
-
Run command below in the `decisioncenter/dynamicdomain/src/ilog.rules.studio.samples.bomdomainpopulate` directory:
10
+
Run the command below in the `decisioncenter/dynamicdomain/src/ilog.rules.studio.samples.bomdomainpopulate` directory:
11
11
12
12
This will compile the source code
13
13
```bash
14
14
docker run --rm \
15
15
-v "$(pwd)":/usr/src/sample \
16
16
-w /usr/src/sample \
17
-
maven:3.8.5-openjdk-17 \
17
+
maven:3.9.9-ibm-semeru-21-jammy \
18
18
mvn clean install
19
19
```
20
+
> **Result**: The generated JAR file will be located in the `target` directory with the name `bomdomainpopulate-1.0.jar`.
20
21
21
22
## 2. Uploading JARs on a file server
22
23
23
-
The customization JARs can be made available to Decision Center in two ways:
24
-
1. the **legacy way**: by copying the JARs to a PVC and referencing this PVC using the parameter `decisionCenter.customlibPvc`
25
-
1. or the **new way** (since 9.0 only): by copying the JARs on a file server and referencing the files to download from this file server using the parameter `decisionCenter.downloadUrl`
24
+
Any file server reachable by Decision Center is suitable.
26
25
27
-
This document explains how to follow the **new way**. Any file server reachable by Decision Center is suitable. You can either use an existing one or follow the instructions [here](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/vnext-release/contrib/file-server/README.md#setup-an-httpd-file-server) to deploy a httpd file server in a new pod.
28
-
29
-
However you must use the **legacy way** if you deploy a version of ODM older than 9.0. Here are some [instructions](https://www.ibm.com/docs/en/odm/9.0.0?topic=kubernetes-customizing-decision-center-business-console) in the documentation.
26
+
You can either use an existing one or follow the instructions [here](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/vnext-release/contrib/file-server/README.md#setup-an-httpd-file-server) to deploy a httpd file server in a new pod.
30
27
31
28
Two JARs must be made available:
32
-
1. the Decision Center extension JAR built [previously](README.md#building-the-decision-center-extension-jar),
29
+
1. the Decision Center extension JAR built [previously](README-KUBERNETES.md#1-build-the-sample-code)
33
30
1. the JDBC driver of the database storing the data of the dynamic domains.
34
31
35
32
Download the JDBC driver (if the internal PostgreSQL database is used):
If all goes well, you should have an output with `201` status for the uploading of the JARs. For example:
44
+
```console
45
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
46
+
<html>
47
+
<head>
48
+
<title>201 Created</title>
49
+
</head><body>
50
+
<h1>Created</h1>
51
+
<p>Resource /bomdomainpopulate-1.0.jar has been created.</p>
52
+
</body></html>
53
+
```
54
+
46
55
## 3. Deploying ODM
47
56
48
-
Add the public IBM Helm charts repository:
57
+
To get access to the ODM material, you must have an IBM entitlement key to pull the images from the IBM Cloud Container registry.
58
+
59
+
### a. Retrieve your entitled registry key
60
+
61
+
- Log in to [MyIBM Container Software Library](https://myibm.ibm.com/products-services/containerlibrary) with the IBMid and password that are associated with the entitled software.
62
+
63
+
- In the **Container Software and Entitlement Keys** tile, verify your entitlement on the **View library page**, and then go to *Entitlement keys* to retrieve the key.
64
+
65
+
### b. Create a pull secret by running the kubectl create secret command
-`<ENTITLEMENT_KEY>`: The entitlement key from the previous step. Make sure to enclose the key in double quotes.
74
+
-`<USER_EMAIL>`: The email address associated with your IBMid.
75
+
76
+
> **Note**
77
+
> The `cp.icr.io` value for the docker-server parameter is the only registry domain name that contains the images. You must set the docker-username to `cp` to use the entitlement key as the docker-password.
78
+
79
+
The `my-odm-docker-registry` secret name must be used for the `image.pullSecrets` parameter when you run a Helm install of your containers. The `image.repository` parameter should also set to `cp.icr.io/cp/cp4a/odm`.
ibmcharts/ibm-odm-prod <version><version> IBM Operational Decision Manager License By in...
94
+
NAME CHART VERSIONAPP VERSION DESCRIPTION
95
+
ibm-helm/ibm-odm-prod 25.0.0 9.5.0.0 IBM Operational Decision Manager License By in...
61
96
```
62
97
63
98
Create a file named `values.yaml`. This file will be used by the `helm install` command to specify the configuration parameters.
@@ -82,33 +117,42 @@ internalDatabase:
82
117
83
118
Add all the other parameters suitable to your platform in `values.yaml`. Check this [link](https://github.com/DecisionsDev/odm-docker-kubernetes/tree/master/platform) for help.
84
119
85
-
Install an ODM release named `myodmsample` (if you choose a different release name, you need to edit the file [database.properties](src/ilog.rules.studio.samples.bomdomainpopulate/src/main/resources/data/database.properties)):
120
+
If you are on Openshift, you can use this [values.yaml](./src/ilog.rules.studio.samples.bomdomainpopulate/values.yaml) file by replacing `<FILESERVER_URL>` with the actual URL of the file server hosting the JARs.
> **NOTE**: If you choose a **different** release name, you must edit the value of `database.url` parameter accordingly in the [database.properties](src/ilog.rules.studio.samples.bomdomainpopulate/src/main/resources/data/database.properties), [rebuild](README-KUBERNETES.md#1-build-the-sample-code) the `bomdomainpopulate-1.0.jar`, and upload the JAR to the file server again.
89
127
90
128
## 4. Configuring Decision Center
91
129
92
130
The class that implements the customization must be declared:
93
-
- either using a custom setting
94
-
- or using a JVM parameter
131
+
- either using a custom setting at Business Console
132
+
- *or* using a JVM parameter
95
133
96
134
### 4.1 Using a custom setting
97
-
1. Log in into the Business Console as an admin
98
-
1. Navigate to **Administration > Settings > Custom Settings**
99
-
1. Click the *Add custom setting***icon** and set:
135
+
1. Log in to the Business Console. Use the following credentials if you install with the [values.yaml](./src/ilog.rules.studio.samples.bomdomainpopulate/values.yaml) for OCP:
136
+
- **Username**: `odmAdmin`
137
+
- **Password**: `odmAdmin`
138
+
2. Navigate to **Administration > Settings > Custom Settings**
139
+
3. Click the *Add custom setting* **icon** and set:
100
140
- name = `teamserver.derbyDataBaseDomainProvider`
101
141
- description = `derbyDataBaseDomainProvider`
102
142
- type = `String`
103
-
- leave `default value` empty
104
-
1. Set the value to `ilog.rules.studio.samples.bomdomainpopulate.DataBaseDomainValueProvider`
143
+
- leave `default value` empty. Save the setting.
144
+
4. Set the value of this new custom setting to `ilog.rules.studio.samples.bomdomainpopulate.DataBaseDomainValueProvider`.
105
145
106
146
### 4.2 Using a JVM parameter
107
147
108
-
Follow instructions similar to [here](https://www.ibm.com/docs/en/odm/9.0.0?topic=kubernetes-persisting-decision-center-ruleset-cache) to add the JVM parameter below: (using ina Config Map referenced by the Helm parameter **decisionCenter.jvmOptionsRef**)
148
+
Follow instructions as described [here](https://www.ibm.com/docs/en/odm/9.0.0?topic=kubernetes-persisting-decision-center-ruleset-cache) to create a Config Map with the additional JVM parameter below:
1. Import the rule project archive `projects/bomdomainpopulate-rules.zip`.
178
+
1. Log in to the Business Console.
179
+
2. Navigate to the **Library** tab.
180
+
3. Import the rule project archive `dynamicdomain/projects/bomdomainpopulate-rules.zip`.
137
181
> Note: this rule project `bomdomainpopulate-rules` is only aimed at editing rules to demonstrate loading domains from a database. It is missing a deployment configuration and cannot be executed.
138
-
1. Display the rule `CheckOrder > OrderType`. Notice the error **Value (string) 'CompanyX' is incorrect**. Edit the rule and either remove **"CompanyX"** and press SPACE or double-click **"CompanyX"**. A list of suitable companies gets displayed in a drop-down. Close down the rule without saving.
139
-
1. Display the rule `CheckCurrency > CurrencyRestriction`. No warning is displayed.
140
-
1. Let's now make some changes in the dynamic domains in the database. Run:
182
+
4. Display the rule `CheckOrder > OrderType`. An error **Value (string) 'CompanyX' is incorrect** is displayed. Edit the rule and either remove **"CompanyX"** and press SPACE or double-click **"CompanyX"**. A list of suitable companies gets displayed in a drop-down. Close down the rule **without** saving.
183
+
5. Display the rule `CheckCurrency > CurrencyRestriction`. No warning is displayed.
184
+
6. Let's now make some changes in the dynamic domains in the database. Run:
1. Display the rule `CheckOrder > OrderType` back again. Notice that there is no error anymore. The effects of the changes done in the database are taken into account automatically because the values that the field `stock` can take are dynamically fetched from the database (and not stored in the BOM).
147
-
1. Conversely if you display the rule `CheckCurrency > CurrencyRestriction`, there is still no warning. So let's now import the changes donein the database into the BOM. Click the **Model** tab, and then the **Dynamic Domains** sub-tab. Expand all the three domains. You should see this: (Notice that the **Australian Dollar** was removed)
190
+
7. Display the rule `CheckOrder > OrderType` back again. Notice that there is no error anymore. The effects of the changes (the addition of `CompanyX` and `CompanyY`) done in the database are taken into account automatically because the values that the field `stock` can take are dynamically fetched from the database (and not stored in the BOM).
191
+
8. Conversely if you display the rule `CheckCurrency > CurrencyRestriction`, there is still no warning. So let's now import the changes done in the database into the BOM. Click the **Model** tab, and then the **Dynamic Domains** sub-tab. Expand all the three domains. You should see this: (Notice that the **Australian Dollar** was removed)
1. Tick **Domain** to selectall the domains, and click the **Apply changes** button. Confirm the change.
152
-
1. Display the rule `CheckCurrency > CurrencyRestriction` back again. Now a warning `'Australian Dollar' is deprecated` is displayed as the result of the update of the Dynamic Domains in the BOM.
195
+
9. Tick **Domain** to select all the domains, and click the **Apply changes** button. Confirm the change.
196
+
10. Display the rule `CheckCurrency > CurrencyRestriction` back again. Now a warning `'Australian Dollar' is deprecated` is displayed as the result of the update of the Dynamic Domains in the BOM.
0 commit comments