Skip to content

fix(workflow): default MLFLOW_ALLOW_FILE_STORE to true for filesystem tracking (#2391) - #2399

Open
X6m (X6M-Work) wants to merge 1 commit into
microsoft:mainfrom
X6M-Work:fix/workflow-default-mlflow-file-store-2391
Open

X6m (X6M-Work) wants to merge 1 commit into
microsoft:mainfrom
X6M-Work:fix/workflow-default-mlflow-file-store-2391

Conversation

@X6M-Work

Copy link
Copy Markdown

Description

Fixes #2391

Qlib's default experiment manager (MLflowExpManager) uses a local filesystem tracking URI (./mlruns / file:...). In environments where newer MLflow releases are installed or loaded outside CI (where MLFLOW_ALLOW_FILE_STORE="true" is exported in the GitHub Actions workflow environment), calling R.start() / MLflowClient(tracking_uri=...) raises an MlflowException unless MLFLOW_ALLOW_FILE_STORE is enabled.

Changes

  • Default MLFLOW_ALLOW_FILE_STORE to "true" via os.environ.setdefault("MLFLOW_ALLOW_FILE_STORE", "true") in qlib/workflow/__init__.py, qlib/workflow/expm.py, qlib/workflow/exp.py, and qlib/workflow/recorder.py (both at module load and before MlflowClient construction) so Qlib's default local mlruns filesystem tracking store works out of the box while still respecting any explicit user override in os.environ.
  • Add regression tests in tests/test_ci_configuration.py and tests/dependency_tests/test_mlflow.py.

Motivation and Context

Resolves #2391 where R.start() fails with MlflowException on local filesystem tracking URIs when MLFLOW_ALLOW_FILE_STORE has not been manually exported in the user's shell environment.

How Has This Been Tested?

  • python -m pytest tests/test_ci_configuration.py (17 passed)
  • Verified MLflowExpManager.client sets MLFLOW_ALLOW_FILE_STORE="true" when unset and preserves an existing environment value when already set.

Types of changes

  • Fix bug
  • Add new feature
  • Update documentation

@X6M-Work

Copy link
Copy Markdown
Author

X6m (X6m (@X6M-Work)) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] pyqlib 0.9.7 installs with unbounded mlflow; R.start() raises MlflowException on fresh environments

1 participant