Skip to content

refactor(mlflow): use external gateway URL for tracking#294

Merged
pdettori merged 1 commit intokagenti:mainfrom
Ygnas:mlflow-use-gateway-url
Apr 20, 2026
Merged

refactor(mlflow): use external gateway URL for tracking#294
pdettori merged 1 commit intokagenti:mainfrom
Ygnas:mlflow-use-gateway-url

Conversation

@Ygnas
Copy link
Copy Markdown
Contributor

@Ygnas Ygnas commented Apr 17, 2026

Summary

Use status.url (gateway) instead of status.address.url (internal service) for the MLflow tracking URI. This avoids requiring the OpenShift service-serving CA in agent containers.

Remove MLFLOW_TRACKING_SERVER_CERT_PATH, DefaultCACertPath, custom CA loading, and MLflowAddressStatus type.

Related issue(s)

(Optional) Testing Instructions

Fixes #

Use status.url (gateway) instead of status.address.url (internal
service) for the MLflow tracking URI. This avoids requiring the
OpenShift service-serving CA in agent containers.

Remove MLFLOW_TRACKING_SERVER_CERT_PATH, DefaultCACertPath, custom
CA loading, and MLflowAddressStatus type.

Signed-off-by: Ignas Baranauskas <ibaranau@redhat.com>
Copy link
Copy Markdown
Contributor

@pdettori pdettori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-scoped refactoring. Switches MLflow tracking URI from internal service URL (status.address.url) to external gateway URL (status.url), eliminating the need for the OpenShift service-serving CA certificate in agent containers. All removed constants, types, and methods are consistently cleaned up.

Areas reviewed: Go (controller, client, types), Tests
Commits: 1 commit, signed-off ✓
CI status: all 16 checks passing

uri := cr.Status.Address.URL
logger.V(1).Info("Auto-discovered MLflow tracking URI", "uri", uri, "cr", cr.GetName())
return uri
logger.Info("MLflow CR is Available but status.url is not set, skipping", "cr", cr.GetName())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice logic inversion — checking for presence first (URL != "") is cleaner than the old guard-and-continue pattern.

type MLflowAddressStatus struct {
// URL is the in-cluster HTTPS URL for the managed MLflow Service.
Conditions []metav1.Condition `json:"conditions,omitempty"`
// URL is the external gateway URL for the MLflow server (e.g. via the RHOAI data-science gateway).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The json:"url" tag changes the serialized field from nested address.url to flat status.url. If any external consumer (e.g., the MLflow operator setting this status) still writes to the old address structure, deserialization would silently drop the value.

Since E2E tests pass, the upstream CRD likely already uses the flat status.url field — just flagging for awareness.

c.HTTPClient = &http.Client{
Timeout: 30 * time.Second,
Transport: &http.Transport{TLSClientConfig: tlsCfg},
Timeout: 30 * time.Second,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The default http.Client uses the system cert pool, which is correct for publicly-trusted gateway certs. If the gateway ever uses a private CA (e.g., air-gapped environments), this will need a configurable CA path re-added. The old TODO captured this well — consider keeping a one-line note for future readers.

@pdettori pdettori merged commit 8f90f9e into kagenti:main Apr 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants