Skip to content

Commit 71dbdbf

Browse files
committed
Merge branch 'main' into 185-langchain-mcp-export
2 parents e729a73 + 880b13c commit 71dbdbf

36 files changed

+392
-48
lines changed

.github/workflows/pytest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- opened
88
- synchronize
99
- reopened
10+
- ready_for_review
1011

1112
# Allows running this workflow manually
1213
workflow_dispatch:

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,14 @@ To run the application in a container; download the [source](https://github.com/
8585
1. [Configure](https://oracle-samples.github.io/ai-optimizer/client/configuration/index.html) the **AI Optimizer**.
8686

8787
#### Got OCI?
88-
The **AI Optimizer** can be deployed with an Oracle Autonomous Database 23ai using infrastructure as code. Deploy the **AI Optimizer** in Oracle Cloud Infrastructure using OCI Resource Manager:
8988

89+
The **AI Optimizer** can be deployed in Oracle Cloud Infrastructure (OCI) using Infrastructure as Code (IaC).
90+
91+
Choose either a light-weight Virtual Machine or robust Oracle Kubernetes Engine deployment, both with an Oracle Autonomous Database 23ai:
9092
[![Deploy to Oracle Cloud][magic_button]][magic_arch_stack]
9193

94+
For more information, please visit the [IaC Documentation](https://oracle-samples.github.io/ai-optimizer/advanced/iac/index.html).
95+
9296
## Contributing
9397

9498
This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md).

docs/content/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The [Walkthrough](walkthrough) is a great way to familiarize yourself with the *
5151

5252
### Bare-Metal Installation
5353

54-
To run the application on bare-metal; download the [source]({{ .Site.Params.GitHubRepo }}) and from the `src/` directory:
54+
To run the application on bare-metal; download the source code from the {{< latest_release >}} and from the `src/` directory:
5555

5656
1. Create and activate a Python Virtual Environment:
5757

@@ -84,7 +84,7 @@ To run the application on bare-metal; download the [source]({{ .Site.Params.GitH
8484
References to `podman` commands, if applicable to your environment, can be substituted with `docker`.
8585
{{% /notice %}}
8686

87-
To run the application in a container; download the [source]({{ .Site.Params.GitHubRepo }}) and from the top-level directory:
87+
To run the application in a container; download the source code from the {{< latest_release >}} and from the top-level directory:
8888

8989
1. Build the image.
9090

docs/content/advanced/iac.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
+++
2+
title = 'Infrastructure as Code'
3+
weight = 1
4+
+++
5+
6+
<!--
7+
Copyright (c) 2024, 2025, Oracle and/or its affiliates.
8+
Licensed under the Universal Permissive License v1.0 as shown at http://oss.oracle.com/licenses/upl.
9+
10+
spell-checker: ignore opentofu Ollama
11+
-->
12+
13+
The {{< full_app_ref >}} can easily be deployed in Oracle Cloud Infrastructure (**OCI**) using Infrastructure as Code (**IaC**) provided in the source [opentofu](https://github.com/oracle-samples/ai-optimizer/tree/main/opentofu) directory.
14+
15+
Choose between deploying a light-weight [Virtual Machine](#virtual-machine) or robust [Oracle Kubernetes Engine (**OKE**)](#oracle-kubernetes-engine) along with the Oracle Autonomous Database for a fully configured {{< short_app_ref >}} environment, ready to use.
16+
17+
While the **IaC** can be run from a command-line with prior experience, the steps outlined here use [Oracle Cloud Resource Manager](https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/resourcemanager.htm) to simplify the process. To get started:
18+
19+
{{< imagelink url="https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle-samples/ai-optimizer/releases/latest/download/ai-optimizer-stack.zip" src="https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg" alt="Deploy to Oracle Cloud" >}}
20+
21+
## Virtual Machine
22+
23+
The Virtual Machine (VM) deployment provisions both the {{< short_app_ref >}} API Server and GUI Client together in an "All-in-One" configuration for experimentation and development. As part of the deployment, one local Large Language Model and one Embedding Model is made available out-of-the-box. However, as these models will be running on a CPU VM, their performance will be very poor.
24+
25+
### Configure Variables
26+
27+
After clicking the "Deploy to Oracle Cloud" button and authenticating to your tenancy; you will be presented with the {{< short_app_ref >}} stack information.
28+
29+
1. Review the Terms, tick the box to accept (if you do), and click "Next" to Configure Variables
30+
31+
![Stack Information](../images/iac_stack_information.png)
32+
33+
1. Change the Infrastructure to "VM"
34+
35+
![Stack - AI Optimizer](../images/iac_stack_optimizer.png)
36+
37+
#### Access Control
38+
39+
Most of the other configuration options are self-explanatory, but let's highlight those important for the **Security** of your deployment.
40+
41+
* The {{< short_app_ref >}} is often configured with authentication details for your OCI Tenancy, Autonomous Database, and API Keys for AI Models. Since these details are accessible via the Application GUI, access must be restricted to a limited set of CIDR blocks.
42+
43+
* The {{< short_app_ref >}} REST endpoints require API token authentication, providing some protection. However, you should still restrict access to a limited set of CIDR blocks where possible for added security.
44+
45+
* The Oracle Autonomous Database requires mTLS authentication with a wallet, providing strong initial protection. However, it's recommended to further restrict access to a limited set of CIDR blocks.
46+
47+
![Stack - Access Control](../images/iac_stack_access_control.png)
48+
49+
To restrict access, provide a comma-separated list of CIDR blocks, for example: `192.168.1.0/24,10.0.0.0/16,203.0.113.42/32`
50+
51+
In this example:
52+
* `192.168.1.0/24` – Allows access from all IPs in the range 192.168.1.0 to 192.168.1.255 (a typical subnet).
53+
* `10.0.0.0/16` – Allows access from 10.0.0.0 to 10.0.255.255 (a broader range).
54+
* `203.0.113.42/32` – Allows access from a single public IP address only. The /32 denotes a single host.
55+
56+
### Review and Apply
57+
58+
After configuring the variables, click "Next" to review and apply the stack.
59+
60+
![Stack - Review and Apply](../images/iac_stack_review_apply.png)
61+
62+
Tick the Apply box and click "Create".
63+
64+
### Job Details
65+
66+
The next screen will show the progress of the Apply job. Once the job has Succeeded, the {{< short_app_ref >}} has been deployed!
67+
68+
The Application Information tab will provide the URL's to access the {{< short_app_ref >}} GUI and API Server. In the "All-in-One" deployment on the VM, the API Server will only become accessible after visiting the GUI at least once.
69+
70+
![Stack - VM Application Information](../images/iac_stack_vm_info.png)
71+
72+
{{% notice style="code" title="502 Bad Gateway: Communication Breakdown!" icon="fire" %}}
73+
Although the infrastructure is deployed, the {{< short_app_ref >}} may still be initializing, which can result in a 502 Bad Gateway error when accessing the URLs. Please allow up to 10 minutes for the configuration to complete.
74+
{{% /notice %}}
75+
76+
To get a better understanding of how the API Server works and to obtain the API Key for making REST calls, review the [API Server documentation](client/api_server/).
77+
78+
### Cleanup
79+
80+
To destroy the {{< short_app_ref >}} infrastructure, in **OCI** navigate to `Developer Services` -> `Stacks`. Choose the Compartment the {{< short_app_ref >}} was deployed into and select the stack Name. Click on the "Destroy" button.
81+
82+
## Oracle Kubernetes Engine
83+
84+
{{% notice style="code" title="Documentation is Hard!" icon="circle-info" %}}
85+
More information coming soon... 11-June-2025
86+
{{% /notice %}}
67.2 KB
Loading
74.2 KB
Loading
34.9 KB
Loading
59.7 KB
Loading
27.4 KB
Loading
211 KB
Loading

0 commit comments

Comments
 (0)