opst / knitfab

MLOps system with automated lineage tracking, tag-based workflow engine and task runner with container runtime.
https://knitfab.opst.co.jp
Other
2 stars 2 forks source link

Worker: inject Dynamic ENVVAR via Lifecycle Hook #172

Open takaoka-youta-opst opened 5 days ago

takaoka-youta-opst commented 5 days ago

Inject arbitary Environmental Variables into Run Worker.

Currently, no ENVVARs are supported on runtime.

This proposal proposes:

Motivation

For example, let us think about to integrate with MLFlow. Worker should know Tracking Server URI and Run ID or Experiment ID to log parameters/metrics with MLFlow. If associating "Knitfab Run and MLFlow Run" and "Knitfab Plan and MLFlow Experiment", MLFLOW_* ENVVAR should be determined from a Knitfab Run in dynamic way.

Other integrations using ENVVAR may be with same vives.

Spec

If Response of Lifecycle Hook before "starting" is Content-Type: application/json and formatted in

{
    "env": {[key: string]: string}
}

, Knitfab uses env content as ENVVARs to be injected to Worker pod.

takaoka-youta-opst commented 4 hours ago

The type proposed in "Spec" is too simple, and I afraid to conflict with existing hook implementation responsing something.

So, I change type as follow:

{
    "knitfabExtension": {
        "env": {[key: string]: string}
    }
}

Key "knitfabExtension" is a "namespace" for Knitfab Hooks to refer.