Skip to content

Commit 4b9a290

Browse files
authored
Merge pull request #66 from terraform-ibm-modules/0.0.12
0.0.12
2 parents 1c97bbb + 4394a84 commit 4b9a290

File tree

6 files changed

+82
-66
lines changed

6 files changed

+82
-66
lines changed

.secrets.baseline

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2024-05-07T10:25:46Z",
6+
"generated_at": "2024-05-07T12:00:08Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -82,23 +82,23 @@
8282
"hashed_secret": "bbc4e9d52252171a3a306be55086c65b126189e8",
8383
"is_secret": false,
8484
"is_verified": false,
85-
"line_number": 35,
85+
"line_number": 38,
8686
"type": "Secret Keyword",
8787
"verified_result": null
8888
},
8989
{
9090
"hashed_secret": "d9e9019d9eb455a3d72a3bc252c26927bb148a10",
9191
"is_secret": false,
9292
"is_verified": false,
93-
"line_number": 52,
93+
"line_number": 55,
9494
"type": "Secret Keyword",
9595
"verified_result": null
9696
},
9797
{
9898
"hashed_secret": "b13d7622394e85c3b2694f426bc096b093764462",
9999
"is_secret": false,
100100
"is_verified": false,
101-
"line_number": 56,
101+
"line_number": 59,
102102
"type": "Secret Keyword",
103103
"verified_result": null
104104
}

README.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
1-
# Retrieval Augmented Generation (RAG) stack
1+
# Retrieval Augmented Generation Pattern for Watsonx on IBM Cloud
22

3-
To run the full stack, follow these steps. These steps will be updated as development progresses on the stack and underlying DAs.
3+
The following [deployable architecture](https://cloud.ibm.com/docs/secure-enterprise?topic=secure-enterprise-understand-module-da#what-is-da) automates the deployment of a sample GenAI Pattern on IBM Cloud, including all underlying infrastructure. This architecture implements the best practices for Watsonx GenAI Pattern deployment on IBM Cloud, as described in the [reference architecture](https://cloud.ibm.com/docs/pattern-genai-rag?topic=pattern-genai-rag-genai-pattern).
44

5-
## 1. Deploy the stack in a new project from catalog
5+
# Deployment Details
66

7-
Catalog url: https://cloud.ibm.com/catalog/7df1e4ca-d54c-4fd0-82ce-3d13247308cd/architecture/Retrieval_Augmented_Generation_Pattern-5fdd0045-30fc-4013-a8bc-6db9d5447a52?bss_account=9f9af00a96104f49b6509aa715f9d6a5
7+
To run the full stack, follow these steps. These steps will be updated as development progresses on the stack and underlying deployable architectures.
88

9-
Click the "Add to project" button, and select create in new project.
9+
## 1. Deploy the Stack in a New Project from Catalog
1010

11-
## 2. Prereqs in target account
11+
Catalog URL: https://cloud.ibm.com/catalog/7df1e4ca-d54c-4fd0-82ce-3d13247308cd/architecture/Retrieval_Augmented_Generation_Pattern-5fdd0045-30fc-4013-a8bc-6db9d5447a52?bss_account=9f9af00a96104f49b6509aa715f9d6a5
12+
13+
Click the "Add to Project" button and select "Create in new project."
14+
15+
## 2. Prerequisites in Target Account
1216

1317
Before deploying the stack, ensure you have:
14-
- Created an API key in the target account with sufficient permissions. Note the API key, as it will be used later.
15-
- For now, grant it admin privileges. The exact permissions required will be refined in future versions.
16-
- Install the IBM Cloud CLI's Project addon using `ibmcloud plugin install project` command. More info here: https://cloud.ibm.com/docs/cli?topic=cli-projects-cli
1718

19+
* Created an API key in the target account with sufficient permissions. Note the API key, as it will be used later. For now, grant it admin privileges. The exact permissions required will be refined in future versions.
20+
* Installed the IBM Cloud CLI's Project add-on using the `ibmcloud plugin install project` command. More information is available here: https://cloud.ibm.com/docs/cli?topic=cli-projects-cli
1821

19-
## 3. Set the input configuration for the stack
22+
## 3. Set the Input Configuration for the Stack
2023

21-
- Clone this repository locally.
22-
- Create a file with name ".def.json" with the following content.
24+
* Clone this repository locally.
25+
* Create a file named ".def.json" with the following content:
2326

2427
**Important**:
25-
- Ensure region is either us-south or eu-de as watsonx can only be deployed in those 2 locations for now.
26-
- Ensure that the prefix is globally unique. It is used for the container registry namespace (which needs to be globally unique) in this alpha version.
27-
- The signing key is the base64 key obtained from the `gpg --export-secret-key <Email Address> | base64` command. See https://cloud.ibm.com/docs/devsecops?topic=devsecops-devsecops-image-signing#cd-devsecops-gpg-export for details.
28-
- If specifying `existing_secrets_manager_crn`, the ibmcloud_api_key that is passed as an input must have the documented read and write access to the instance
29-
- If specifying `existing_secrets_manager_crn`, ensure that the default security group does not contain secrets named `signing-key` and `ibmcloud-api-key` . The RAG DA currently always attempt to create secret with those names (temporary issue - to be fixed).
28+
* Ensure the region is either us-south or eu-de, as Watsonx can only be deployed in those two locations for now.
29+
* Ensure that the prefix is globally unique. It is used for the container registry namespace (which needs to be globally unique) in this alpha version.
30+
* If specifying `existing_secrets_manager_crn`, the `ibmcloud_api_key` that is passed as an input must have the documented read and write access to the instance.
31+
* If specifying `existing_secrets_manager_crn`, ensure that the default security group does not contain secrets named `signing-key` and `ibmcloud-api-key`. The RAG DA currently always attempts to create a secret with those names (temporary issue - to be fixed).
32+
* The signing key is the base64 key obtained from the `gpg --export-secret-key <Email Address> | base64` command. See https://cloud.ibm.com/docs/devsecops?topic=devsecops-devsecops-image-signing#cd-devsecops-gpg-export for details.
3033

3134
```json
3235
{
3336
"inputs": {
3437
"prefix": "<prefix for resources name - ensure unique>",
3538
"ibmcloud_api_key": "<API Key of the target account with sufficient permissions>",
36-
"resource_group_name": "<target resource group - name of a new resource group that the stack will creates>",
39+
"resource_group_name": "<target resource group - name of a new resource group that the stack will create>",
3740
"region": "<region where all resources are deployed>",
3841
"sample_app_git_url": "https://github.com/IBM/gen-ai-rag-watsonx-sample-application",
39-
"watsonx_admin_api_key": "<optional - admin key to use for watson if different from ibmcloud_api_key>",
42+
"watsonx_admin_api_key": "<optional - admin key to use for Watsonx if different from ibmcloud_api_key>",
4043
"signing_key": "signing key used to sign build artifacts",
4144
"existing_secrets_manager_crn": "<optional> - reuse an existing secret manager instance",
4245
"enable_platform_logs_metrics": "<optional> - set to true to enable observability instance to capture regional logs"
@@ -53,7 +56,7 @@ Example:
5356
"resource_group_name": "stack-service-rg",
5457
"region": "eu-de",
5558
"sample_app_git_url": "https://github.com/IBM/gen-ai-rag-watsonx-sample-application",
56-
"watsonx_admin_api_key": "<optional - admin key to use for watson if different from ibmcloud_api_key>",
59+
"watsonx_admin_api_key": "<optional - admin key to use for Watsonx if different from ibmcloud_api_key>",
5760
"signing_key": "signing key used to sign build artifacts",
5861
"enable_platform_logs_metrics": "false",
5962
"existing_secrets_manager_crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/190c293e9fda4c6684b5acf4b17871b8:14580411-4fa2-42d3-af3f-ab7fc6371b6d::"
@@ -64,20 +67,20 @@ Example:
6467

6568
## 4. Run ./deploy-many.sh
6669

67-
- Ensure you are login into the account containing the Cloud project with the stack using ibmcloud login --sso
68-
- Execute ./deploy-many.sh with project name, stack name and optional configuration name pattern. The selected non-stack configruations will be processed by their name in alphabetical order. Using configuration name pattern (regex can be used - make sure to enclose it in quotes) you can chose which configurations are deployed
70+
* Ensure you are logged in to the account containing the Cloud project with the stack using `ibmcloud login --sso`.
71+
* Execute `./deploy-many.sh` with the project name, stack name, and optional configuration name pattern. The selected non-stack configurations will be processed by their name in alphabetical order. Using the configuration name pattern (regex can be used - make sure to enclose it in quotes), you can choose which configurations are deployed.
6972

70-
Example 1 - update stack inputs for stack configuration `RAG` and process all non-stack configurations in the project:
73+
Example 1 - Update stack inputs for stack configuration `RAG` and process all non-stack configurations in the project:
7174
```bash
7275
./deploy-many.sh my-test-project RAG
7376
```
7477

75-
Example 2 - update stack inputs and process some configurations in the project:
78+
Example 2 - Update stack inputs and process some configurations in the project:
7679
```bash
7780
./deploy-many.sh my-test-project RAG 'RAG-1|RAG-4|RAG-5'
7881
```
7982

80-
Example 3 - simulate updating stack inputs and validating some configurations in the project in dry-run mode (no changes or actual validation or deployments is done):
83+
Example 3 - Simulate updating stack inputs and validating some configurations in the project in dry-run mode (no changes or actual validation or deployments are done):
8184
```bash
8285
DRY_RUN=true ./deploy-many.sh my-test-project RAG 'RAG-1|RAG-4|RAG-5'
8386
```

common-dev-assets

ibm_catalog.json

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"watson",
1515
"ai"
1616
],
17-
"short_description": "An automated solution that deploys a sample application illustrating how to implement the RAG Pattern with watsonx.ai and IBM Cloud services.",
17+
"short_description": "An automated solution that deploys a sample application illustrating how to implement the RAG Pattern with watson.ai and IBM Cloud services.",
1818
"offering_icon_url": "https://globalcatalog.cloud.ibm.com/api/v1/1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc/artifacts/solution.svg",
1919
"flavors": [
2020
{
@@ -104,7 +104,7 @@
104104
"architecture": {
105105
"features": [
106106
{
107-
"title": "Deploy a customer care generative AI app to Code Engine using Continous Delivery",
107+
"title": "Deploy a banking retrieval augmented generation (RAG) app to IBM Cloud Code Engine using Continous Delivery.",
108108
"description": ""
109109
}
110110
],
@@ -133,30 +133,28 @@
133133
{
134134
"key": "prefix",
135135
"type": "string",
136-
"default_value": "rag",
137-
"description": "A prefix added to the name of all resources created by this solution. Used to avoid name clashes in the target account.",
136+
"default_value": "sample",
137+
"description": "A prefix added to the name of all resources created by this solution. Used to avoid name clashes in the target account when existing this solution multiple times.",
138138
"required": true
139139
},
140-
{
141-
"key": "enable_platform_logs_metrics",
142-
"type": "boolean",
143-
"default_value": false,
144-
"description": "Whether to provision logging and monitoring instances are configured to receive all platform logs and metrics in the target region. There can only be one instance per region provisioned for platform logs/metrics.",
145-
"required": false
146-
},
147-
{
148-
"key": "existing_secrets_manager_crn",
149-
"type": "string",
150-
"default_value": "__NULL__",
151-
"description": "The CRN of an existing secret manager instance to use in this solution. If not set, a new secret manager instance is provisioned. ",
152-
"required": false
153-
},
154140
{
155141
"key": "ibmcloud_api_key",
156142
"type": "password",
157143
"description": "The API Key used to provision all resources created in this solution.",
158144
"required": true
159145
},
146+
{
147+
"key": "signing_key",
148+
"type": "password",
149+
"description": "The key used to sign the application image built by the CI pipeline deployed in this solution. Please refer to the documentation for details on generating the key.",
150+
"display_name": "Multiline secure value",
151+
"required": true,
152+
"custom_config": {
153+
"type": "multiline_secure_value",
154+
"grouping": "deployment",
155+
"original_grouping": "deployment"
156+
}
157+
},
160158
{
161159
"key": "region",
162160
"type": "string",
@@ -177,15 +175,14 @@
177175
{
178176
"key": "resource_group_name",
179177
"type": "string",
180-
"default_value": "rag-services-rc",
178+
"default_value": "rag-services",
181179
"description": "The name of the resource group that is created by this solution. The actual name is prefixed with the value of the input 'prefix'. All resources created by this solution are deployed in this resource group. ",
182180
"required": false
183181
},
184182
{
185-
"key": "sample_app_git_url",
186-
"type": "string",
187-
"default_value": "https://github.com/IBM/gen-ai-rag-watsonx-sample-application",
188-
"description": "The URL to the public git repository containing the sample rag application code.",
183+
"key": "watsonx_admin_api_key",
184+
"type": "password",
185+
"description": "The API Key used to provision the watson project resources. If not set, the ibmcloud_api_key is used.",
189186
"required": false
190187
},
191188
{
@@ -206,15 +203,24 @@
206203
]
207204
},
208205
{
209-
"key": "signing_key",
210-
"type": "password",
211-
"description": "The key used to sign the application image built by the CI pipeline deployed in this solution.",
206+
"key": "enable_platform_logs_metrics",
207+
"type": "boolean",
208+
"default_value": false,
209+
"description": "Whether to provision logging and monitoring instances are configured to receive all platform logs and metrics in the target region. There can only be one instance per region provisioned for platform logs/metrics.",
212210
"required": false
213211
},
214212
{
215-
"key": "watsonx_admin_api_key",
216-
"type": "password",
217-
"description": "The API Key used to provision the watson project resources. If not set, the ibmcloud_api_key is used.",
213+
"key": "existing_secrets_manager_crn",
214+
"type": "string",
215+
"default_value": "__NULL__",
216+
"description": "The CRN of an existing secret manager instance to use in this solution. If not set, a new secret manager instance is provisioned. ",
217+
"required": false
218+
},
219+
{
220+
"key": "sample_app_git_url",
221+
"type": "string",
222+
"default_value": "https://github.com/IBM/gen-ai-rag-watsonx-sample-application",
223+
"description": "The URL to the public git repository containing the sample rag application code.",
218224
"required": false
219225
}
220226
],

stack_definition.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@
5555
},
5656
{
5757
"name": "signing_key",
58-
"required": false,
58+
"required": true,
5959
"type": "password",
60-
"hidden": false,
61-
"default": "replace"
60+
"hidden": false
6261
},
6362
{
6463
"name": "existing_secrets_manager_crn",
@@ -138,6 +137,10 @@
138137
"name": "ibmcloud_api_key",
139138
"value": "ref:../../inputs/ibmcloud_api_key"
140139
},
140+
{
141+
"name": "region",
142+
"value": "ref:../../inputs/region"
143+
},
141144
{
142145
"name": "region",
143146
"value": "ref:../../inputs/region"
@@ -175,6 +178,10 @@
175178
{
176179
"name": "existing_secrets_manager_crn",
177180
"value": "ref:../../inputs/existing_secrets_manager_crn"
181+
},
182+
{
183+
"name": "service_plan",
184+
"value": "ref:../../inputs/secret_manager_service_plan"
178185
}
179186
]
180187
},
@@ -214,7 +221,7 @@
214221
},
215222
{
216223
"name": "3 - Observability - Logging Monitoring Activity Tracker",
217-
"version_locator": "7df1e4ca-d54c-4fd0-82ce-3d13247308cd.58843031-95a7-4e8e-9abc-13c478a8bd16",
224+
"version_locator": "7df1e4ca-d54c-4fd0-82ce-3d13247308cd.3ae7c6ae-20c2-4214-b3b9-7110356b4b6c",
218225
"inputs": [
219226
{
220227
"name": "ibmcloud_api_key",
@@ -252,7 +259,7 @@
252259
},
253260
{
254261
"name": "4 - WatsonX SaaS services",
255-
"version_locator": "8bfb1293-8b85-4d3f-a89f-015d0a0719df.02313717-33ba-43cd-8a6d-c661c0538cf3",
262+
"version_locator": "8bfb1293-8b85-4d3f-a89f-015d0a0719df.3b21f2da-e498-4c35-bac2-47d25c7cfa55",
256263
"inputs": [
257264
{
258265
"name": "ibmcloud_api_key",
@@ -314,7 +321,7 @@
314321
},
315322
{
316323
"name": "toolchain_name",
317-
"value": "Generative AI Sample App"
324+
"value": "RAG Sample App"
318325
},
319326
{
320327
"name": "toolchain_region",

tests/pr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestProjectsFullTest(t *testing.T) {
1919
"2c - Security Service - Security Compliance Center",
2020
"3 - Observability - Logging Monitoring Activity Tracker",
2121
"4 - WatsonX SaaS services",
22-
"5 - Generative AI Sample App - Code Engine Toolchain Config",
22+
"5 - RAG Sample App - Code Engine Toolchain Config",
2323
"6 - Sample RAG app configuration",
2424
},
2525
})

0 commit comments

Comments
 (0)