Plugin that provides Huawei Cloud OBS Artifact Store functionality for MLflow
Project description
Huawei Cloud OBS store plugin for MLflow
This repository provides a MLflow plugin that allows users to use a Huawei Cloud OBS as the artifact store for MLflow.
Implementation overview
huaweicloudstoreplugin
: this package includes theHuaweiCloudObsArtifactRepository
class that is used to read and write artifacts from Huawei Cloud OBS storage.setup.py
file defines entrypoints that tell MLflow to automatically associate theobs
URIs with theHuaweiCloudObsArtifactRepository
implementation when thehuaweicloudstoreplugin
library is installed. The entrypoints are configured as follows:
entry_points={
"mlflow.artifact_repository": [[README.md](..%2Fmlflow-huaweicloud%2FREADME.md)
"obs=huaweicloudstoreplugin.store.artifact.huaweicloud_obs_artifact_repo.py:HuaweiCloudObsArtifactRepository"
]
},
Usage
Install by pip on both your client and the server, and then use MLflow as normal. The Huawei Cloud OBS artifact store support will be provided automatically.
pip install huaweicloudstoreplugin
The plugin implements all of the MLflow artifact store APIs.
It expects Huawei Cloud Storage access credentials in the MLFLOW_OBS_REGION
, MLFLOW_OBS_ACCESS_KEY_ID
and MLFLOW_OBS_SECRET_ACCESS_KEY
environment variables,
so you must set these variables on both your client application and your MLflow tracking server.
To use Huawei Cloud OBS as an artifact store, an OBS URI of the form obs://<bucket>/<path>
must be provided, as shown in the example below:
import mlflow
class DemoModel(mlflow.pyfunc.PythonModel):
def predict(self, ctx, inp) -> int:
return 1
experiment = "demo"
mlflow.create_experiment(experiment, artifact_location="obs://mlflow-test/")
mlflow.set_experiment(experiment)
mlflow.pyfunc.log_model('model_test', python_model=DemoModel())
In the example provided above, the log_model
operation creates three entries in the OBS storage obs://mlflow-test/$RUN_ID/artifacts/model_test/
, the MLmodel file
and the conda.yaml file associated with the model.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for huaweicloudstoreplugin-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd170f47d04ea07bc044b86fae2b252e181419f1c2abf8ce905c1b75f786f705 |
|
MD5 | 00982f74cccd002c07f3a26967e1dbed |
|
BLAKE2b-256 | fc06a24d7029fd6f3ee90ae9fab0e4baf88034ef8f286f88398564667b56ed18 |
Hashes for huaweicloudstoreplugin-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f608496e1d9d75ec02f9a50fcf1efe1900a18bc76e5c3ce0fd784944a991a9e0 |
|
MD5 | a2d891f2484696e311bf52590b45cada |
|
BLAKE2b-256 | ca5877c237a4556c32eb2b16f3587ab30974a0679f9d5e5096c5fa295fb4a8b3 |