pyenv install 3.7.0
pyenv global 3.7.0 # Use Python 3.7
mkvirtualenv mlflow # Create a Virtual Env with Python 3.7
workon mlflow
Install required libraries.
pip install mlflow==0.7.0 \
044865cb6f588c41fbcaad474ae636f2a57e8dcb4e514eb9ac93cc8f063016c167814032c2461b2050878e5d9b867722fe93ceeb85c873cec8d0f01fd40bde81b8;rogererill |
/* | |
* Copyright (c) 2018 Schibsted Media Group. All rights reserved | |
*/ | |
package com.saas.presto.access.authentication | |
import java.security.Principal | |
import java.util.concurrent.TimeUnit.MILLISECONDS | |
import com.facebook.presto.spi.security.{AccessDeniedException, BasicPrincipal, PasswordAuthenticator} | |
import com.google.common.cache.{CacheBuilder, CacheLoader, LoadingCache} |
import argparse | |
import errno | |
import os | |
import sys | |
from jinja2 import Environment, FileSystemLoader, StrictUndefined | |
UTF8 = 'utf8' | |
TEMPLATE = 'template' |
pyenv install 3.7.0
pyenv global 3.7.0 # Use Python 3.7
mkvirtualenv mlflow # Create a Virtual Env with Python 3.7
workon mlflow
Install required libraries.
pip install mlflow==0.7.0 \
# Running a Tracking Server | |
mlflow server \ | |
--file-store /tmp/mlflow/fileStore \ | |
--default-artifact-root s3://<bucket>/mlflow/artifacts/ \ | |
--host localhost | |
--port 5000 |
MLFLOW_TRACKING_URI=http://localhost:5000 python wine_quality.py \ | |
--alpha 0.9 | |
--l1_ration 0.5 | |
--wine_file ./data/winequality-red.csv |
with mlflow.start_run(): | |
... model ... | |
mlflow.log_param("source", wine_path) | |
mlflow.log_param("alpha", alpha) | |
mlflow.log_param("l1_ratio", l1_ratio) | |
mlflow.log_metric("rmse", rmse) | |
mlflow.log_metric("r2", r2) |
# Serve a sklearn model through 127.0.0.0:5005 | |
MLFLOW_TRACKING_URI=http://0.0.0.0:5000 mlflow sklearn serve \ | |
--port 5005 \ | |
--run_id 0f8691808e914d1087cf097a08730f17 \ | |
--model-path model |
# Query Tracking Server Endpoint | |
curl -X POST \ | |
http://127.0.0.1:5005/invocations \ | |
-H 'Content-Type: application/json' \ | |
-d '[ | |
{ | |
"fixed acidity": 3.42, | |
"volatile acidity": 1.66, | |
"citric acid": 0.48, | |
"residual sugar": 4.2, |
Start by downloading the latest stable Apache Spark (current 2.4.3).
cd ~/Downloads/
tar -xzf spark-2.4.3-bin-hadoop2.7.tgz
mv ~/Downloads/spark-2.4.3-bin-hadoop2.7 ~/
ln -s ~/spark-2.4.3-bin-hadoop2.7 ~/spark̀
Install PySpark and Jupyter in our virtualEnv