Skip to main content

Artifactory plugin for MLflow for Artifact storage

Project description

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

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

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.

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlflow-jfrog-artifactory-0.0.3.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

mlflow_jfrog_artifactory-0.0.3-py2.py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page