Giter Site home page Giter Site logo

shilongjaycui / sklearn-infrastructure Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 499 KB

This is a machine learning service template that contains the sample code of a scikit-learn machine learning model.

License: MIT License

Makefile 6.61% Python 22.23% Dockerfile 1.83% Shell 3.78% HCL 65.55%

sklearn-infrastructure's Introduction

ml-service-template

This is a machine learning service template that contains the sample code of a scikit-learn machine learning model. The model is

  1. served using FastAPI,
  2. containerized using Docker, and
  3. deployed to Amazon Web Services (AWS) using Terraform.

What motivated the creation of this template?

To enable data scientists and ML practitioner to focus on building machine learning models in production and not worry about model serving or model deployment.

What resources did I use to help create this template?

I'm in. How do I use the template to build models?

  1. Clone this repository:

    $ git clone [email protected]:shilongjaycui/ml-service-template.git
    
  2. Navigate into the repository:

    $ cd ml-service-template
    
  3. Train a machine learning model:

    $ cd app && make train && cd ..
    
  4. Create an AWS account if you don't have one already.

  5. Install AWS Command Line Interface (CLI); then, verify you have AWS CLI successfully installed on your local machine by running the following commands:

    $ which aws
    /usr/local/bin/aws
    $ aws --version
    aws-cli/2.15.30 Python/3.11.6 Darwin/23.3.0 botocore/2.4.5
    
  6. Create an IAM user with just enough permissions (see why here) to deploy Docker containers to ECS:

    ml-service-template IAM user

  7. Configure the terminal session to use the newly-created IAM user:

    $ aws configure
    AWS Access Key ID: <paste your access key ID from the previous step and hit enter>
    AWS Secret Access Key: <paste your secret access key from the previous step and hit enter>
    Default region name: us-west-2
    Default output format [None]: <just hit enter>
    
  8. Install Terraform by following the instructions here.

  9. Set up Amazon Elastic Container Registry (Amazon ECR) in your AWS account:

    $ make setup-ecr
    
  10. Build and push your Docker image to Amazon ECR:

    $ make deploy-container
    
  11. Deploy your machine learning service (served & containerized scikit-learn model) to AWS:

    $ make deploy-service
    
  12. Click on the link (Terraform output) in your terminal to interact with your machine learning service.

  13. IMPORTANT: When you're done interacting with your service, destroy it.

    $ make destroy-service
    

What upcoming features can I expect in the future?

  • library-agnostic development: You can develop your machine learning model using scikit-learn, PyTorch, TensorFlow, or Keras.
  • cloud-agnostic deployment: You can deploy your machine learning model to AWS, Azure, or GCP.

sklearn-infrastructure's People

Contributors

shilongjaycui avatar

Watchers

Kostas Georgiou avatar  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.