Skip to content

Commit 5f8dcfd

Browse files
authored
Fix output + docs (#69)
* fix: fix output * fix: fix output * docs: update doc for rc * docs: improve readme.md
1 parent 3fc9b75 commit 5f8dcfd

20 files changed

+117
-91
lines changed

.secrets.baseline

Lines changed: 2 additions & 29 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-07T12:00:08Z",
6+
"generated_at": "2024-05-08T11:42:40Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -76,34 +76,7 @@
7676
"name": "TwilioKeyDetector"
7777
}
7878
],
79-
"results": {
80-
"README.md": [
81-
{
82-
"hashed_secret": "bbc4e9d52252171a3a306be55086c65b126189e8",
83-
"is_secret": false,
84-
"is_verified": false,
85-
"line_number": 38,
86-
"type": "Secret Keyword",
87-
"verified_result": null
88-
},
89-
{
90-
"hashed_secret": "d9e9019d9eb455a3d72a3bc252c26927bb148a10",
91-
"is_secret": false,
92-
"is_verified": false,
93-
"line_number": 55,
94-
"type": "Secret Keyword",
95-
"verified_result": null
96-
},
97-
{
98-
"hashed_secret": "b13d7622394e85c3b2694f426bc096b093764462",
99-
"is_secret": false,
100-
"is_verified": false,
101-
"line_number": 59,
102-
"type": "Secret Keyword",
103-
"verified_result": null
104-
}
105-
]
106-
},
79+
"results": {},
10780
"version": "0.13.1+ibm.62.dss",
10881
"word_list": {
10982
"file": null,

README.md

Lines changed: 91 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,121 @@
11
# Retrieval Augmented Generation Pattern for Watsonx on IBM Cloud
22

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).
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 IBM Cloud 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).
4+
5+
This deployable architecture provides a comprehensive foundation for trust, observability, security, and regulatory compliance by configuring the IBM Cloud account to align with compliance settings, deploying key and secret management services, and deploying the infrastructure to support CI/CD/CC pipelines for secure application lifecycle management. These pipelines facilitate the deployment of the application, vulnerability checks, and auditability, ensuring a secure and trustworthy deployment of Generative AI applications on IBM Cloud.
6+
7+
# Objective and Benefits
8+
9+
This deployable architecture is designed to showcase a fully automated deployment of a retrieval augmented generation application through IBM Cloud Project, providing a flexible and customizable foundation for your own Watson-based application deployments on IBM Cloud. This architecture deploys the following [sample application](https://github.com/IBM/gen-ai-rag-watsonx-sample-application) by default.
10+
11+
By leveraging this architecture, you can accelerate your deployment and tailor it to meet your unique business needs and enterprise goals.
12+
13+
By using this architecture, you can:
14+
15+
* Establish Trust: The architecture ensures trust by configuring the IBM Cloud account to align with compliance settings as defined in the [Financial Services](https://cloud.ibm.com/docs/framework-financial-services?topic=framework-financial-services-about) framework.
16+
* Ensure Observability: The architecture provides observability by deploying services such as IBM Log Analysis, IBM Monitoring, IBM Activity Tracker, and log retention through Cloud Object Storage buckets.
17+
* Implement Security: The architecture ensures security by deploying IBM Key Protect and IBM Secrets Manager.
18+
* Achieve Regulatory Compliance: The architecture ensures regulatory compliance by implementing CI/CD/CC pipelines, along with IBM Security Compliance Center (SCC) for secure application lifecycle management.
19+
420

521
# Deployment Details
622

7-
To run the full stack, follow these steps. These steps will be updated as development progresses on the stack and underlying deployable architectures.
23+
To deploy this architecture, follow these steps.
24+
25+
## 1. Prerequisites in Target Account
826

9-
## 1. Deploy the Stack in a New Project from Catalog
27+
Before deploying the deployable architecture, ensure you have:
1028

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
29+
* Created an API key in the target account with sufficient permissions. See [instructions](https://cloud.ibm.com/docs/account?topic=account-userapikey&interface=ui) Note the API key, as it will be used later. On evaluation environments, you may simply grant `Administrator` role on `IAM Identity Service`, `All Identity and Access enabled services` and `All Account Management` services. If you need to narrow down further access, for a production environment for instance, the minimum level of permissions is indicated in the [Permission tab](https://cloud.ibm.com/catalog/7df1e4ca-d54c-4fd0-82ce-3d13247308cd/architecture/Retrieval_Augmented_Generation_Pattern-5fdd0045-30fc-4013-a8bc-6db9d5447a52?kind=terraform&format=stack&version=32db3936-66fe-4b04-bbc8-61d5676a89f1#permissions) of the deployable architecture.
30+
* A signing key, which is the base64 key obtained from `gpg --gen-key` (if not generated before or expired) and then exported via `gpg --export-secret-key <Email Address> | base64` command. See the [devsecops image signing page](https://cloud.ibm.com/docs/devsecops?topic=devsecops-devsecops-image-signing#cd-devsecops-gpg-export) for details. Key note of the key for later.
31+
* (Optional) 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).
1232

13-
Click the "Add to Project" button and select "Create in new project."
33+
## 2. Deploy the Stack in a New Project from Catalog
1434

15-
## 2. Prerequisites in Target Account
35+
* Locate the [tile](https://cloud.ibm.com/catalog/7df1e4ca-d54c-4fd0-82ce-3d13247308cd/architecture/Retrieval_Augmented_Generation_Pattern-5fdd0045-30fc-4013-a8bc-6db9d5447a52) for the Deployable Architecture in the IBM Cloud Catalog.
36+
* Click the "Add to project" button.
1637

17-
Before deploying the stack, ensure you have:
38+
![image](./images/min/1-catalog.png)
1839

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
40+
* Select "Create new" and input IBM Cloud Project details.
41+
- Name and description. eg: "Retrieval Augmented Generation Pattern"
42+
- Region and resource group for the project. Note that this is the region and resource group where the runtime (IBM Cloud Schematics) executiong the automation code is located. You can still deploy the resources to any region, any resource group, and any account.
43+
- Configuration name - for example: "dev" or "prod".
44+
45+
![project](./images/min/2-project.png)
46+
47+
* Click "Add" to complete.
2148

2249
## 3. Set the Input Configuration for the Stack
2350

24-
* Clone this repository locally.
25-
* Create a file named ".def.json" with the following content:
26-
27-
**Important**:
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 `gpg --gen-key` (if not generated before or expired) and then exported via `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.
33-
34-
```json
35-
{
36-
"inputs": {
37-
"prefix": "<prefix for resources name - ensure unique>",
38-
"ibmcloud_api_key": "<API Key of the target account with sufficient permissions>",
39-
"resource_group_name": "<target resource group - name of a new resource group that the stack will create>",
40-
"region": "<region where all resources are deployed>",
41-
"sample_app_git_url": "https://github.com/IBM/gen-ai-rag-watsonx-sample-application",
42-
"watsonx_admin_api_key": "<optional - admin key to use for Watsonx if different from ibmcloud_api_key>",
43-
"signing_key": "signing key used to sign build artifacts",
44-
"existing_secrets_manager_crn": "<optional> - reuse an existing secret manager instance",
45-
"enable_platform_logs_metrics": "<optional> - set to true to enable observability instance to capture regional logs"
46-
}
47-
}
48-
```
51+
After completing `Step 2 - Deploy the Stack in a New Project from Catalog`, you are directed to a page allowing you to enter the configuration for you deployment:
52+
* Under Security -> Authentication, enter the API Key from the prereqs in the `api_key` field.
53+
* Under Requires, input the signing key in the `signing_key` field.
4954

50-
Example:
51-
```json
52-
{
53-
"inputs": {
54-
"prefix": "0418",
55-
"ibmcloud_api_key": "<your api key>",
56-
"resource_group_name": "stack-service-rg",
57-
"region": "eu-de",
58-
"sample_app_git_url": "https://github.com/IBM/gen-ai-rag-watsonx-sample-application",
59-
"watsonx_admin_api_key": "<optional - admin key to use for Watsonx if different from ibmcloud_api_key>",
60-
"signing_key": "signing key used to sign build artifacts",
61-
"enable_platform_logs_metrics": "false",
62-
"existing_secrets_manager_crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/190c293e9fda4c6684b5acf4b17871b8:14580411-4fa2-42d3-af3f-ab7fc6371b6d::"
63-
}
64-
}
65-
```
55+
You may explore the other available inputs, such as the region and resource group name (under optional tab), leave them as is, or modify them as needed.
56+
57+
![inputs](./images/min/3-inputs.png)
58+
59+
Once ready, click the "Save" button at the top of the screen.
60+
61+
## 4. Deploy the Architecture
62+
63+
Navigate to the project deployment view by clicking the project name in the breadcrumb menu.
6664

65+
![menu](./images/min/4-bread.png)
6766

68-
## 4. Run ./deploy-many.sh
6967

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 (name of the configuration given when deploying the tile), 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.
68+
You should be directed to a screen looking like:
7269

73-
Example 1 - Update stack inputs for stack configuration `RAG` and process all non-stack configurations in the project:
70+
![validate](./images/min/5-validate.png)
71+
72+
Two approaches to deploy the architecture:
73+
1. Through the UI - note that using the UI requires a large number of clicks each elements on the architecture stack.
74+
2. Automated - se the script `./deploy-many.sh` is provided.
75+
76+
### Approach 1: Deployment through the UI
77+
78+
1. Click on validate
79+
80+
![validate button](./images/min/5b-validate.png)
81+
82+
2. Wait for validation
83+
84+
![validation](./images/min/6-validation.png)
85+
86+
3. Approve and click the deploy button
87+
88+
![deploy](./images/min/7-deploy.png)
89+
90+
4. Wait for deployment
91+
92+
5. Repeat step 1 for the next configuration in the architecture.
93+
94+
### Approach 2: Run ./deploy-many.sh
95+
96+
* Clone the repository at https://github.com/terraform-ibm-modules/stack-retrieval-augmented-generation/tree/main
97+
* Ensure you are logged in to the account containing the Cloud project with the stack using `ibmcloud login`.
98+
* 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.
99+
100+
Example 1 - Update stack inputs for stack configuration `dev` and process all non-stack configurations in the project:
74101
```bash
75-
./deploy-many.sh my-test-project RAG
102+
./deploy-many.sh my-test-project dev
76103
```
77104

78105
Example 2 - Update stack inputs and process some configurations in the project:
79106
```bash
80-
./deploy-many.sh my-test-project RAG 'RAG-1|RAG-4|RAG-5'
107+
./deploy-many.sh my-test-project dev 'RAG-1|RAG-4|RAG-5'
81108
```
82109

83110
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):
84111
```bash
85-
DRY_RUN=true ./deploy-many.sh my-test-project RAG 'RAG-1|RAG-4|RAG-5'
112+
DRY_RUN=true ./deploy-many.sh my-test-project dev 'RAG-1|RAG-4|RAG-5'
86113
```
87114

88-
Tips: If deployment fail in one of the DA, you may re-run the script as is. It will skip existing installed configuration.
115+
Tips: If deployment fail for one of the configuration, you may re-run the script as is. It will skip existing installed configurations and continue where it last failed.
116+
117+
## 5. Post deployment steps
118+
119+
At this point, all of the infrastructure is deployed in the target account. The initial build for the sample app has also started in the DevOps service, and the app is deployed to IBM Cloud Code Engine.
120+
121+
There are some remaining steps, specific to the sample app, that can be completed to fully enable Watson assistant in the app. To complete the installation - follow the steps at https://github.com/IBM/gen-ai-rag-watsonx-sample-application/blob/main/artifacts/artifacts-README.md

ibm_catalog.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,24 @@
104104
"architecture": {
105105
"features": [
106106
{
107-
"title": "Deploy a banking retrieval augmented generation (RAG) app to IBM Cloud Code Engine using Continous Delivery.",
108-
"description": ""
107+
"title": "Retrieval Augmented Generation sample pattern.",
108+
"description": "Deploy a banking retrieval augmented generation (RAG) sample application to IBM Cloud Code Engine using Continous Delivery."
109+
},
110+
{
111+
"title": "Ensure Observability",
112+
"description": "The architecture provides observability by deploying services such as IBM Log Analysis, IBM Monitoring, IBM Activity Tracker, and log retention through Cloud Object Storage buckets."
113+
},
114+
{
115+
"title": "Implement Security",
116+
"description": "The architecture ensures security by deploying IBM Key Protect and IBM Secrets Manager."
117+
},
118+
{
119+
"title": "Achieve Regulatory Compliance",
120+
"description": "The architecture ensures regulatory compliance by implementing CI/CD/CC pipelines, along with IBM Security Compliance Center (SCC) for secure application lifecycle management."
121+
},
122+
{
123+
"title": "Establish Trust",
124+
"description": "The architecture ensures trust by configuring the IBM Cloud account to align with compliance settings as defined in the Financial Services framework."
109125
}
110126
],
111127
"diagrams": [

images/1-catalog.png

95.8 KB
Loading

images/2-project.png

21.8 KB
Loading

images/3-inputs.png

76.8 KB
Loading

images/4-bread.png

19.7 KB
Loading

images/5-validate.png

54.9 KB
Loading

images/5b-validate.png

46.3 KB
Loading

images/6-validation.png

17.8 KB
Loading

0 commit comments

Comments
 (0)