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
kind: AuthorizationPolicy | |
apiVersion: security.istio.io/v1beta1 | |
metadata: | |
name: allow-to-example-model | |
namespace: example-model | |
spec: | |
action: ALLOW | |
rules: | |
- when: | |
- key: "request.auth.claims[email]" |
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
kind: RequestAuthentication | |
apiVersion: security.istio.io/v1beta1 | |
metadata: | |
name: enforce-jwt-for-apis | |
namespace: api | |
spec: | |
jwtRules: | |
- audiences: | |
- ml | |
fromHeaders: |
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
- name: ISTIO_ENABLED | |
value: 'true' | |
- name: ISTIO_GATEWAY | |
value: api/seldon-gateway | |
- name: ISTIO_TLS_MODE | |
value: STRICT |
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
apiVersion: machinelearning.seldon.io/v1alpha2 | |
kind: SeldonDeployment | |
metadata: | |
name: example | |
namespace: example-model | |
spec: | |
name: example | |
predictors: | |
- componentSpecs: | |
- spec: |
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
from sklearn.ensemble import RandomForestClassifier | |
from sklearn import datasets | |
import bentoml | |
from bentoml.adapters import DataframeInput | |
from bentoml.frameworks.sklearn import SklearnModelArtifact | |
def train(): | |
iris = datasets.load_iris() | |
X = iris.data | |
y = iris.target |
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 joblib | |
from flask import Flask, request | |
import numpy as np | |
import os | |
app = Flask(__name__) | |
model = None | |
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
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: training-job | |
spec: | |
template: | |
spec: | |
containers: | |
- name: train-model | |
image: bdrci/k8s-model-trainer |
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
from sklearn import datasets | |
from sklearn import svm | |
import joblib | |
def train(data): | |
clf = svm.SVC(gamma=0.001, C=100.) | |
clf.fit(data.data[:-1], data.target[:-1]) | |
return clf |
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
time_created: 2018-02-21T13:21:34.12 | |
flavors: | |
sklearn: | |
sklearn_version: 0.19.1 | |
pickled_model: model.pkl | |
python_function: | |
loader_module: mlflow.sklearn | |
pickled_model: model.pkl |
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
name: My Project | |
conda_env: conda.yaml | |
entry_points: | |
main: | |
parameters: | |
data_file: path | |
regularization: {type: float, default: 0.1} | |
command: "python train.py -r {regularization} {data_file}" | |
validate: | |
parameters: |
NewerOlder