system_environment_context.py
1 import json 2 3 from mlflow.environment_variables import MLFLOW_RUN_CONTEXT 4 from mlflow.tracking.context.abstract_context import RunContextProvider 5 6 # The constant MLFLOW_RUN_CONTEXT_ENV_VAR is marked as @developer_stable 7 MLFLOW_RUN_CONTEXT_ENV_VAR = MLFLOW_RUN_CONTEXT.name 8 9 10 class SystemEnvironmentContext(RunContextProvider): 11 def in_context(self): 12 return MLFLOW_RUN_CONTEXT.defined 13 14 def tags(self): 15 return json.loads(MLFLOW_RUN_CONTEXT.get())