Skip to content

Commit 8b4fa87

Browse files
authored
Merge branch 'vnext-release' into businessvalueeditor95
2 parents 0e2460a + 95924ea commit 8b4fa87

File tree

69 files changed

+1190
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1190
-44
lines changed

.secrets.baseline

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "package-lock.json|FETCH_HEAD|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2024-10-30T14:42:27Z",
6+
"generated_at": "2025-01-24T13:15:24Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -77,6 +77,44 @@
7777
}
7878
],
7979
"results": {
80+
"cross-component/deployexecute/README-KUBERNETES.md": [
81+
{
82+
"hashed_secret": "b11974a9da0d56698df935ab86e19b127804d6d4",
83+
"is_secret": false,
84+
"is_verified": false,
85+
"line_number": 17,
86+
"type": "Secret Keyword",
87+
"verified_result": null
88+
}
89+
],
90+
"cross-component/deployexecute/README.md": [
91+
{
92+
"hashed_secret": "1909ac2fa979966a53b5cffe5723797a7c3a85b0",
93+
"is_secret": false,
94+
"is_verified": false,
95+
"line_number": 91,
96+
"type": "Secret Keyword",
97+
"verified_result": null
98+
},
99+
{
100+
"hashed_secret": "8309b91c4b2e7ccdb6305356dc5b12edbf87f5cd",
101+
"is_secret": false,
102+
"is_verified": false,
103+
"line_number": 94,
104+
"type": "Secret Keyword",
105+
"verified_result": null
106+
}
107+
],
108+
"cross-component/deployexecute/values.yaml": [
109+
{
110+
"hashed_secret": "fd1daf2e350a06b865f4a1e17bb39183b806c1e9",
111+
"is_secret": false,
112+
"is_verified": false,
113+
"line_number": 16,
114+
"type": "Secret Keyword",
115+
"verified_result": null
116+
}
117+
],
80118
"decisioncenter/businessvalueeditor/README-KUBERNETES.md": [
81119
{
82120
"hashed_secret": "b11974a9da0d56698df935ab86e19b127804d6d4",
@@ -102,7 +140,7 @@
102140
"hashed_secret": "54dfd9c625c7fe5be99078f7f117bbccf50b49be",
103141
"is_secret": false,
104142
"is_verified": false,
105-
"line_number": 42,
143+
"line_number": 70,
106144
"type": "Secret Keyword",
107145
"verified_result": null
108146
}
@@ -257,6 +295,26 @@
257295
"verified_result": null
258296
}
259297
],
298+
"decisioncenter/users_groups_synchronization/README-KUBERNETES.md": [
299+
{
300+
"hashed_secret": "b11974a9da0d56698df935ab86e19b127804d6d4",
301+
"is_secret": false,
302+
"is_verified": false,
303+
"line_number": 24,
304+
"type": "Secret Keyword",
305+
"verified_result": null
306+
}
307+
],
308+
"decisioncenter/users_groups_synchronization/users_groups_synchronization-source/values.yaml": [
309+
{
310+
"hashed_secret": "fd1daf2e350a06b865f4a1e17bb39183b806c1e9",
311+
"is_secret": false,
312+
"is_verified": false,
313+
"line_number": 20,
314+
"type": "Secret Keyword",
315+
"verified_result": null
316+
}
317+
],
260318
"decisioncenter/webhooknotifier/README-KUBERNETES.md": [
261319
{
262320
"hashed_secret": "0a1801c853c7fdc877f3731bcc2e3e1852f321ae",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ This repository is licensed under the [Apache 2.0 License](LICENSE).
6666

6767
## Notice
6868

69-
© Copyright IBM Corporation 2024.
69+
© Copyright IBM Corporation 2025.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
# Introduction
3+
4+
This readme explains how to run the sample in Docker.
5+
6+
Doing so, you do not need to have ODM installed. Instead we are relying on the [ODM for developers](https://github.com/DecisionsDev/odm-for-developers) container image.
7+
8+
# Starting the ODM Container
9+
10+
Start the ODM container:
11+
```bash
12+
docker-compose up &
13+
```
14+
15+
# Running the sample
16+
17+
Follow the instructions in [README](README.md)
18+
19+
# Stopping the ODM Container
20+
21+
```bash
22+
docker-compose down
23+
```
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Introduction
2+
3+
This page explains how to deploy ODM in Kubernetes.
4+
5+
## Deploying ODM
6+
7+
#### a. Retrieve your entitled registry key
8+
9+
- Log in to [My IBM Container Software Library](https://myibm.ibm.com/products-services/containerlibrary) with the IBMid and password that are associated with the entitled software.
10+
11+
- 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.
12+
13+
#### b. Create a pull secret by running the kubectl create secret command
14+
15+
```bash
16+
kubectl create secret docker-registry my-odm-docker-registry --docker-server=cp.icr.io \
17+
--docker-username=cp --docker-password="<ENTITLEMENT_KEY>" --docker-email=<USER_EMAIL>
18+
```
19+
20+
Where:
21+
22+
- `<ENTITLEMENT_KEY>`: The entitlement key from the previous step. Make sure to enclose the key in double quotes.
23+
- `<USER_EMAIL>`: The email address associated with your IBMid.
24+
25+
> **Note**
26+
> 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.
27+
28+
#### c. Add the public IBM Helm charts repository
29+
30+
```bash
31+
helm repo add ibmcharts https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm
32+
helm repo update
33+
````
34+
35+
Check that you can access the ODM charts:
36+
```bash
37+
helm search repo ibm-odm-prod
38+
```
39+
```bash
40+
NAME CHART VERSION APP VERSION DESCRIPTION
41+
ibmcharts/ibm-odm-prod <version> <version> IBM Operational Decision Manager License By in...
42+
```
43+
44+
### d. Create the `values.yaml` parameter file
45+
46+
Create a file named `values.yaml`. This file will be used by the `helm install` command to specify the configuration parameters.
47+
48+
Find the parameters suitable to your platform in [link](https://github.com/DecisionsDev/odm-docker-kubernetes/tree/master/platform).
49+
50+
If you are on Openshift you can use this [values.yaml](values.yaml).
51+
52+
### e. Install an ODM release
53+
```bash
54+
helm install myodmsample ibmcharts/ibm-odm-prod -f values.yaml
55+
```
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
# Automating the deployment and execution of rulesets with the REST API
2+
3+
## Introduction
4+
5+
This sample demonstrates how to automate the deployment and execution of a ruleset using the REST API.
6+
7+
In this sample, you will:
8+
- Deploy IBM ODM on either Kubernetes or Docker.
9+
- Optionally import a Decision Service into Decision Center.
10+
- Deploy a ruleset from Decision Center to Decision Server.
11+
- Execute the deployed ruleset.
12+
13+
## Prerequisites
14+
15+
Ensure you have the following tools installed:
16+
- Docker 24.0.x or later, or Kubernetes 1.27+.
17+
- [jq for JSON processing](https://jqlang.github.io/jq/download/)
18+
19+
## Installation of ODM
20+
21+
Select your preferred deployment method and follow the corresponding guide:
22+
* [Kubernetes](README-KUBERNETES.md)
23+
* [Docker](README-DOCKER.md)
24+
25+
## Configuration
26+
27+
### 1. Set Environment Variables
28+
29+
Define the following environment variables:
30+
31+
<!-- markdown-link-check-disable -->
32+
33+
| Name  | Description | Value on Kubernetes | Value on Docker |
34+
| - | - | - | - |
35+
| DC_API_URL | Decision Center API URL | see below | http://localhost:9060/decisioncenter-api |
36+
| DSR_URL | Decision Server Runtime URL | see below | http://localhost:9060/DecisionService |
37+
38+
<!-- markdown-link-check-enable-->
39+
If ODM is deployed on Kubernetes, you can check the **Access the ODM services** section for your platform to find out how to get those URLs:
40+
- [Amazon EKS](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/master/platform/eks/README.md#6-access-the-odm-services)
41+
- [Azure](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/master/platform/azure/README.md#access-odm-services)
42+
- [Google GKE](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/master/platform/gcloud/README.md#6-access-odm-services)
43+
- [Minikube](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/master/platform/minikube/README.md#c-access-the-odm-services)
44+
- [Openshift](https://github.com/DecisionsDev/odm-docker-kubernetes/blob/master/platform/roks/README.md#4-access-the-odm-services)
45+
46+
### 2. Deploy the `Loan Validation Service` Decision Service
47+
If the `Loan Validation Service` is not available in Decision Center, import it using the following commands:
48+
49+
```bash
50+
# configure the Authentication (using Basic Auth)
51+
export AUTH_CREDENTIALS=(--user "odmAdmin:odmAdmin")
52+
53+
export DECISION_SERVICE_NAME="Loan Validation Service"
54+
export DS_FILENAME="${DECISION_SERVICE_NAME// /_}.zip" # replace spaces by underscores
55+
export DS_FILENAME_URLENCODED="${DECISION_SERVICE_NAME// /%20}.zip" # replace spaces by %20
56+
57+
# download the Decision Service zip file
58+
curl -sL -o ${DS_FILENAME} "https://github.com/DecisionsDev/odm-for-dev-getting-started/blob/master/${DS_FILENAME_URLENCODED}?raw=1"
59+
60+
# upload the Decision Service in Decision Center
61+
curl -sk -X POST ${AUTH_CREDENTIALS[@]} -H "accept: application/json" -H "Content-Type: multipart/form-data" \
62+
--form "file=@${DS_FILENAME};type=application/zip" \
63+
"${DC_API_URL}/v1/decisionservices/import"
64+
```
65+
66+
## Running the sample
67+
68+
```bash
69+
# configure the Authentication (using Basic Auth)
70+
export AUTH_CREDENTIALS=(--user "odmAdmin:odmAdmin")
71+
72+
# get the ID of the Decision Service in Decision Center
73+
export DECISION_SERVICE_NAME="Loan Validation Service"
74+
export DECISION_SERVICE_NAME_URLENCODED="${DECISION_SERVICE_NAME// /%20}" # replace spaces by %20
75+
export GET_DECISIONSERVICE_RESULT=$(curl -sk -X GET ${AUTH_CREDENTIALS[@]} -H "accept: application/json" "${DC_API_URL}/v1/decisionservices?q=name%3A${DECISION_SERVICE_NAME_URLENCODED}")
76+
export DECISIONSERVICEID=$(echo ${GET_DECISIONSERVICE_RESULT} | jq -r '.elements[0].id')
77+
78+
# get the ID of the deployment configuration in Decision Center
79+
export DEPLOYMENT_NAME="production deployment"
80+
export DEPLOYMENT_NAME_URLENCODED="${DEPLOYMENT_NAME// /%20}" # replace spaces by %20
81+
export GET_DEPLOYMENT_RESULT=$(curl -sk -X GET ${AUTH_CREDENTIALS[@]} -H "accept: application/json" "${DC_API_URL}/v1/decisionservices/${DECISIONSERVICEID}/deployments?q=name%3A${DEPLOYMENT_NAME_URLENCODED}")
82+
export DEPLOYMENTCONFIGURATIONID=$(echo ${GET_DEPLOYMENT_RESULT} | jq -r '.elements[0].id')
83+
84+
# deploy the ruleapp from Decision Center
85+
curl -sk -X POST ${AUTH_CREDENTIALS[@]} -H "accept: application/json" "${DC_API_URL}/v1/deployments/${DEPLOYMENTCONFIGURATIONID}/deploy" | jq
86+
87+
# execute the ruleset that was deployed
88+
export RULESET_PATH="/production_deployment/loan_validation_production"
89+
curl -sk -X POST ${AUTH_CREDENTIALS[@]} -H "accept: application/json" -H "Content-Type: application/json" -d "@payload.json" ${DSR_URL}/rest${RULESET_PATH} | jq
90+
```
91+
92+
> [!NOTE]
93+
> The commands above rely on the Basic Authentication.
94+
>
95+
> - In an environment with OpenID Connect, the authentication can be performed using an access token retrieved with the `client_credentials` grant type by:
96+
> - setting the environment variables
97+
> - CLIENT_ID
98+
> - CLIENT_SECRET
99+
> - OPENID_TOKEN_URL
100+
> - and replacing `export auth_credentials=(--user "odmAdmin:odmAdmin")` by the commands below:
101+
> ```bash
102+
> export ACCESS_TOKEN=$(curl -sk -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=${CLIENT_ID}&scope=openid&client_secret=${CLIENT_SECRET}&grant_type=client_credentials" ${OPENID_TOKEN_URL} | jq -r '.access_token')
103+
> export AUTH_CREDENTIALS=(-H "Authorization: Bearer ${ACCESS_TOKEN}")
104+
> ```
105+
> - In a CP4BA environment, the authentication can be performed using a [Zen API key](https://www.ibm.com/docs/en/cloud-paks/cp-biz-automation/24.0.1?topic=access-using-zen-api-key-authentication). To do so:
106+
> - set the environment variables
107+
> - USERNAME
108+
> - ZEN_API_KEY
109+
> - replace `export auth_credentials=(--user "odmAdmin:odmAdmin")` by the commands below:
110+
> ```bash
111+
> export BASE64ENCODED_USERNAME_AND_APIKEY=$(echo -n "${USERNAME}:${ZEN_API_KEY}" | base64)
112+
> export AUTH_CREDENTIALS=(-H "Authorization: ZenApiKey ${BASE64ENCODED_USERNAME_AND_APIKEY}")
113+
> ```
114+
115+
## Expected result
116+
117+
1. After deploying the ruleset, you should see a confirmation message:
118+
119+
```
120+
{
121+
"id": "e51db153-bca2-49a8-8998-2b5e6c93f6cb",
122+
"internalId": "dsm.DSDeploymentReport:35:35",
123+
"name": "Report 2025-01-27_11-11-37-203",
124+
"createdBy": "odmAdmin",
125+
"createdOn": "2025-01-27T10:11:37.000+00:00",
126+
"lastchangedBy": "odmAdmin",
127+
"lastChangedOn": "2025-01-27T10:11:51.000+00:00",
128+
"status": "COMPLETED",
129+
"ruleAppName": "production_deployment",
130+
"messages": {
131+
"elements": [
132+
{
133+
"message": "The version '1.0' of the ruleset 'loan_validation_production' was successfully deployed to Decision Service Execution (http://localhost:9060/res).",
134+
"ruleArtifact": null,
135+
"severity": "INFO"
136+
},
137+
{
138+
"message": "The RuleApp was successfully deployed to Decision Service Execution (http://localhost:9060/res).",
139+
"ruleArtifact": null,
140+
"severity": "INFO"
141+
}
142+
],
143+
"totalCount": 2,
144+
"number": 0,
145+
"size": 2
146+
},
147+
"snapshot": {
148+
"id": "f5efc08f-23d2-46ef-bed8-515fec6b46cf",
149+
"internalId": "dsm.DsDeploymentBsln:71:71",
150+
"name": "production-deployment_2025-01-27_11-11-37-153",
151+
"createdBy": "odmAdmin",
152+
"createdOn": "2025-01-27T10:11:37.000+00:00",
153+
"lastchangedBy": "odmAdmin",
154+
"lastChangedOn": "2025-01-27T10:11:38.000+00:00",
155+
"parentId": "1558f25b-daa6-4982-8b0b-48a388c7c202",
156+
"documentation": null,
157+
"buildMode": "DecisionEngine",
158+
"kind": "DeploymentSnapshot"
159+
},
160+
"servers": [
161+
"Decision Service Execution"
162+
],
163+
"archive": null
164+
}
165+
```
166+
167+
2. After executing the ruleset, the response should include the rule execution results:
168+
```
169+
{
170+
"report": {
171+
"borrower": {
172+
"firstName": "string",
173+
"lastName": "string",
174+
"birth": "1988-09-29T01:49:45.000+0000",
175+
"SSN": {
176+
"areaNumber": "string",
177+
"groupCode": "string",
178+
"serialNumber": "string"
179+
},
180+
"yearlyIncome": 3,
181+
"zipCode": "string",
182+
"creditScore": 3,
183+
"spouse": {
184+
"birth": "1982-12-08T14:13:09.850+0000",
185+
"SSN": {
186+
"areaNumber": "",
187+
"groupCode": "",
188+
"serialNumber": ""
189+
},
190+
"yearlyIncome": 0,
191+
"creditScore": 0,
192+
"latestBankruptcy": {
193+
"chapter": 0
194+
}
195+
},
196+
"latestBankruptcy": {
197+
"date": "2014-09-18T23:18:33.000+0000",
198+
"chapter": 3,
199+
"reason": "string"
200+
}
201+
},
202+
"loan": {
203+
"numberOfMonthlyPayments": 3,
204+
"startDate": "2025-08-19T17:27:14.000+0000",
205+
"amount": 3,
206+
"loanToValue": 1.051732E+7
207+
},
208+
"validData": true,
209+
"insuranceRequired": true,
210+
"insuranceRate": 0.02,
211+
"approved": true,
212+
"messages": [],
213+
"yearlyInterestRate": 0.0,
214+
"monthlyRepayment": 0.0,
215+
"insurance": "2%",
216+
"message": "",
217+
"yearlyRepayment": 0.0
218+
},
219+
"__DecisionID__": "aa46362d-fa30-4331-b241-d1ff7e8ac4270"
220+
}
221+
```

0 commit comments

Comments
 (0)