Coder Social home page Coder Social logo

bridgecrew-perf7 / amazon-sagemaker-shadow-deploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/amazon-sagemaker-shadow-deploy

0.0 0.0 0.0 355 KB

License: MIT No Attribution

Python 10.84% Batchfile 0.61% Jupyter Notebook 88.55%

amazon-sagemaker-shadow-deploy's Introduction

sagemaker-shadow-deploy

Corresponding Blog is published here: https://aws.amazon.com/blogs/machine-learning/deploy-shadow-ml-models-in-amazon-sagemaker/

Prereqs

  1. Install CDK on your device using these instructions: https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-python.html

Setup Instructions

For Option 1 - Deploy models with an offline approach using Amazon SageMaker Model Monitor

  1. Clone this project to your Jyputer Lab/SageMaker Studio: git clone https://github.com/aws-samples/amazon-sagemaker-shadow-deploy.git
  2. Instantiate a SageMaker notebook present here: resources/Shadow-deployment-async-process-demo-breast-cancer.ipynb with kernel set to conda_python3
  3. Restart Kernel and Run the above notebook

For Option 2 - Deploy models with a synchronous approach

  1. Clone this project to your device: git clone https://github.com/aws-samples/amazon-sagemaker-shadow-deploy.git
  2. Navigate to project root directory and create virtualenv: python3 -m venv .venv
  3. Activate virtualenv: source .venv/bin/activate
  4. Install dependent packages: pip install -r requirements.txt
  5. Verify setup: cdk synth (should generate cloudformation template)
  6. Upload resources/breast_cancer_shadow_deployment.ipynb to your sagemaker notebook instance
  7. Execute the above notebook to build/train/deploy your model versions
  8. Deploy Stack after changing the parameters to your deployed model versions
    • cdk deploy sagemaker-shadow-deploy --parameters endpointNameV1=shadow-linear-endpoint-v1-202012300108 --parameters endpointNameV2=shadow-linear-endpoint-v2-202012300229

Testing

  1. Stack output display two endpoint urls
    1. sagemaker-shadow-deploy.Endpointxxx - use this url in postman and send the following data: {"data": "13.49,22.3,86.91,561.0,0.08752,0.07697999999999999,0.047510000000000004,0.033839999999999995,0.1809,0.057179999999999995,0.2338,1.3530000000000002,1.735,20.2,0.004455,0.013819999999999999,0.02095,0.01184,0.01641,0.001956,15.15,31.82,99.0,698.8,0.1162,0.1711,0.2282,0.1282,0.2871,0.06917000000000001"}
    2. sagemaker-shadow-deploy.ViewShadowDeploymentsViewerEndpointxxx - use this url on your browser to see the model inference results

amazon-sagemaker-shadow-deploy's People

Contributors

rags1357 avatar rvvittal avatar amazon-auto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.