diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index a5debdf8..fcb3b731 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -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 diff --git a/helm/templates/server/oci-configmap.yaml b/helm/templates/server/oci-configmap.yaml index 0cd01490..d56bf1f7 100644 --- a/helm/templates/server/oci-configmap.yaml +++ b/helm/templates/server/oci-configmap.yaml @@ -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: diff --git a/opentofu/modules/kubernetes/output.tf b/opentofu/modules/kubernetes/output.tf index c88e7352..cba3e198 100644 --- a/opentofu/modules/kubernetes/output.tf +++ b/opentofu/modules/kubernetes/output.tf @@ -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" diff --git a/opentofu/output.tf b/opentofu/output.tf index 25e7300a..2dba6bf8 100644 --- a/opentofu/output.tf +++ b/opentofu/output.tf @@ -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" } diff --git a/opentofu/variables.tf b/opentofu/variables.tf index 494757d1..f9806e79 100644 --- a/opentofu/variables.tf +++ b/opentofu/variables.tf @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 715dc7c3..721e8871 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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",