Skip to main content

AML to OSMO Proxy

Run any OSMO workflow from Azure Machine Learning — submit, monitor, and log metrics without modifying the workflow YAML.

Overview​

The proxy bridges standard Azure ML tooling with OSMO cluster orchestration. An AML command job pod submits the workflow to the OSMO REST API, polls until completion, and logs metrics back to AML Studio. Workflow YAMLs are never modified by the proxy.

Prerequisites​

  • AML workspace attached to AKS via infrastructure/setup/02-deploy-azureml-extension.sh
  • OSMO deployed on the same AKS cluster via infrastructure/setup/03-deploy-osmo.sh
  • defaultinstancetype AML instance type registered (done by step 2 script)
  • Azure CLI with ml extension installed

Quick Start​

# Using the submission wrapper (resolves workspace from Terraform outputs)
workflows/azureml/submit-osmo-proxy-job.sh

# Submit a uniquely named job with an explicit durable output
workflows/azureml/submit-osmo-proxy-job.sh \
--job-name osmo-proxy-smoke \
--experiment-name osmo-proxy-smoke \
--output-url azure://<storage-account>/osmo/proxy-smoke/

Set OSMO_WORKFLOW_BUCKET when the deployment uses a container other than osmo. The wrapper validates --output-url against the Terraform storage account and this independently configured container.

# Or directly with az ml job create
az ml job create \
--file workflows/azureml/osmo-proxy-job.yaml \
--workspace-name <ws> --resource-group <rg> \
--set environment_variables.WORKFLOW_YAML=workflows/osmo/smoke-test-proxy-e2e.yaml \
--set environment_variables.OSMO_OUTPUT_URLS=azure://<storage-account>/osmo/proxy-smoke/ \
--set environment_variables.OSMO_OUTPUT_STORAGE_ACCOUNT=<storage-account> \
--set environment_variables.OSMO_OUTPUT_CONTAINER=osmo \
--set environment_variables.OSMO_SET_VARIABLES='[{"name":"output_url","value":"azure://<storage-account>/osmo/proxy-smoke/"}]' \
--set environment_variables.AML_SUBSCRIPTION_ID=<subscription-id> \
--set environment_variables.AML_RESOURCE_GROUP=<rg> \
--set environment_variables.AML_WORKSPACE_NAME=<ws>

Auth Modes​

ModeHeaderWhen to useConfiguration
dev (default)x-osmo-user: adminDevelopment clusters with --method dev OSMO loginSet OSMO_AUTH_MODE=dev, OSMO_USERNAME=admin (defaults)
tokenAuthorization: Bearer <token>Production / shared environmentsSet OSMO_AUTH_MODE=token, OSMO_TOKEN from Key Vault secret osmo-proxy-token

WARNING

The OSMO admin token is stored under key password (not token) in the osmo-default-admin Kubernetes secret in the osmo-control-plane namespace. Extract it with: kubectl get secret osmo-default-admin -n osmo-control-plane -o jsonpath='{.data.password}' | base64 -d

Workflow Configuration​

Set WORKFLOW_YAML to the path of the OSMO workflow YAML relative to the repo root. Use OSMO_SET_VARIABLES for template substitution without modifying the workflow file:

--set environment_variables.OSMO_SET_VARIABLES='[{"name":"dataset","value":"vda-demo"}]'

NOTE

OSMO workflow YAMLs submitted via the proxy use the TemplateSpec REST API. The platform: field must be declared on the resource definition, not on the task. Task-level platform: is rejected by the API with HTTP 422.

Metrics Reference​

Tier 1 — Always Logged​

Collected on every proxy run from the OSMO API response. No configuration required.

MLflow keyTypeDescription
osmo.workflow_idtagOSMO workflow UUID
osmo.statustagTerminal status (COMPLETED, FAILED_*)
osmo.pooltagOSMO pool name
osmo.first_errortagError message from first failed task
osmo.task_countmetricTotal tasks across all groups
osmo.task_completedmetricTasks with status COMPLETED
osmo.failed_tasksmetricTasks with any FAILED* status
osmo.task_success_ratemetriccompleted / total
osmo.duration_secondsmetricWorkflow wall-clock time
osmo.task_duration_mean_smetricMean per-task elapsed time
osmo.task_duration_max_smetricMax per-task elapsed time
osmo.task_duration_p95_smetricP95 per-task elapsed time
osmo.group.<name>.task_countmetricPer-group task count
osmo.group.<name>.completedmetricPer-group completed count
osmo.group.<name>.failedmetricPer-group failed count

Tier 2 — Spec-Driven Blob Metrics (Optional)​

The proxy reads declared output URLs from the OSMO workflow YAML, lists blobs matching each rule's source pattern, fetches matched JSON files using MSI auth, applies transforms, and logs results as osmo.workflow.<name> MLflow metrics. No changes to the OSMO workflow YAML are required.

Set OSMO_METRICS_SPEC to the path of a spec file at submission time. See workflows/osmo/osmo-metrics-spec-schema.yaml for the full schema reference.

--set environment_variables.OSMO_METRICS_SPEC=path/to/my-metrics-spec.yaml

Environment Variables​

VariableRequiredDefaultDescription
WORKFLOW_YAMLYesworkflows/osmo/smoke-test-proxy-e2e.yamlPath to OSMO workflow YAML (relative to repo root)
OSMO_GATEWAY_URLNohttp://osmo-gateway.osmo-control-plane.svc.cluster.localOSMO in-cluster gateway URL
OSMO_POOLNodefaultOSMO pool name
OSMO_AUTH_MODENodevAuth mode: dev or token
OSMO_USERNAMENoadminUsername for dev auth mode
OSMO_TOKENConditional—Bearer token for token auth mode
POLL_INTERVAL_SECSNo30Seconds between status polls
OSMO_SET_VARIABLESNo—JSON array [{"name": "k", "value": "v"}] for workflow template substitution
OSMO_OUTPUT_URLSRequired for declared outputs—Comma-separated resolved output URLs used for metrics and data asset registration
OSMO_OUTPUT_STORAGE_ACCOUNTRequired for declared outputs—Trusted deployment storage account for output URL validation
OSMO_OUTPUT_CONTAINERRequired for declared outputs—Trusted deployment container for output URL validation
OSMO_METRICS_SPECNo—Path to Tier 2 metrics spec YAML file
AZURE_CLIENT_IDNo—MSI client ID for blob auth (Tier 2 metrics, data asset registration)
AML_SUBSCRIPTION_IDRequired for declared outputs—Azure subscription for data asset registration
AML_RESOURCE_GROUPRequired for declared outputs—Resource group for data asset registration
AML_WORKSPACE_NAMERequired for declared outputs—AML workspace for data asset registration

WARNING

azureml-mlflow is required alongside mlflow-skinny to register the azureml:// tracking store plugin. The proxy fails the Azure ML job when plugin initialization, metric logging, or declared-output data asset registration fails. workflows/azureml/osmo-proxy-job.yaml installs the frozen runtime from workflows/azureml/osmo-proxy/uv.lock.

The proxy must run as an AML job inside the cluster. The OSMO_GATEWAY_URL is only reachable from pods inside the AKS cluster.