Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #368 from cliveseldon/sagemaker
WIP: Train on Sagemaker, Deploy on Seldon Core
- Loading branch information
Showing
16 changed files
with
749 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
BUCKET=seldon-sagemaker-testing | ||
|
||
scikit_learn_iris_code.tar.gz: | ||
cd scikit_learn_iris && tar -cvf ../scikit_learn_iris_code.tar . | ||
gzip -f scikit_learn_iris_code.tar | ||
|
||
.PHONY: upload_scikit_code | ||
upload_scikit_code: | ||
aws s3 cp scikit_learn_iris_code.tar.gz s3://${BUCKET}/scikit_learn_iris_code.tar.gz | ||
|
||
|
||
#Need to build sklearn image | ||
|
||
docker_serve: | ||
docker run -it --rm -p 8080:8080 -e SAGEMAKER_MODEL_DIRECTORY="s3://seldon-sagemaker-testing/scikit_learn_iris/sagemaker-scikit-learn-2019-01-04-19-26-40-470/output/model.tar.gz" -e SAGEMAKER_SUBMIT_DIRECTORY="s3://seldon-sagemaker-testing/scikit_learn_iris_code.tar.gz" -e SAGEMAKER_PROGRAM="scikit_learn_iris.py" -v ~/.aws:/root/.aws sklearn-final:0.20.0-cpu-py3 serve | ||
|
||
|
||
clean: | ||
rm -f scikit_learn_iris_code.tar.gz | ||
rm -rf sagemaker-scikit-learn-container | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# AWS Sagemaker and Seldon Core | ||
|
||
In this tutorial we will show how to train a model using [AWS Sagemaker](https://aws.amazon.com/sagemaker/) and then deploy it locally on Seldon Core. An example showing this for a scikit-learn Iris model is shown in the [Jupyter notebook](sagemaker_seldon_scikit_iris_example.ipynb). | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: aws-config | ||
type: Opaque | ||
data: | ||
region: <region base64 encoded> | ||
aws_access_key_id: <id base64 encoded> | ||
aws_secret_access_key: <key base64 encoded> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"features":[ | ||
{ | ||
"name":"sepal_length", | ||
"dtype":"FLOAT", | ||
"ftype":"continuous", | ||
"range":[4,8] | ||
}, | ||
{ | ||
"name":"sepal_width", | ||
"dtype":"FLOAT", | ||
"ftype":"continuous", | ||
"range":[2,5] | ||
}, | ||
{ | ||
"name":"petal_length", | ||
"dtype":"FLOAT", | ||
"ftype":"continuous", | ||
"range":[1,10] | ||
}, | ||
{ | ||
"name":"petal_width", | ||
"dtype":"FLOAT", | ||
"ftype":"continuous", | ||
"range":[0,3] | ||
} | ||
], | ||
"targets":[ | ||
{ | ||
"name":"class", | ||
"dtype":"FLOAT", | ||
"ftype":"continuous", | ||
"range":[0,1], | ||
"repeat":3 | ||
} | ||
] | ||
} | ||
|
||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.