This file contains hidden or 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
| flask | |
| flask-restful | |
| joblib |
This file contains hidden or 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
| FROM jupyter/scipy-notebook | |
| RUN mkdir my-model | |
| ENV MODEL_DIR=/home/jovyan/my-model | |
| ENV MODEL_FILE=svc_model.model | |
| COPY requirements.txt ./requirements.txt | |
| RUN pip install -r requirements.txt | |
| COPY train.py ./train.py |
This file contains hidden or 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 os | |
| from sklearn import svm | |
| from joblib import dump, load | |
| from sklearn.model_selection import train_test_split | |
| from sklearn.datasets import load_iris | |
| from joblib import load | |
| from flask import Flask | |
| # Set environnment variables |
This file contains hidden or 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 os | |
| from sklearn import svm | |
| from joblib import dump, load | |
| from sklearn.model_selection import train_test_split | |
| from sklearn.datasets import load_iris | |
| def train(): | |
| # Load directory paths for persisting model | |
| MODEL_DIR = os.environ["MODEL_DIR"] |
This file contains hidden or 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
| apiVersion: kustomize.config.k8s.io/v1beta1 | |
| kind: Kustomization | |
| resources: | |
| - namespace.yaml | |
| - deployment.yaml | |
| - service_port.yaml | |
| - service.yaml |
This file contains hidden or 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
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: nodeport | |
| spec: | |
| type: NodePort | |
| ports: | |
| - port: 32743 |
This file contains hidden or 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
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: my-app | |
| labels: | |
| app: my-app | |
| namespace: mlapi | |
| spec: | |
| type: LoadBalancer | |
| ports: |
This file contains hidden or 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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| labels: | |
| app: my-app | |
| env: qa | |
| name: my-app | |
| namespace: mlapi | |
| spec: | |
| replicas: 1 # Creating PODs for our app |
This file contains hidden or 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
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: | |
| name: mlapi |
This file contains hidden or 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
| FROM jupyter/scipy-notebook | |
| RUN mkdir my-model | |
| ENV MODEL_DIR=/home/jovyan/my-model | |
| ENV MODEL_FILE=svc_model.model | |
| COPY requirements.txt ./requirements.txt | |
| RUN pip install -r requirements.txt | |
| COPY train.py ./train.py |
NewerOlder