Skip to content

Add runtime secret-manager and telemetry bindings - #104

Merged
nicococo merged 15 commits into
mainfrom
feature/runtime-service-bindings
Sep 29, 2026
Merged

nicococo merged 15 commits into
mainfrom
feature/runtime-service-bindings

Conversation

@nicococo

@nicococo nicococo commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR adds runtime provider bindings as explicit, opt-in service capabilities rather than assuming that every MLOX service supports them.

  • distinguishes provider capabilities (secret_manager, observability) from consumer capabilities (secret_manager_binding, telemetry_binding)
  • keeps AbstractService binding-neutral and introduces dedicated secret-manager and telemetry consumer mixins
  • lets providers export plain environment dictionaries while consumers install/remove them without understanding provider-specific credentials
  • equips the Docker MLflow gateway and Airflow with capability-aware runtime connections
  • adds the TUI Configure Connections action with independent secret-manager and telemetry selectors
  • uses the packaged mlox.services.otel.client.OTelClient; gateway deployments install busysloths-mlox rather than copying the client module
  • transports the OTel CA certificate as base64 environment content and decodes it in OTelClient.from_env()

Unified secret-manager environment API

Secret-manager providers expose one optional-scope API:

  • get_secret_manager_env_binding(binding_id=None)
  • revoke_secret_manager_env_binding(binding_id=None)

With no binding ID, the provider exports its regular shared environment. With a binding ID, providers may create and later revoke least-privilege access for that stable binding. The default implementation remains provider-neutral.

OpenBao uses the scoped form to issue a renewable per-service child token and revoke it on unbind. The binding ID remains internal to the capability; consumers never call OpenBao APIs or handle token creation.

Airflow integration

  • Airflow advertises secret_manager_binding
  • both Airflow Compose variants consume the generic service.env file
  • Airflow installs/removes a provider-owned environment block and reconciles the running stack
  • the persistent source of truth is the common secret_manager_uuid
  • the workflow-specific Expose Secret Manager dialog, button, use cases, tests, and styling were removed
  • the workflow overview only reports whether Airflow is connected; configuration happens through the Airflow service's generic Configure Connections action

Connection visibility

  • the Configure Connections modal is centered
  • every consumer service overview shows its secret-manager and/or telemetry connection state
  • connected providers are resolved to name, UUID, and server
  • secret-manager providers may expose an optional credential label for the overview
  • OpenBao runtime credentials use readable, stable names such as runtime-Airflow-a1b2c3d4 and retain the full binding UUID as metadata

Secret-manager and telemetry relationships remain independent. Each consumer has at most one secret manager and at most one telemetry provider; it may bind neither, either one, or both.

Deployment note

The gateway image/environment must install a busysloths-mlox release containing OTelClient.from_env and base64 certificate support.

Validation

  • full unit suite on the preceding implementation revision: 761 passed
  • full overview panel suite: 10 passed\n- focused binding, OpenBao, Airflow, workflow, and TUI regression tests pass
  • integration tests cover:
    • scoped OpenBao environment reconstruction, secret round-trip, and revocation
    • live Airflow bind/injection/unbind and OpenBao child-credential revocation
  • integration suite collection: 10 tests collected
  • live integration execution was unavailable in the authoring workspace because Multipass is unavailable
  • critical flake8 checks and git diff --check pass

Model invocation and step telemetry

  • Adds request-local model invocation context and pipeline header propagation through the gateway.
  • Adds optional secret-manager and shared telemetry-client access for deployable models.
  • Instruments live_predict with a root span, metrics, and logs; nested model_step() contexts record stable hierarchical paths.
  • Records aggregate array observations without raw inputs, enabling step-level comparison (e.g. normalization, PCA, regression). Nesting represents execution hierarchy, not arbitrary dataflow dependencies.
  • Full unit suite: 770 passed. Live integration execution remains unavailable because Multipass is not installed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 358e7359eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mlox/service.py Outdated
Comment on lines +504 to +506
except Exception:
self.secret_manager_uuid = previous_uuid
self._clear_secret_manager_cache()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore deployed configuration when binding reconciliation fails

If the MLflow Gateway writes the new environment block and compose_restart() then raises or partially fails, this handler restores only secret_manager_uuid; the remote service.env still contains credentials for the new provider. The operation therefore reports failure while the next restart—or a partially recreated container—uses a different secret manager than the persisted service state. Telemetry binding has the same issue. Preserve and restore the previous environment block, then reconcile it before rolling the UUID back.

Useful? React with 👍 / 👎.

Comment thread mlox/service.py Outdated
Comment on lines +500 to +503
if self.state != "un-initialized":
self._apply_secret_manager_binding(
conn, manager_uuid=manager_uuid, manager=manager
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject bindings for unsupported uninitialized services

When a service is still un-initialized, this condition skips the backend hook that raises BindingNotSupportedError, so every AbstractService accepts and persists a secret-manager binding even if it has no implementation for exposing one. The use case then reports success, and non-MLflow services silently retain an unusable provider UUID; telemetry binding behaves identically. Check backend support independently of lifecycle state before persisting the binding.

Useful? React with 👍 / 👎.

Comment on lines +179 to +182
try:
current = self.exec.fs_read_file(conn, env_path, format="string") or ""
except Exception:
current = ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not overwrite an unreadable runtime environment

If service.env is missing or cannot be read during a live bind/unbind, this broad exception treats it as empty and subsequently overwrites it with only the managed binding keys. A missing legacy file or transient read/permission failure therefore discards the tracking URI, authentication, gateway port, and cache settings before Compose reconciliation. Propagate the read failure, or explicitly reconstruct all required base settings instead of silently using an empty file.

Useful? React with 👍 / 👎.

@nicococo
nicococo merged commit b1a91f2 into main Sep 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant