Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #80 from NealAnalyticsLLC/mlflow-on-azure-stack
Browse files Browse the repository at this point in the history
Adding Sample notebook for MLflow
  • Loading branch information
initmahesh authored Jun 16, 2020
2 parents 5efc8f0 + 9dce2e7 commit 66613f0
Show file tree
Hide file tree
Showing 9 changed files with 877 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Research/mlflow-on-azure-stack/Dockerfile.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:stretch
ARG BUNDLE_DIR
RUN apt-get update && apt-get install -y ca-certificates
RUN apt-get install -y wget
# Use the BUNDLE_DIR build argument to copy files into the bundle
COPY . $BUNDLE_DIR
11 changes: 10 additions & 1 deletion Research/mlflow-on-azure-stack/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

This module demonstrates how to create an MLflow environment in Kubernetes on Azure Stack

## In Progress
- packaging the steps in this Readme into a CNAB package that can be installed using Porter

## Prerequisites
- Access to an existing Kubernetes cluster
- A kubeconfig file to connect to cluster
- A private ACR repository in Azure
- Anaconda
- Docker desktop
- Kubectl

Expand Down Expand Up @@ -68,4 +72,9 @@ kubectl get service mlflow-service --namespace <your-namespace> --output jsonpat
1. Open your browser window
1. Enter the the IP from the previous step in the below format
1. http://<ip from above>:5000
1. You should see something like the image below
1. You should see something like the image below

## Step 9: Starting the Jupyter Notebook Tutorial
Open Jupyter Notebook, it should have been installed along side Anaconda. Navigate to the "notebooks" directory and select the MLflow_Tutorial notebook.

Follow along in the tutorial. Any cell can be run by pushing shift + enter.
31 changes: 31 additions & 0 deletions Research/mlflow-on-azure-stack/cnab_install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

## Step 1: Install Porter
Make sure you have Porter installed. You can find the installation instructions for your OS at the link provided below.

[Porter Installation Instructions](https://porter.sh/install/)


## Step 2: Build Porter CNAB
First you will need to navigate to this directory in the repository
Next, you will build the porter CNAB

```sh
porter build
```

## Step 3: Generate Credentials
This step is needed to connect to your Kubernetes cluster

```sh
porter credentials generate
```
Enter path to your kubeconfig file when prompted

## Step 4: Use Porter CNAB
Run one of the below commands to interact with the CNAB

```sh
porter install --cred <name of your credential>
porter upgrade --cred <name of your credential>
porter uninstall --cred <name of your credential>
```
21 changes: 21 additions & 0 deletions Research/mlflow-on-azure-stack/helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

install() {
echo Installing MLflow
kubectl create namespace mlflow
kubectl apply -f ./tracking_server.yaml --namespace mlflow
kubectl get service mlflow-service --namespace mlflow --output jsonpath={.status.loadBalancer.ingress[0].ip}
}

upgrade() {
echo Upgrade functionality has not been implemented
}

uninstall() {
echo Uninstalling MLflow server
kubectl delete namespace mlflow --now=true --wait=true
}

# Call the requested function and pass the arguments as-is
"$@"
11 changes: 11 additions & 0 deletions Research/mlflow-on-azure-stack/mlflow.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM continuumio/miniconda3

WORKDIR /app

ADD . /app

RUN pip install mlflow

EXPOSE 5000

ENTRYPOINT mlflow server --host 0.0.0.0 --port 5000
6 changes: 6 additions & 0 deletions Research/mlflow-on-azure-stack/notebooks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ignore files generated through the tutorial
mlruns
conda.yaml
MLproject
tutorial.py
ElasticNet-paths.png
Loading

0 comments on commit 66613f0

Please sign in to comment.