Last active
January 3, 2020 21:24
-
-
Save jeanmidevacc/aec48590b80cc97c5019b267891550b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mlflow.sagemaker as mfs | |
# Define mlflow parameter | |
experimentid = 1 | |
runid = "xxxxxxx" | |
# AWS setup | |
awsid = "xxxxxx"# id of the AWS user that will deploy the system | |
region "xxxxx" # AWS region to deploy the API | |
arn = f"arn:aws:iam::{awsid}:role/xxxxx" # Arn of the role that will be used to do the deployment on sagemaker | |
# Give a nae ot the app | |
app_name = "xxxxxx" # Name of the app that will be deployed | |
# Setup the path for the deployment | |
model_uri = f"mlruns/{experimentid}/{runid}/artifacts/model" | |
image_url = awsid + ".dkr.ecr." + region + ".amazonaws.com/mlflow-pyfunc:1.4.0" #import tant to give the right version mlfloe deploy in ECR | |
# Deploy it | |
mfs.deploy(app_name = app_name, | |
model_uri = model_uri, | |
region_name = region, | |
mode = "replace", # like that you can overwrite | |
execution_role_arn = arn, | |
image_url = image_url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment