Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,27 @@ Requires either 'dsn' OR all of (host, port, service_name).
{{- end -}}
{{- end -}}

{{/* ******************************************
Validate that if server.oci_config.configMapName is specified,
then none of the other OCI config values (tenancy, user, fingerprint, region) should be provided.
*********************************************** */}}
{{- define "server.ociConfig.validate" -}}
{{- if .Values.server.oci_config -}}
{{- $configMapName := .Values.server.oci_config.configMapName | trim | default "" -}}
{{- $tenancy := .Values.server.oci_config.tenancy | trim | default "" -}}
{{- $user := .Values.server.oci_config.user | trim | default "" -}}
{{- $fingerprint := .Values.server.oci_config.fingerprint | trim | default "" -}}
{{- $region := .Values.server.oci_config.region | trim | default "" -}}

{{- /* If configMapName is provided, ensure no other config values are provided */ -}}
{{- if ne $configMapName "" -}}
{{- if or (ne $tenancy "") (ne $user "") (ne $fingerprint "") (ne $region "") -}}
{{- 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." -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}


{{/* ******************************************
Database Type Helpers
Expand Down
13 changes: 6 additions & 7 deletions helm/templates/server/oci-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
# spell-checker: ignore nindent

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

{{- /* Check if the ConfigMap already exists */ -}}
{{- $configMapExists := lookup "v1" "ConfigMap" .Release.Namespace $configMapName }}

{{- /* Only create ConfigMap if it doesn't exist */ -}}
{{- if not $configMapExists }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
2 changes: 1 addition & 1 deletion opentofu/modules/kubernetes/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
output "kubeconfig_cmd" {
description = "Command to generate kubeconfig file"
value = format(
"oci ce cluster create-kubeconfig --cluster-id %s --region %s --token-version 2.0.0 --kube-endpoint %s --file $HOME/.kube/config",
"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",
oci_containerengine_cluster.default_cluster.id,
var.region,
oci_containerengine_cluster.default_cluster.endpoint_config[0].is_public_ip_enabled ? "PUBLIC_ENDPOINT" : "PRIVATE_ENDPOINT"
Expand Down
19 changes: 12 additions & 7 deletions opentofu/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
# spell-checker: disable

output "app_version" {
description = "Oracle AI Optimizer and Toolkit Version"
description = "Application Version"
value = local.app_version
}

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

output "server_url" {
description = "URL for Client Access"
value = format("http://%s:8000/v1/docs", oci_load_balancer_load_balancer.lb.ip_address_details[0].ip_address)
output "optimizer_client_url" {
description = "URL for AI Optimizer and Toolkit Client Access"
value = var.deploy_optimizer ? format("http://%s", oci_load_balancer_load_balancer.lb.ip_address_details[0].ip_address) : "N/A"
}

output "optimizer_server_url" {
description = "URL for AI Optimizer and Toolkit Server API Access"
value = var.deploy_optimizer ? format("http://%s:8000/v1/docs", oci_load_balancer_load_balancer.lb.ip_address_details[0].ip_address) : "N/A"
}
6 changes: 6 additions & 0 deletions opentofu/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
#########################################################################

// Standard Default Vars
variable "deploy_optimizer" {
description = "Determines if the AI Optimizer and Toolkit is deployed"
type = bool
default = true
}

variable "optimizer_version" {
description = "Determines if latest release or main code line is used"
type = string
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ server = [
"bokeh==3.8.0",
"evaluate==0.4.6",
"faiss-cpu==1.12.0",
"fastapi==0.120.2",
"fastapi==0.121.0",
"fastmcp==2.13.0.2",
"giskard==2.18.0",
"langchain-aimlapi==0.1.0",
Expand All @@ -43,12 +43,12 @@ server = [
"langchain-openai==0.3.35",
"langchain-together==0.3.1",
"langgraph==1.0.1",
"litellm==1.79.0",
"litellm==1.79.1",
"llama-index==0.14.5",
"lxml==6.0.2",
"matplotlib==3.10.7",
"oci~=2.0",
"psutil==7.1.2",
"psutil==7.1.3",
"python-multipart==0.0.20",
"torch==2.9.0",
"umap-learn==0.5.9.post2",
Expand Down
Loading