Skip to content

Commit 3c03fef

Browse files
committed
Update instruction for k8s version wrt odm95
1 parent 0327a50 commit 3c03fef

File tree

1 file changed

+83
-39
lines changed

1 file changed

+83
-39
lines changed

decisioncenter/dynamicdomain/README-KUBERNETES.md

Lines changed: 83 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,28 @@ This README explains how to run the BOM dynamic domain sample in Kubernetes.
55
# Configuring the sample in Kubernetes
66
## 1. Build the sample code
77

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

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:
1111

1212
This will compile the source code
1313
```bash
1414
docker run --rm \
1515
-v "$(pwd)":/usr/src/sample \
1616
-w /usr/src/sample \
17-
maven:3.8.5-openjdk-17 \
17+
maven:3.9.9-ibm-semeru-21-jammy \
1818
mvn clean install
1919
```
20+
> **Result**: The generated JAR file will be located in the `target` directory with the name `bomdomainpopulate-1.0.jar`.
2021
2122
## 2. Uploading JARs on a file server
2223

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

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

3128
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)
3330
1. the JDBC driver of the database storing the data of the dynamic domains.
3431

3532
Download the JDBC driver (if the internal PostgreSQL database is used):
@@ -43,21 +40,59 @@ curl -T target/bomdomainpopulate-1.0.jar $FILESERVER_URL
4340
curl -T jdbc-driver.jar $FILESERVER_URL
4441
```
4542

43+
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+
4655
## 3. Deploying ODM
4756

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
66+
67+
```bash
68+
kubectl create secret docker-registry my-odm-docker-registry --docker-server=cp.icr.io \
69+
--docker-username=cp --docker-password="<ENTITLEMENT_KEY>" --docker-email=<USER_EMAIL>
70+
```
71+
Where:
72+
73+
- `<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`.
80+
81+
### c. Add the public IBM Helm charts repository:
82+
4983
```bash
50-
helm repo add ibmcharts https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm
84+
helm repo add ibm-helm https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm
5185
helm repo update
52-
````
86+
```
87+
88+
### d. Check that you can access the ODM charts:
5389

54-
Check that you can access the ODM charts:
5590
```bash
5691
helm search repo ibm-odm-prod
5792
```
5893
```bash
59-
NAME CHART VERSION APP VERSION DESCRIPTION
60-
ibmcharts/ibm-odm-prod <version> <version> IBM Operational Decision Manager License By in...
94+
NAME CHART VERSION APP VERSION DESCRIPTION
95+
ibm-helm/ibm-odm-prod 25.0.0 9.5.0.0 IBM Operational Decision Manager License By in...
6196
```
6297

6398
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:
82117

83118
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.
84119

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.
121+
122+
Install an ODM release named `myodmsample`:
86123
```bash
87-
helm install myodmsample ibmcharts/ibm-odm-prod -f values.yaml
124+
helm install myodmsample ibm-helm/ibm-odm-prod -f values.yaml
88125
```
126+
> **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.
89127

90128
## 4. Configuring Decision Center
91129

92130
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
95133

96134
### 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:
100140
- name = `teamserver.derbyDataBaseDomainProvider`
101141
- description = `derbyDataBaseDomainProvider`
102142
- 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`.
105145

106146
### 4.2 Using a JVM parameter
107147

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 in a 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:
109149
```
110150
-Dilog.rules.teamserver.derbyDataBaseDomainProvider=ilog.rules.studio.samples.bomdomainpopulate.DataBaseDomainValueProvider
111151
```
152+
You need to set this new Config Map using the Helm parameter **decisionCenter.jvmOptionsRef**. To do so, apply an upgrade to your helm release:
153+
```bash
154+
helm upgrade myodmsample ibm-helm/ibm-odm-prod --reuse-values --set decisionCenter.jvmOptionsRef=<your_updated_dc_jvm_options_ref_configmap>
155+
```
112156

113157
## 5. Initializing the database
114158

@@ -118,35 +162,35 @@ Follow instructions similar to [here](https://www.ibm.com/docs/en/odm/9.0.0?topi
118162
echo $DBSERVER
119163
```
120164

121-
1. Navigate to the BOM dynamic domain sample directory:
165+
2. Navigate to the BOM dynamic domain sample directory:
122166
```bash
123167
cd decisioncenter/dynamicdomain
124168
```
125169

126-
1. Copy the initialization SQL script into the pod and execute it:
170+
3. Copy the initialization SQL script into the pod and execute it:
127171
```bash
128172
kubectl cp ./sql_scripts/createAndPopulate.sql $DBSERVER:/tmp
129173
kubectl exec $DBSERVER -- psql -U odmusr -d odmdb -f /tmp/createAndPopulate.sql
130174
```
131175

132-
## 6. Using the Sample
176+
## 6. Using the sample
133177

134-
1. Log in into the Business Console.
135-
1. Navigate to the **Library** tab.
136-
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`.
137181
> 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:
141185
```bash
142186
kubectl cp ./sql_scripts/modifyTables.sql $DBSERVER:/tmp
143187
kubectl exec $DBSERVER -- psql -U odmusr -d odmdb -f /tmp/modifyTables.sql
144188
```
145189

146-
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 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)
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)
148192

149193
![Dynamic Domains update](images/dynamicDomainsUpdate.png)
150194

151-
1. Tick **Domain** to select all 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

Comments
 (0)