https://github.com/jfrog/mlflow-jfrog-plugin
https://github.com/jfrog/mlflow-jfrog-plugin
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jfrog/mlflow-jfrog-plugin
- Owner: jfrog
- License: apache-2.0
- Created: 2024-02-04T21:18:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T01:38:38.000Z (almost 2 years ago)
- Last Synced: 2025-08-21T21:35:29.186Z (9 months ago)
- Language: Python
- Size: 23.4 KB
- Stars: 32
- Watchers: 5
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JFrog MLFlow plugin
## Overview
JFrog MLFlow plugin is a plugin created by JFrog for customers using MLflow product.
[MLflow](https://www.mlflow.org/) is an open-source platform for managing the end-to-end machine learning lifecycle.
The JFrog MLflow plugin extends MLflow functionality by replacing the default artifacts location of MLflow with JFrog Artifactory.
Once MLflow experiments artifacts are available inside JFrog Artifactory, they become an integral part of the company's release lifecycle as any other artifact and are also covered by all the security tools provided through the JFrog platform.
## Installation
Install the plugin using pip, installation should be done on the mlflow tracking server.
optionally the plugin can be installed on any client that wants to change the default artifacts location for a specific artifactory repository
```bash
pip install mlflow-jfrog-plugin
```
Set the JFrog Artifactory authentication token, using the ARTIFACTORY_AUTH_TOKEN environment variable:
Preferably, for security reasons use a token with minimum permissions required rather than an admin token
```bash
export ARTIFACTORY_AUTH_TOKEN=
```
Once the plugin is installed and token set, your mlflow tracking server can be started with JFrog artifactory repository as a target artifacts destination
USe the mlflow documentation for additional mlflow server options
```bash
mlflow server --host --port --artifacts-destination artifactory:///artifactory/
```
For allowing large artifacts upload to JFrog artifactory, it is advisable to increase upload timeout settings when starting th mlflow server:
--gunicorn-opts '--timeout '
## Usage
MLflow model logging code example:
```python
import mlflow
from mlflow import MlflowClient
from transformers import pipeline
mlflow.set_tracking_uri(
""
)
mlflow.create_experiment(
""
)
classifier = pipeline("sentiment-analysis", model="michellejieli/emotion_text_classifier")
with mlflow.start_run():
mlflow.transformers.log_model(transformers_model=classifier, artifact_path=)
mlflow.end_run()
```
## Configuration
Additional optional settings (set on mlflow tracking server before its started):
to use no-ssl artifactory URL, set ARTIFACTORY_NO_SSL to true. default is false
```bash
export ARTIFACTORY_NO_SSL=true
```
to allow JFrog operations debug logging, set ARTIFACTORY_DEBUG to true. default is false
```bash
export ARTIFACTORY_DEBUG=true
```
to prevent MLflow garbage collection remove any artifacts from being removed from artifactory, set ARTIFACTORY_ARTIFACTS_DELETE_SKIP to true. default is false
Notice this settings might cause significant storage usage and might require JFrog files retention setup.
```bash
export ARTIFACTORY_ARTIFACTS_DELETE_SKIP=true
```
## Features
- Experiments artifacts log/save are performed against JFrog Artifactory
- Experiments artifacts viewing and downloading using MLflow UI and APIs as well as JFrog UI and APIs are done against JFrog Artifactory
- Experiments Artifacts deletion follow experiments lifecycle (automatically or through mlflow gc)
- Changing specific experiments artifacts destination is allowed through experiment creation command (by changing artifact_location)
## Contributing
We welcome contributions! If you find any issues or have suggestions for improvements, please create an issue or pull request on the GitHub repository.
Notice that for running the testing locally, you will need to either launch an artifactory and point the test scripts to it, or upload a license string into tests/art.lic
## License
Apache 2.0