Skip to content

Commit e55c623

Browse files
committed
feat: add watson
1 parent a4114fb commit e55c623

File tree

4 files changed

+109
-4
lines changed

4 files changed

+109
-4
lines changed

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1-
# stack-ibm-template
1+
# Retrievel Augmented Generation (RAG) stack
2+
3+
To run the full stack. These steps will be updated as development progresses on the stack and underlaying DAs.
4+
5+
## 1. Deploy the stack in a new project from catalog
6+
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
8+
9+
Click the "Add to project" button, and select create in new project.
10+
11+
## 2. Prereqs in target account
12+
13+
- Create an API key in the target account. Keep note of it. Give it admin privilege for now ( will be narrowed down in future version )
14+
- Create a resource group in the target account (this steps is temporary in current alpha version).
15+
16+
17+
## 3. Set the input configuration for the stack
18+
19+
- Clone this repository locally
20+
- Create a file with name ".def.json" with the following content. Ensure region is either us-south or eu-de (watsonx limitation for now)
21+
22+
```json
23+
{
24+
"inputs": {
25+
"prefix": "<prefix for resources name>",
26+
"ibmcloud_api_key": "<API Key of the target account with sufficient permissions>",
27+
"resource_group_name": "<target resource group - must be existing in account>",
28+
"region": "<region where resources are deployed>",
29+
"sample_app_git_url": "https://github.com/IBM/gen-ai-rag-watsonx-sample-application"
30+
}
31+
}```
32+
33+
Example:
34+
```json
35+
{
36+
"inputs": {
37+
"prefix": "0410",
38+
"ibmcloud_api_key": "<your api key>",
39+
"resource_group_name": "0411-stack-service-rg",
40+
"region": "eu-de",
41+
"sample_app_git_url": "https://github.com/IBM/gen-ai-rag-watsonx-sample-application"
42+
}
43+
}
44+
```
45+
46+
## 4. Get the configuration ids for each element of the stack
47+
48+
Run `ibmcloud project configs --project-id <project_id>`
49+
50+
Project id is the id of the project created in step 1. The id can be found under the Manage -> Details tab in the project.
51+
52+
Take note the id of each config.
53+
54+
## 5. Edit your local copy of deploy-many.sh
55+
56+
In deploy-many.sh:
57+
- Set PROJECT_ID to the id of the project
58+
- Add set the CONFIG_IDS to the array of configurations (ensuring ordering)
59+
CONFIG_IDS=("9618c574-4e0d-4e89-ac55-440717c8b378" "545c1a92-fa21-447f-96ed-fbefb7c50b35" "9aca1cae-36e3-4d1a-96fe-a4ddec057c01" "3eab3b42-f8d4-4532-b0d2-05ef2cc9c250" "b3dbe0de-1512-4351-b0f5-bb8ae8be4d4b")
60+
- Set STACK_CONFIG_ID to the id of the config corresponding to the stack
61+
62+
63+
## 6. Run ./deploy-many.sh
64+
65+
- Ensure you are login using ibmcloud login --sso
66+
- Execute ./deploy-many.sh
67+
68+

deploy-many.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ set -x
44

55

66

7-
PROJECT_ID="440acf2a-896f-4426-968b-581fb0eb83f4"
8-
CONFIG_IDS=("9618c574-4e0d-4e89-ac55-440717c8b378" "545c1a92-fa21-447f-96ed-fbefb7c50b35" "9aca1cae-36e3-4d1a-96fe-a4ddec057c01" "3eab3b42-f8d4-4532-b0d2-05ef2cc9c250" "b3dbe0de-1512-4351-b0f5-bb8ae8be4d4b")
9-
STACK_CONFIG_ID="abb2b55e-aa3f-42a9-9897-167cca2e5229"
7+
PROJECT_ID="8b78e0be-6f9c-4e08-8f16-99c83b03cbf0"
8+
CONFIG_IDS=("0dfabee9-b301-4117-85de-942ddbd8291f")
9+
STACK_CONFIG_ID="7fe3da83-b6d6-4c94-8f70-01b6ea557e80"
1010

1111
function set_stack_inputs() {
1212
ibmcloud project config-update --project-id $PROJECT_ID --id $STACK_CONFIG_ID --definition @.def.json

ibm_catalog.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@
3636
]
3737
},
3838
"iam_permissions": [
39+
{
40+
"service_name": "iam-identity",
41+
"resources": [
42+
{
43+
"name": "Placeholder - will be refined",
44+
"description": "Placeholder - will be refined",
45+
"role_crns": [
46+
"crn:v1:bluemix:public:iam::::role:Administrator"
47+
]
48+
}
49+
]
50+
}
3951
],
4052
"architecture": {
4153
"features": [

stack_definition.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,32 @@
161161
],
162162
"version_locator": "7df1e4ca-d54c-4fd0-82ce-3d13247308cd.fb52a84e-5ce4-4c5c-86ef-2adc4271107c"
163163
},
164+
{
165+
"inputs": [
166+
{
167+
"name": "ibmcloud_api_key",
168+
"value": "ref:../../inputs/ibmcloud_api_key"
169+
},
170+
{
171+
"name": "resource_group_name",
172+
"value": "ref:../../inputs/resource_group_name"
173+
},
174+
{
175+
"name": "location",
176+
"value": "ref:../../inputs/region"
177+
},
178+
{
179+
"name": "resource_prefix",
180+
"value": "ref:../../inputs/prefix"
181+
},
182+
{
183+
"name": "use_existing_resource_group",
184+
"value": true
185+
}
186+
],
187+
"name": "4 - WatsonX SaaS services",
188+
"version_locator": "8bfb1293-8b85-4d3f-a89f-015d0a0719df.89584910-8375-4c44-8c3b-65ddc553c3b2"
189+
},
164190
{
165191
"inputs": [
166192
{

0 commit comments

Comments
 (0)