Skip to content

Commit

Permalink
[cherry-pick]Replace old model-mesh manifests to new manifests openda…
Browse files Browse the repository at this point in the history
…tahub-io#815

Signed-off-by: jooho <[email protected]>
  • Loading branch information
Jooho committed Jun 14, 2023
1 parent eef2929 commit 6eedee5
Show file tree
Hide file tree
Showing 134 changed files with 1,319 additions and 405 deletions.
4 changes: 2 additions & 2 deletions kfdef/kfctl_openshift_modh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ spec:
path: odhargo/odhargo
name: odhargo
- kustomizeConfig:
overlays:
- odh-model-controller
- name: monitoring-namespace
value: redhat-ods-monitoring
repoRef:
name: manifests
path: model-mesh
Expand Down
71 changes: 71 additions & 0 deletions kfdef/odh-core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
apiVersion: kfdef.apps.kubeflow.org/v1
kind: KfDef
metadata:
name: odh-core
spec:
applications:
- kustomizeConfig:
repoRef:
name: manifests
path: odh-common
name: odh-common
- kustomizeConfig:
repoRef:
name: manifests
path: odh-dashboard
name: odh-dashboard
- kustomizeConfig:
repoRef:
name: manifests
path: prometheus/cluster
name: prometheus-cluster
- kustomizeConfig:
repoRef:
name: manifests
path: prometheus/operator
name: prometheus-operator
- kustomizeConfig:
repoRef:
name: manifests
path: grafana/cluster
name: grafana-cluster
- kustomizeConfig:
repoRef:
name: manifests
path: grafana/grafana
name: grafana-instance
- kustomizeConfig:
repoRef:
name: manifests
path: odh-notebook-controller
name: odh-notebook-controller
- kustomizeConfig:
repoRef:
name: manifests
path: notebook-images
name: notebook-images
- kustomizeConfig:
parameters:
- name: monitoring-namespace
value: opendatahub
repoRef:
name: manifests
path: model-mesh
name: model-mesh
- kustomizeConfig:
parameters:
- name: deployment-namespace
value: opendatahub
repoRef:
name: manifests
path: modelmesh-monitoring
name: modelmesh-monitoring
- kustomizeConfig:
repoRef:
name: manifests
path: data-science-pipelines-operator/
name: data-science-pipelines-operator
repos:
- name: manifests
uri: https://github.com/opendatahub-io/odh-manifests/tarball/master
version: master
13 changes: 10 additions & 3 deletions model-mesh/OWNERS
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
approvers:
- anishasthana
- Jooho
- anishasthana
- danielezonca
- heyselbi
- israel-hdez
- Jooho
- VedantMahabaleshwarkar
- Xaenalt

reviewers:
- anishasthana
- danielezonca
- heyselbi
- israel-hdez
- Jooho
- Xaenalt
- VedantMahabaleshwarkar
- Xaenalt
29 changes: 19 additions & 10 deletions model-mesh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,39 @@ Model Mesh Serving comes with 1 components:

## modelmesh

Contains deployment manifests for the model mesh service.
Contains deployment manifests for the model mesh service and odh model controller.

- [odh-modelmesh-controller](https://github.com/opendatahub-io/modelmesh-serving)
- Forked upstream kserve/modelmesh-serving repository
- [odh-model-controller](https://github.com/opendatahub-io/odh-model-controller)
- Controller to manage ingress service of Model Mesh.

## Model Mesh Serving Architecture

A complete architecture can be found at https://github.com/kserve/modelmesh-serving

In general, Model Mesh Serving deploys a controller that works on the ServingRuntime and Predictor CRDs. There are many
supported ServingRuntimes that support different model types. When a ServingRuntime is created/installed, you can then
create a predictor instance to serve the model described in that predictor. Briefly, the predictor definition includes
an S3 storage location for that model as well as the credentials to fetch it. Also included in the predictor definition
In general, Model Mesh Serving deploys a controller that works on the ServingRuntime and Predictor CRDs. There are many
supported ServingRuntimes that support different model types. When a ServingRuntime is created/installed, you can then
create a predictor instance to serve the model described in that predictor. Briefly, the predictor definition includes
an S3 storage location for that model as well as the credentials to fetch it. Also included in the predictor definition
is the model type, which is used by the controller to map to the appropriate serving runtime.

The models being served can be reached via both gRPC (natively) and REST (via provided proxy).

### Parameters

None
You can set images though `parameters`.

- odh-mm-rest-proxy
- odh-modelmesh-runtime-adapter
- odh-modelmesh
- odh-openvino
- odh-modelmesh-controller
- odh-model-controller

##### Examples

Example ServingRuntime and Predictors can be found at: https://github.com/kserve/modelmesh-serving/blob/main/docs/quickstart.md
Example ServingRuntime and Predictors can be found at: https://github.com/kserve/modelmesh-serving/blob/main/docs/quickstart.md

### Overlays

Expand All @@ -39,7 +50,7 @@ Following are the steps to install Model Mesh as a part of OpenDataHub install:

1. Install the OpenDataHub operator
2. Create a KfDef that includes the model-mesh component with the odh-model-controller overlay.

```
apiVersion: kfdef.apps.kubeflow.org/v1
kind: KfDef
Expand All @@ -54,8 +65,6 @@ spec:
path: odh-common
name: odh-common
- kustomizeConfig:
overlays:
- odh-model-controller
repoRef:
name: manifests
path: model-mesh
Expand Down
82 changes: 40 additions & 42 deletions model-mesh/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,75 +1,73 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../odh-modelmesh-controller/overlays/odh
- ../odh-model-controller/overlays/odh

commonLabels:
app: model-mesh
app.kubernetes.io/part-of: model-mesh
resources:
- ../default
- ../dependencies/quickstart.yaml
- ../dependencies/scripts
- ../prometheus
namespace: opendatahub
configMapGenerator:
- name: mesh-parameters
envs:
- envs:
- params.env
name: mesh-parameters
generatorOptions:
disableNameSuffixHash: true

vars:
- name: meshnamespace
- fieldref:
fieldPath: metadata.namespace
name: mesh-namespace
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
apiVersion: v1
fieldref:
fieldpath: metadata.namespace
- name: monitoring-namespace
- fieldref:
fieldPath: data.monitoring-namespace
name: monitoring-namespace
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
apiVersion: v1
fieldref:
fieldpath: data.monitoring-namespace
- name: odh-modelmesh
- fieldref:
fieldPath: data.odh-modelmesh
name: odh-modelmesh
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
apiVersion: v1
fieldref:
fieldpath: data.odh-modelmesh
- name: odh-mm-rest-proxy
- fieldref:
fieldPath: data.odh-mm-rest-proxy
name: odh-mm-rest-proxy
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
apiVersion: v1
fieldref:
fieldpath: data.odh-mm-rest-proxy
- name: odh-modelmesh-runtime-adapter
- fieldref:
fieldPath: data.odh-modelmesh-runtime-adapter
name: odh-modelmesh-runtime-adapter
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
apiVersion: v1
fieldref:
fieldpath: data.odh-modelmesh-runtime-adapter
- name: odh-modelmesh-controller
- fieldref:
fieldPath: data.odh-modelmesh-controller
name: odh-modelmesh-controller
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
apiVersion: v1
fieldref:
fieldpath: data.odh-modelmesh-controller
- name: odh-model-controller
- fieldref:
fieldPath: data.odh-model-controller
name: odh-model-controller
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
apiVersion: v1
fieldref:
fieldpath: data.odh-model-controller
- name: odh-openvino
- fieldref:
fieldPath: data.odh-openvino
name: odh-openvino
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
apiVersion: v1
fieldref:
fieldpath: data.odh-openvino
configurations:
- params.yaml
7 changes: 3 additions & 4 deletions model-mesh/base/params.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
meshnamespace=
monitoring-namespace=
odh-mm-rest-proxy=quay.io/opendatahub/rest-proxy:v0.11.0-alpha
monitoring-namespace=opendatahub
odh-mm-rest-proxy=quay.io/opendatahub/rest-proxy:v0.10.0
odh-modelmesh-runtime-adapter=quay.io/opendatahub/modelmesh-runtime-adapter:v0.11.0-alpha
odh-modelmesh=quay.io/opendatahub/modelmesh:v0.11.0-alpha
odh-openvino=quay.io/opendatahub/openvino_model_server:2022.3-gpu
odh-modelmesh-controller=quay.io/opendatahub/modelmesh-controller:v0.11.0-alpha
odh-model-controller=quay.io/opendatahub/odh-model-controller:v0.9.6-auth
odh-model-controller=quay.io/opendatahub/odh-model-controller:v0.11.0-alpha
11 changes: 0 additions & 11 deletions model-mesh/base/params.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions model-mesh/odh-model-controller/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../default
- ../prometheus
3 changes: 3 additions & 0 deletions model-mesh/odh-model-controller/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bases:
- ../rbac
- ../manager
10 changes: 10 additions & 0 deletions model-mesh/odh-model-controller/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resources:
- manager.yaml

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- files:
- controller_manager_config.yaml
name: manager-config
55 changes: 55 additions & 0 deletions model-mesh/odh-model-controller/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: odh-model-controller
labels:
control-plane: odh-model-controller
app: odh-model-controller
spec:
selector:
matchLabels:
control-plane: odh-model-controller
replicas: 3
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: odh-model-controller
app: odh-model-controller
spec:
securityContext:
runAsNonRoot: true
containers:
- command:
- /manager
args:
- --leader-elect
image: controller:latest
name: manager
imagePullPolicy: Always
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
# TODO(user): Configure the resources accordingly based on the project requirements.
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
limits:
cpu: 500m
memory: 2Gi
requests:
cpu: 10m
memory: 64Mi
serviceAccountName: odh-model-controller
terminationGracePeriodSeconds: 10
12 changes: 12 additions & 0 deletions model-mesh/odh-model-controller/overlays/odh/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base

patchesStrategicMerge:
- odh_model_controller_manager_patch.yaml
commonLabels:
app.kubernetes.io/managed-by: odh-model-controller

configurations:
- params.yaml
Loading

0 comments on commit 6eedee5

Please sign in to comment.