Plugin that provides Aliyun oss Artifact Store functionality for MLflow in Xkool
Project description
Aliyun OSS store plugin for MLflow
This repository provides a MLflow plugin that allows users to use a aliyun oss as the artifact store for MLflow.
Implementation overview
aliyunstoreplugin: this package includes theAliyunOssArtifactRepositoryclass that is used to read and write artifacts from Aliyun OSS storage.setup.pyfile defines entrypoints that tell MLflow to automatically associate theossURIs with theAliyunOssArtifactRepositoryimplementation when thealiyunstorepluginlibrary is installed. The entrypoints are configured as follows:
entry_points={
"mlflow.artifact_repository": [
"oss=aliyunstoreplugin.store.artifact.aliyun_oss_artifact_repo:AliyunOssArtifactRepository"
]
},
Usage
Install by pip on both your client and the server, and then use MLflow as normal. The Alibaba Cloud OSS artifact store support will be provided automatically.
pip install mlflow[aliyun-oss]
The plugin implements all of the MLflow artifact store APIs.
It expects Aliyun Storage access credentials in the MLFLOW_OSS_ENDPOINT_URL, MLFLOW_OSS_KEY_ID and MLFLOW_OSS_KEY_SECRET environment variables,
so you must set these variables on both your client application and your MLflow tracking server.
To use Aliyun OSS as an artifact store, an OSS URI of the form oss://<bucket>/<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="oss://mlflow-test/")
mlflow.set_experiment(exp_name)
mlflow.pyfunc.log_model('model_test', python_model=Mod())
In the example provided above, the log_model operation creates three entries in the OSS storage oss://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
File details
Details for the file xk_mlflow_oss_plugin-1.0.0.tar.gz.
File metadata
- Download URL: xk_mlflow_oss_plugin-1.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19216992e7f59a83797970f2978d29e73c75cf6fbaa251646ea511873eaf6aa6
|
|
| MD5 |
d52c8a2c7ebfd70c778a07946d9ca5ab
|
|
| BLAKE2b-256 |
6ea82f5d596c99d0aea2a6e55184c924b0ba18675e0e599f9675687932d0d236
|