You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-source/cloudbank/content/saga/_index.md
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,4 @@ title = "Manage Sagas"
4
4
weight = 5
5
5
+++
6
6
7
-
This module introduces the Saga pattern, a very important pattern that helps us
8
-
manage data consistency across microservices. We will explore the Long Running
9
-
Action specification, one implementation of the Saga pattern, and then build
10
-
a Transfer microservice that will manage funds transfers using a saga.
7
+
This module introduces the Saga pattern, a very important pattern that helps us manage data consistency across microservices. We will explore the Long Running Action specification, one implementation of the Saga pattern, and then build a Transfer microservice that will manage funds transfers using a saga.
Copy file name to clipboardExpand all lines: docs-source/cloudbank/content/saga/intro.md
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,6 @@ weight = 1
6
6
7
7
This module walks you through implementing the [Saga pattern](https://microservices.io/patterns/data/saga.html) using a [Long Running Action](https://download.eclipse.org/microprofile/microprofile-lra-1.0-M1/microprofile-lra-spec.html) to manage transactions across microservices.
8
8
9
-
Watch this short introduction video to get an idea of what you will be building: [](youtube:gk4BMX-KuaY)
10
-
11
9
Estimated Time: 30 minutes
12
10
13
11
Quick walk through on how to manage saga transactions across microservices.
Copy file name to clipboardExpand all lines: docs-source/cloudbank/content/springai/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,6 @@ title = "CloudBank AI Assistant"
4
4
weight = 6
5
5
+++
6
6
7
-
This modules introduces [Spring AI](https://github.com/spring-projects/spring-ai) and explores how it can be used to build a CloudBank AI Assistant (chatbot) that will allow users to interact with CloudBank using a chat-based interface.
7
+
This modules introduces [Spring AI](https://github.com/spring-projects/spring-ai) and explores how it can be used to build a CloudBank AI Assistant (chatbot) that will allow users to interact with CloudBank using a chat-based interface.
8
8
9
9
**Coming Soon:** We will be updating this module to help you learn about Retrieval Augmented Generation, Vector Database and AI Agents.
Copy file name to clipboardExpand all lines: docs-source/cloudbank/content/springai/simple-chat.md
+32-34Lines changed: 32 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ In this module, you will learn how to build a simple chatbot using Spring AI and
10
10
11
11
Oracle Backend for Microservices and AI provides an option during installation to provision a set of Kubernetes nodes with NVIDIA A10 GPUs that are suitable for running AI workloads. If you choose that option during installation, you may also specify how many nodes are provisioned. The GPU nodes will be in a separate Node Pool to the normal CPU nodes, which allows you to scale it independently of the CPU nodes. They are also labeled so that you can target appropriate workloads to them using node selectors and/or affinity rules.
12
12
13
-
To view a list of nodes in your cluster with a GPU, you can use this command:
13
+
To view a list of nodes in your cluster with a GPU, you can use this command:
14
14
15
15
```bash
16
16
$ kubectl get nodes -l 'node.kubernetes.io/instance-type=VM.GPU.A10.1'
@@ -40,34 +40,35 @@ To install Ollama on your GPU nodes, you can use the following commands:
40
40
helm repo update
41
41
```
42
42
43
-
1. Create a `ollama-values.yaml` file to configure how Ollama should be installed, including
44
-
which node(s) to run it on. Here is an example that will run Ollama on a GPU node
45
-
and will pull the `llama3` model.
43
+
1. Create a `ollama-values.yaml` file to configure how Ollama should be installed, including which node(s) to run it on. Here is an example that will run Ollama on a GPU node and will pull the `llama3` model.
46
44
47
45
```yaml
48
46
ollama:
49
-
gpu:
47
+
gpu:
50
48
enabled: true
51
-
type: 'nvidia'
49
+
type: nvidia
52
50
number: 1
53
-
models:
51
+
models:
52
+
pull:
54
53
- llama3
55
54
nodeSelector:
56
-
node.kubernetes.io/instance-type: VM.GPU.A10.1
55
+
node.kubernetes.io/instance-type: VM.GPU.A10.1
57
56
```
58
57
59
-
For more information on how to configure Ollama using the helm chart, refer to
For more information on how to configure Ollama using the helm chart, refer to [its documentation](https://artifacthub.io/packages/helm/ollama-helm/ollama).
61
59
62
-
>**Note:** If you are using an environment where no GPU is available, you can run this on a CPU by changing the `values.yaml` file to the following:
60
+
>**Note:** If you are using an environment where no GPU is available, you can run this on a CPU by changing the `ollama-values.yaml` file to the following:
63
61
64
62
```yaml
65
-
ollama:
66
-
gpu:
67
-
enabled: false
68
-
models:
69
-
- llama3
70
-
```
63
+
ollama:
64
+
gpu:
65
+
enabled: false
66
+
type: amd
67
+
number: 1
68
+
models:
69
+
pull:
70
+
- llama3
71
+
```
71
72
72
73
1. Create a namespace to deploy Ollama in:
73
74
@@ -80,23 +81,23 @@ To install Ollama on your GPU nodes, you can use the following commands:
1. You can verify the deployment with the following command:
84
86
85
87
```bash
86
88
kubectl get pods -n ollama -w
87
89
```
88
-
90
+
89
91
When the pod has the status `Running` the deployment is completed.
90
92
91
93
```text
92
94
NAME READY STATUS RESTARTS AGE
93
95
ollama-659c88c6b8-kmdb9 0/1 Running 0 84s
94
96
```
95
-
97
+
96
98
### Test your Ollama deployment
97
99
98
-
You can interact with Ollama using the provided command line tool, called `ollama`.
99
-
For example, to list the available models, use the `ollama ls` command:
100
+
You can interact with Ollama using the provided command line tool, called `ollama`. For example, to list the available models, use the `ollama ls` command:
100
101
101
102
```bash
102
103
kubectl -n ollama exec svc/ollama -- ollama ls
@@ -117,11 +118,9 @@ which provides a comprehensive platform for building enterprise-level applicatio
117
118
118
119
### Using LLMs hosted by Ollama in your Spring application
119
120
120
-
A Kubernetes service named 'ollama' with port 11434 will be created so that your
121
-
applications can talk to models hosted by Ollama.
121
+
A Kubernetes service named 'ollama' with port 11434 will be created so that your applications can talk to models hosted by Ollama.
122
122
123
-
Now, you will create a simple Spring AI application that uses Llama3 to
124
-
create a simple chatbot.
123
+
Now, you will create a simple Spring AI application that uses Llama3 to create a simple chatbot.
125
124
126
125
> **Note:** The sample code used in this module is available [here](https://github.com/oracle/microservices-datadriven/tree/main/cloudbank-v4/chatbot).
127
126
@@ -204,11 +203,11 @@ create a simple chatbot.
204
203
</project>
205
204
```
206
205
207
-
Note that this is very similar to the Maven POM files you have created in previous modules. [Spring AI](https://github.com/spring-projects/spring-ai) is currently approaching its 1.0.0 release, so you need to enable access to the milestone and snapshot repositories to use it. You will see the `repositories` section in the POM file above does that.
206
+
Note that this is very similar to the Maven POM files you have created in previous modules. [Spring AI](https://github.com/spring-projects/spring-ai) is currently approaching its 1.0.0 release, so you need to enable access to the milestone and snapshot repositories to use it. You will see the `repositories` section in the POM file above does that.
208
207
209
208
The `spring-ai-bom` was added in the `dependencyManagement` section to make it easy to select the correct versions of various dependencies.
210
209
211
-
Finally, a dependency for `spring-ai-ollama-spring-boot-starter` was added. This provides access to the Spring AI Ollama functionality and autoconfiguration.
210
+
Finally, a dependency for `spring-ai-ollama-spring-boot-starter` was added. This provides access to the Spring AI Ollama functionality and autoconfiguration.
212
211
213
212
1. Configure access to your Ollama deployment
214
213
@@ -228,9 +227,7 @@ create a simple chatbot.
228
227
model: llama3
229
228
```
230
229
231
-
Note that you are providing the URL to access the Ollama instance that you just
232
-
deployed in your cluster. You also need to tell Spring AI to enable chat and
233
-
which model to use.
230
+
Note that you are providing the URL to access the Ollama instance that you just deployed in your cluster. You also need to tell Spring AI to enable chat and which model to use.
234
231
235
232
1. Create the main Spring application class
236
233
@@ -315,7 +312,7 @@ create a simple chatbot.
315
312
316
313
1. Build a JAR file for deployment
317
314
318
-
Run the following command to build the JAR file (it will also remove any earlier builds).
315
+
Run the following command to build the JAR file (it will also remove any earlier builds).
319
316
320
317
```shell
321
318
$ mvn clean package
@@ -394,9 +391,9 @@ create a simple chatbot.
394
391
395
392
The simplest way to verify the application is to use a kubectl tunnel to access it.
@@ -413,4 +410,5 @@ The simplest way to verify the application is to use a kubectl tunnel to access
413
410
Spring Boot is an open-source Java-based framework that provides a simple and efficient way to build web applications, RESTful APIs, and microservices. It's built on top of the Spring Framework, but with a more streamlined and opinionated approach.
0 commit comments