Metadata-Version: 2.1
Name: here-mlflow-plugin
Version: 2.8.0
Summary: MLflow plugin for the Here Platform.
Home-page: https://here.com
Author: HERE Global B.V. and its affiliate(s)
License: HERE Proprietary License
Project-URL: Source, ssh://git@main.gitlab.in.here.com:3389/sdk/here-mlflow-plugin.git
Platform: UNKNOWN
License-File: LICENSE
License-File: HERE_NOTICE
Requires-Dist: here-platform (>=2.8.0)
Requires-Dist: mlflow (==1.20.2)
Requires-Dist: overrides
Requires-Dist: types-six
Requires-Dist: six

# here-mlflow-plugin

An MLFlow plugin for using MLflow with the Here platform.

# Credentials Setup
Please follow the steps mentioned [here](https://developer.here.com/documentation/sdk-python/dev_guide/topics/credentials.html#olp-credentials) to setup credentials to be able to access Platform.

# Dependencies:
Python: v3.7

# Installation:
```bash
pip install --extra-index-url https://artifactory.in.here.com/artifactory/api/pypi/analytics-pypi/simple/ here-mlflow-plugin
```

# Plugin Setup:
Catalog and Layer can be created with the provided script resources/plugin_setup.py.

Steps to Execute the Setup script:

Create a Catalog:
```bash
here_mlflow_plugin_setup -c <catalog_id>
```

Delete a catalog:
```bash
here_mlflow_plugin_setup -d <catalog_hrn>
```

You may also wish to use the existing Catalog and Layers as per the below configuration.

Catalog Name: Any valid catalog name.

Layer Details:

| Layername  | Layertype | Content type | attribute1 | type | attribute2 | type | attribute3 | type | attribute4 | type |
| ------- | ------ | ----------- |----------- | -------- | ----------- | ------- | ----------- | ------- | --------- | ------- |
| tracking-experiment  | index  | application/json|  ingestion_time | timewindow(10 min) | experiment_id | string | experiment_name | string | - | - |
| tracking-run  | index | application/json| start_time | timewindow(10 min) |  experiment_id | string |  run_id | string | - | - |
| artifact-metadata | index | application/json| ingestion_time | timewindow(10 min) | run_id | string | - | - | - | - |
| artifact-data | version | application/octet-stream | Partition type | Generic | - | - |  - | - | - | - |
| model-metadata  | index  | application/json|  ingestion_time | timewindow(10 min) | model_name | string | - | - | - | - |
| model-version-metadata  | index  | application/json|  ingestion_time | timewindow(10 min) | model_name | string | version | int | run_id | string |

# Execution:

For mlflow cli:
Windows:
```bash
set MLFLOW_TRACKING_URI=here+mlflow://catalog/v1/<catalog_hrn>
```

MacOS/Linux:
```bash
export MLFLOW_TRACKING_URI=here+mlflow://catalog/v1/<catalog_hrn>
```

For mlflow ui:
```bash
mlflow ui --backend-store-uri here+mlflow://catalog/v1/<catalog_hrn> --default-artifact-root here+mlflow://catalog/v1/<catalog_hrn>
```

# Build a Docker Image for a model

Windows:
```bash
set MLFLOW_TRACKING_URI=here+mlflow://catalog/v1/<catalog_hrn>
```

MacOS/Linux:
```bash
export MLFLOW_TRACKING_URI=here+mlflow://catalog/v1/<catalog_hrn>
```

Command to build Docker Image for a model:
```bash
here_mlflow_plugin_build_docker -m <MODEL-URI> --no_java <False/True> -n <IMAGE-NAME>
```

There are three parameters for this script

| Parameter  | Description |
| ------- | ------ | 
| -m / --model  | URI of the model for which the docker image is to be built  |
| -n / --name  | Name that would be given to image, default value is `mlflow-pyfunc-servable`  |
| -nj / --no_java  | If True will not install java in docker image,  default value is `False` |

Example:
```bash
here_mlflow_plugin_build_docker -m "here+mlflow://catalog/v1/<catalog_hrn>/0/6cbba15e-fe0c-4ab7-86c1-37644a7afc94/models" --no_java True -n "test-alpine"
```

To run docker image:
```bash
docker run -p <PORT>:8080 <IMAGE_ID>
```

