MLFlow native model serving within Anaconda Enterprise.
This project provided a mechanism to launch a mlflow model serving instance within Anaconda Enterprise.
Note that the model will be launched using the conda environment management configuration. See Official MLFlow Models Documentation for additional details.
When deploying the solution in Anaconda Enterprise the below variables must be declared:
-
MLFLOW_SERVING_MODEL_NAME
The name of the registered model.
-
MLFLOW_SERVING_MODEL_STAGE
The model stage or version to pull from the registry.
Additionally access to the tracking server should be defined as Anaconda Enterprise Secrets. The below secrets are required to be defined:
MLFLOW_TRACKING_URI
MLFLOW_REGISTRY_URI
MLFLOW_TRACKING_TOKEN
The solution is meant to be used as a template from which deployments can be created exposing models as a REST endpoint.
The following details will need to be defined:
- Define the project name
- In the example below we use
dev.mlflow.endpoint.taxi
- In the example below we use
- Define the deployment name
- In the example below we use
dev.mlflow.endpoint.taxi
- In the example below we use
- Define the static endpoint name
- In the example below we use
dev-mlflow-endpoint-taxi
- In the example below we use
- MLFLOW_SERVING_MODEL_NAME
- In the example below we use
taxi_fare_regressor
- In the example below we use
- MLFLOW_SERVING_MODEL_STAGE
- In the example below we use
Staging
- In the example below we use
- Upload the project:
ae5 project upload --name "dev.mlflow.endpoint.taxi" mlflow.model.serving.x.y.z.tar.gz
-
Slip-Stream environment variables into the
anaconda-project.yml
-
Create the deployment:
ae5 project deploy --name "dev.mlflow.endpoint.taxi" --endpoint "dev-mlflow-endpoint-taxi" --command "Serve" --private "dev.mlflow.endpoint.taxi"
- Create private deployment token:
ae5 deployment token "dev.mlflow.endpoint.taxi"
These commands are used during develop for solution management.
Command | Environment | Description |
---|---|---|
Serve | Runtime | Entry point for model hosting. |
- conda
- anaconda-project
anaconda-project prepare --env-spec development
These commands are used during develop for solution management.
Command | Environment | Description |
---|---|---|
bash | Development | Enters a bash shell within the development environment. |
test:unit | Development | Runs unit tests |
test:integration | Development | Runs integration tests |
coverage | Development | Generates code coverage report |
clean | Development | Cleanup temporary project files |
lint | Development | Perform code linting check |
lint:fix | Development | Perform automated code formatting |
- Fork the repository on GitHub
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using GitHub
Copyright (c) 2023 Anaconda, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.