This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

MLflow

MLflow tracking service and Vast.ai job coordinator

alwaldend.main.mlflow installs a caller-supplied runtime archive and enables the MLflow tracking service and Vast.ai coordinator on a Linux systemd host. Run it with privilege escalation. The services listen on loopback and keep their data in /var/lib/mlflow-tracking and /var/lib/mlflow-vastai.

Supply mlflow_runtime_archive as a controller-side path to a tar archive with mlflow, its runfiles, and mlflow-vastai at the archive root. The role extracts each archive revision into its own directory and activates it at /opt/mlflow/current.

Set mlflow_tracking_uri to the authenticated URL used by clients and workers. The runtime archive must include the MLflow OIDC plugin and a coordinator that supports a bearer-token file. Supply the OIDC provider registry, permitted groups, client secret file, session signing key file, and coordinator token file. The coordinator also needs its Vast.ai API key, allowed rentals, SSH identity, and verified host keys. The caller configures the HTTPS reverse proxy and prepares the workers.

When the caller provides dedicated volumes, set mlflow_require_data_mounts to true and mount them before invoking the role. Tracking then requires mounts at /var/lib/mlflow-tracking and /var/lib/mlflow-tracking/artifacts. The coordinator requires a mount at /var/lib/mlflow-vastai.

Set mlflow_enable_coordinator to false to install tracking independently. Provide only the browser OIDC registry entries in this mode. The role skips coordinator setup and leaves any previously installed coordinator untouched.

1 - Defaults

Defaults for mlflow
# Controller-side archive containing the MLflow CLI, its runfiles, and mlflow-vastai.
mlflow_runtime_archive: "{{ undef() }}"
# Tracking URL reachable by the coordinator, project submitters, and workers.
mlflow_tracking_uri: "{{ undef() }}"
mlflow_hostname: "{{ mlflow_tracking_uri | urlsplit('hostname') }}"
mlflow_tracking_port: 5000
mlflow_coordinator_port: 50051
mlflow_enable_coordinator: true
# Require separate mounts at the tracking, artifacts, and coordinator state paths.
mlflow_require_data_mounts: false
# Override the package name for distributions that package OpenSSH differently.
mlflow_ssh_client_package: openssh-clients
mlflow_worker_user: root
# The allowed rental selectors are supplied as one comma-separated string.
mlflow_vastai_workers: "{{ undef() }}"
mlflow_vast_api_key: "{{ undef() }}"
mlflow_tracking_token_src: "{{ undef() }}"
mlflow_oidc_providers: "{{ undef() }}"
mlflow_oidc_client_secret_src: "{{ undef() }}"
mlflow_oidc_session_key_src: "{{ undef() }}"
mlflow_oidc_groups: "{{ undef() }}"
mlflow_oidc_admin_groups: []
# Controller-side paths to the coordinator's SSH identity and trusted host keys.
mlflow_worker_ssh_key: "{{ undef() }}"
mlflow_worker_known_hosts: "{{ undef() }}"