Repository navigation
Add runtime secret-manager and telemetry bindings - #104
Conversation
There was a problem hiding this comment.
💡 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".
| except Exception: | ||
| self.secret_manager_uuid = previous_uuid | ||
| self._clear_secret_manager_cache() |
There was a problem hiding this comment.
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 👍 / 👎.
| if self.state != "un-initialized": | ||
| self._apply_secret_manager_binding( | ||
| conn, manager_uuid=manager_uuid, manager=manager | ||
| ) |
There was a problem hiding this comment.
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 👍 / 👎.
| try: | ||
| current = self.exec.fs_read_file(conn, env_path, format="string") or "" | ||
| except Exception: | ||
| current = "" |
There was a problem hiding this comment.
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 👍 / 👎.
Introduce local MinIO image build using a specific release, replacing Docker Hub dependency. Add readiness diagnostics in integration tests to improve error reporting for service startups and connection issues.
Summary
This PR adds runtime provider bindings as explicit, opt-in service capabilities rather than assuming that every MLOX service supports them.
secret_manager,observability) from consumer capabilities (secret_manager_binding,telemetry_binding)AbstractServicebinding-neutral and introduces dedicated secret-manager and telemetry consumer mixinsmlox.services.otel.client.OTelClient; gateway deployments installbusysloths-mloxrather than copying the client moduleOTelClient.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
secret_manager_bindingservice.envfilesecret_manager_uuidConnection visibility
runtime-Airflow-a1b2c3d4and retain the full binding UUID as metadataSecret-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-mloxrelease containingOTelClient.from_envand base64 certificate support.Validation
flake8checks andgit diff --checkpassModel invocation and step telemetry
live_predictwith a root span, metrics, and logs; nestedmodel_step()contexts record stable hierarchical paths.