Skip to content

Commit 5ee5abd

Browse files
authored
Tofu updates (#328)
* Update to Helm and Tofu * IaC Updates
1 parent 4e7e143 commit 5ee5abd

File tree

6 files changed

+49
-18
lines changed

6 files changed

+49
-18
lines changed

helm/templates/_helpers.tpl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,27 @@ Requires either 'dsn' OR all of (host, port, service_name).
243243
{{- end -}}
244244
{{- end -}}
245245

246+
{{/* ******************************************
247+
Validate that if server.oci_config.configMapName is specified,
248+
then none of the other OCI config values (tenancy, user, fingerprint, region) should be provided.
249+
*********************************************** */}}
250+
{{- define "server.ociConfig.validate" -}}
251+
{{- if .Values.server.oci_config -}}
252+
{{- $configMapName := .Values.server.oci_config.configMapName | trim | default "" -}}
253+
{{- $tenancy := .Values.server.oci_config.tenancy | trim | default "" -}}
254+
{{- $user := .Values.server.oci_config.user | trim | default "" -}}
255+
{{- $fingerprint := .Values.server.oci_config.fingerprint | trim | default "" -}}
256+
{{- $region := .Values.server.oci_config.region | trim | default "" -}}
257+
258+
{{- /* If configMapName is provided, ensure no other config values are provided */ -}}
259+
{{- if ne $configMapName "" -}}
260+
{{- if or (ne $tenancy "") (ne $user "") (ne $fingerprint "") (ne $region "") -}}
261+
{{- fail "server.oci_config.configMapName is specified: you cannot also provide tenancy, user, fingerprint, or region. Either provide configMapName to reference an existing ConfigMap, OR provide the config values to create a new ConfigMap." -}}
262+
{{- end -}}
263+
{{- end -}}
264+
{{- end -}}
265+
{{- end -}}
266+
246267

247268
{{/* ******************************************
248269
Database Type Helpers

helm/templates/server/oci-configmap.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
# spell-checker: ignore nindent
44

55
{{- if .Values.server.oci_config }}
6-
{{- /* Determine the ConfigMap name to use or create */ -}}
7-
{{- $configMapName := .Values.server.oci_config.configMapName | default (printf "%s-oci-config" .Release.Name) }}
6+
{{- /* Validate OCI config settings */ -}}
7+
{{- include "server.ociConfig.validate" . }}
8+
{{- /* Only create ConfigMap if configMapName is not specified (user wants us to create it) */ -}}
9+
{{- if not .Values.server.oci_config.configMapName }}
10+
{{- /* Determine the default ConfigMap name */ -}}
11+
{{- $configMapName := printf "%s-oci-config" .Release.Name }}
812

9-
{{- /* Check if the ConfigMap already exists */ -}}
10-
{{- $configMapExists := lookup "v1" "ConfigMap" .Release.Namespace $configMapName }}
11-
12-
{{- /* Only create ConfigMap if it doesn't exist */ -}}
13-
{{- if not $configMapExists }}
1413
apiVersion: v1
1514
kind: ConfigMap
1615
metadata:

opentofu/modules/kubernetes/output.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
output "kubeconfig_cmd" {
66
description = "Command to generate kubeconfig file"
77
value = format(
8-
"oci ce cluster create-kubeconfig --cluster-id %s --region %s --token-version 2.0.0 --kube-endpoint %s --file $HOME/.kube/config",
8+
"oci ce cluster create-kubeconfig --cluster-id %s --region %s --token-version 2.0.0 --kube-endpoint %s --file $HOME/.kube/config --with-auth-context --profile DEFAULT",
99
oci_containerengine_cluster.default_cluster.id,
1010
var.region,
1111
oci_containerengine_cluster.default_cluster.endpoint_config[0].is_public_ip_enabled ? "PUBLIC_ENDPOINT" : "PRIVATE_ENDPOINT"

opentofu/output.tf

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
# spell-checker: disable
44

55
output "app_version" {
6-
description = "Oracle AI Optimizer and Toolkit Version"
6+
description = "Application Version"
77
value = local.app_version
88
}
99

10-
output "client_url" {
11-
description = "URL for Client Access"
12-
value = format("http://%s", oci_load_balancer_load_balancer.lb.ip_address_details[0].ip_address)
10+
output "app_name" {
11+
description = "Application Name (Label). The namespace for K8s installations"
12+
value = local.label_prefix
1313
}
1414

15-
output "server_url" {
16-
description = "URL for Client Access"
17-
value = format("http://%s:8000/v1/docs", oci_load_balancer_load_balancer.lb.ip_address_details[0].ip_address)
15+
output "optimizer_client_url" {
16+
description = "URL for AI Optimizer and Toolkit Client Access"
17+
value = var.deploy_optimizer ? format("http://%s", oci_load_balancer_load_balancer.lb.ip_address_details[0].ip_address) : "N/A"
18+
}
19+
20+
output "optimizer_server_url" {
21+
description = "URL for AI Optimizer and Toolkit Server API Access"
22+
value = var.deploy_optimizer ? format("http://%s:8000/v1/docs", oci_load_balancer_load_balancer.lb.ip_address_details[0].ip_address) : "N/A"
1823
}

opentofu/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
#########################################################################
88

99
// Standard Default Vars
10+
variable "deploy_optimizer" {
11+
description = "Determines if the AI Optimizer and Toolkit is deployed"
12+
type = bool
13+
default = true
14+
}
15+
1016
variable "optimizer_version" {
1117
description = "Determines if latest release or main code line is used"
1218
type = string

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ server = [
2626
"bokeh==3.8.0",
2727
"evaluate==0.4.6",
2828
"faiss-cpu==1.12.0",
29-
"fastapi==0.120.2",
29+
"fastapi==0.121.0",
3030
"fastmcp==2.13.0.2",
3131
"giskard==2.18.0",
3232
"langchain-aimlapi==0.1.0",
@@ -43,12 +43,12 @@ server = [
4343
"langchain-openai==0.3.35",
4444
"langchain-together==0.3.1",
4545
"langgraph==1.0.1",
46-
"litellm==1.79.0",
46+
"litellm==1.79.1",
4747
"llama-index==0.14.5",
4848
"lxml==6.0.2",
4949
"matplotlib==3.10.7",
5050
"oci~=2.0",
51-
"psutil==7.1.2",
51+
"psutil==7.1.3",
5252
"python-multipart==0.0.20",
5353
"torch==2.9.0",
5454
"umap-learn==0.5.9.post2",

0 commit comments

Comments
 (0)