forked from opendatahub-io/odh-manifests
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added TrustyAI service to Manifests, with integration into ModelMesh …
…and ODH-Monitoring
- Loading branch information
Showing
9 changed files
with
279 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# TrustyAI Service | ||
|
||
TrustyAI is a service to provide fairness metrics to ModelMesh served models. | ||
|
||
|
||
### Installation process | ||
|
||
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. | ||
3. Set the `payloadProcessor` value within `model-serving-config-defaults` ConfigMap | ||
to `http://trustyai-service/consumer/kserve/v2` | ||
4. Create a TrustyAI KfDef: | ||
``` | ||
apiVersion: kfdef.apps.kubeflow.org/v1 | ||
kind: KfDef | ||
metadata: | ||
name: trustyai | ||
spec: | ||
applications: | ||
- kustomizeConfig: | ||
repoRef: | ||
name: manifests | ||
path: trustyai-service | ||
name: trustyai | ||
repos: | ||
- name: manifests | ||
uri: https://github.com/red-hat-data-services/odh-manifests/tarball/master | ||
version: master | ||
``` | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
app: trustyai | ||
app.kubernetes.io/part-of: trustyai | ||
resources: | ||
- ../default | ||
- ../servicemonitors | ||
- trustyai-configmap.yaml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: trustyai-config | ||
data: | ||
service_storage_format: "PVC" | ||
service_data_format: "CSV" | ||
service_metrics_schedule: "5s" | ||
service_batch_size: "5000" | ||
storage_data_filename: "data.csv" | ||
storage_data_folder: "/inputs" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- trustyai-deployment.yaml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-url: <<unknown>> | ||
app.quarkus.io/commit-id: 0acbb40970b5c0dd7e5a50966d6b3d68e137be10 | ||
app.quarkus.io/build-timestamp: 2023-02-24 - 13:56:14 +0000 | ||
prometheus.io/scrape: "true" | ||
prometheus.io/path: /q/metrics | ||
prometheus.io/port: "8080" | ||
prometheus.io/scheme: http | ||
labels: | ||
app.kubernetes.io/name: trustyai-service | ||
app.kubernetes.io/version: 0.1.0 | ||
app.openshift.io/runtime: quarkus | ||
name: trustyai-service | ||
spec: | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: 8080 | ||
selector: | ||
app.kubernetes.io/name: trustyai-service | ||
app.kubernetes.io/version: 0.1.0 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-url: <<unknown>> | ||
app.quarkus.io/commit-id: ea73183a2c1b81bd9afe31005644d374b5bdeb34 | ||
app.quarkus.io/build-timestamp: 2023-02-15 - 15:41:47 +0000 | ||
prometheus.io/scrape: "true" | ||
prometheus.io/path: /q/metrics | ||
prometheus.io/port: "8080" | ||
prometheus.io/scheme: http | ||
labels: | ||
app.openshift.io/runtime: quarkus | ||
app.kubernetes.io/version: 0.1.0 | ||
app.kubernetes.io/name: trustyai-service | ||
app.kubernetes.io/version: 0.1.0 | ||
app.openshift.io/runtime: quarkus | ||
name: trustyai-service | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/version: 0.1.0 | ||
app.kubernetes.io/name: trustyai-service | ||
template: | ||
metadata: | ||
annotations: | ||
app.openshift.io/vcs-url: <<unknown>> | ||
app.quarkus.io/commit-id: ea73183a2c1b81bd9afe31005644d374b5bdeb34 | ||
app.quarkus.io/build-timestamp: 2023-02-15 - 15:41:47 +0000 | ||
prometheus.io/scrape: "true" | ||
prometheus.io/path: /q/metrics | ||
prometheus.io/port: "8080" | ||
prometheus.io/scheme: http | ||
labels: | ||
app.openshift.io/runtime: quarkus | ||
app.kubernetes.io/version: 0.1.0 | ||
app.kubernetes.io/name: trustyai-service | ||
spec: | ||
initContainers: | ||
- name: config-map-overrider | ||
image: registry.redhat.io/openshift4/ose-cli@sha256:25fef269ac6e7491cb8340119a9b473acbeb53bc6970ad029fdaae59c3d0ca61 | ||
command: [ "/bin/bash", "-c", "--" ] | ||
args: | ||
- | | ||
# ugly hack: write a configmap that knows its own namespace | ||
echo "apiVersion: v1" > /tmp/model-serving-config.yaml | ||
echo "kind: ConfigMap" >> /tmp/model-serving-config.yaml | ||
echo "metadata:" >> /tmp/model-serving-config.yaml | ||
echo " name: model-serving-config" >> /tmp/model-serving-config.yaml | ||
echo "data:" >> /tmp/model-serving-config.yaml | ||
echo " config.yaml: |" >> /tmp/model-serving-config.yaml | ||
current_namespace=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace) | ||
echo " payloadProcessors: "http://trustyai-service.$current_namespace/consumer/kserve/v2"" >> /tmp/model-serving-config.yaml | ||
cat /tmp/model-serving-config.yaml | ||
oc apply -f /tmp/model-serving-config.yaml | ||
exit 0 | ||
containers: | ||
- env: | ||
- name: STORAGE_DATA_FILENAME | ||
valueFrom: | ||
configMapKeyRef: | ||
key: storage_data_filename | ||
name: trustyai-config | ||
- name: SERVICE_STORAGE_FORMAT | ||
valueFrom: | ||
configMapKeyRef: | ||
key: service_storage_format | ||
name: trustyai-config | ||
- name: STORAGE_DATA_FOLDER | ||
valueFrom: | ||
configMapKeyRef: | ||
key: storage_data_folder | ||
name: trustyai-config | ||
- name: SERVICE_BATCH_SIZE | ||
valueFrom: | ||
configMapKeyRef: | ||
key: service_batch_size | ||
name: trustyai-config | ||
- name: SERVICE_DATA_FORMAT | ||
valueFrom: | ||
configMapKeyRef: | ||
key: service_data_format | ||
name: trustyai-config | ||
- name: SERVICE_METRICS_SCHEDULE | ||
valueFrom: | ||
configMapKeyRef: | ||
key: service_metrics_schedule | ||
name: trustyai-config | ||
image: quay.io/trustyai/trustyai-service:0.1.0 | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /q/health/live | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 0 | ||
periodSeconds: 30 | ||
successThreshold: 1 | ||
timeoutSeconds: 10 | ||
name: trustyai-service | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /q/health/ready | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 0 | ||
periodSeconds: 30 | ||
successThreshold: 1 | ||
timeoutSeconds: 10 | ||
volumeMounts: | ||
- mountPath: /inputs | ||
name: volume | ||
readOnly: false | ||
serviceAccountName: trustyai-serviceaccount | ||
volumes: | ||
- name: volume | ||
persistentVolumeClaim: | ||
claimName: trustyai-service-pvc | ||
readOnly: false | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: trustyai-serviceaccount | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: trustyai-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: trustyai-clusterrolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: trustyai-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: trustyai-serviceaccount |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- trustyai-metrics.yaml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: trustyai-metrics | ||
labels: | ||
modelmesh-service: modelmesh-serving | ||
spec: | ||
endpoints: | ||
- interval: 30s | ||
path: /q/metrics | ||
honorLabels: true | ||
honorTimestamps: true | ||
scrapeTimeout: 10s | ||
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token | ||
bearerTokenSecret: | ||
key: "" | ||
targetPort: 8080 | ||
scheme: http | ||
params: | ||
'match[]': | ||
- '{__name__= "trusty_spd"}' | ||
- '{__name__= "trusty_dir"}' | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: trustyai-service |