semvec/pypi-packages huggingface dataset:
mlflow-jfrog-artifactory 0.0.3
Artifactory plugin for MLflow for Artifact storage
Requires Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,<4.0,>=2.7

# Internal Jfrog Artifactory store plugin for MLflow
This repository provides a MLflow plugin that allows users to use a `Generic Artifactory repository` as the artifact store for MLflow.

![Mlflow](./doc/MLflow-logo-final-white-TM.png)

## Implementation overview
* `artifactory`: this package includes the `JFrogArtifactRepository` class that is used to read and write artifacts from Aliyun OSS storage.
* `setup.py` file defines entrypoints that tell MLflow to automatically associate the `artifactory` URIs with the `JFrogArtifactRepository` implementation when the `artifactory` library is installed. The entrypoints are configured as follows:

```
entry_points={
        "mlflow.artifact_repository": [
        entry_points={
            "mlflow.artifact_repository": "artifactory=mlflow_artifactory_plugin.store.artifact.jfrog_artifact_repository:JFrogArtifactRepository",  # noqa
        ]
    },
```

# Running

![Mlflow](./doc/Mlfow-quick-presentation.gif)

# Usage

Install by pip on both your client and the server, and then use MLflow as normal. The JFrog Artifactory store support will be provided automatically.

<!-- ```bash
pip install mlflow[mlflow-jfrog-artifactory]
``` -->


The plugin implements all of the MLflow artifact store APIs.
It expects Artifactory Storage access credentials in the ``MLFLOW_ARTIFACTORY_ENDPOINT_URL``, ``MLFLOW_ARTIFACTORY_KEY`` and ``MLFLOW_ARTIFACTORY_REPO`` environment variables,
so you must set these variables on both your client application and your MLflow tracking server.
To use Artifactory as an artifact store, an artifactory URI of the form ``artifactory://<path>`` must be provided, as shown in the example below:

```python
import mlflow
import mlflow.pyfunc

class Mod(mlflow.pyfunc.PythonModel):
    def predict(self, ctx, inp):
        return 7

exp_name = "myexp"
mlflow.create_experiment(exp_name, artifact_location="artifactory://mlflow-test/")
mlflow.set_experiment(exp_name)
mlflow.pyfunc.log_model('model_test', python_model=Mod())
```

# Fix SSL error

This plugin help to connect to external services (here Jrog artifactory).

If you are facing this error, you proabably need to pass the location of the certifact.
*ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)*


Self-signed SSL certificates are obviously not taken into account implicitly and you need to  specify in REQUESTS_CA_BUNDLE. You can get around this behaviour by explicitly merging the environment settings into your session. For a Linux system you can set it like this before running the script:
```export REQUESTS_CA_BUNDLE=/path/to/certificat/file.pem```