1+ apiVersion : v1
2+ kind : Service
3+ metadata :
4+ name : minio-guardrails-guardian
5+ spec :
6+ ports :
7+ - name : minio-client-port
8+ port : 9000
9+ protocol : TCP
10+ targetPort : 9000
11+ selector :
12+ app : minio-guardrails-guardian
13+ ---
14+ apiVersion : v1
15+ kind : PersistentVolumeClaim
16+ metadata :
17+ name : guardrails-models-claim-guardian
18+ spec :
19+ accessModes :
20+ - ReadWriteOnce
21+ volumeMode : Filesystem
22+ # storageClassName: gp3-csi
23+ resources :
24+ requests :
25+ storage : 100Gi
26+ ---
27+ apiVersion : apps/v1
28+ kind : Deployment
29+ metadata :
30+ name : guardrails-container-deployment-guardian # <--- change this
31+ labels :
32+ app : minio-guardrails-guardian # <--- change this to match label on the pod
33+ spec :
34+ replicas : 1
35+ selector :
36+ matchLabels :
37+ app : minio-guardrails-guardian # <--- change this to match label on the pod
38+ template : # => from here down copy and paste the pods metadata: and spec: sections
39+ metadata :
40+ labels :
41+ app : minio-guardrails-guardian
42+ maistra.io/expose-route : ' true'
43+ name : minio-guardrails-guardian
44+ spec :
45+ volumes :
46+ - name : model-volume
47+ persistentVolumeClaim :
48+ claimName : guardrails-models-claim-guardian
49+ initContainers :
50+ - name : download-model
51+ image : quay.io/rgeada/llm_downloader:latest
52+ securityContext :
53+ fsGroup : 1001
54+ command :
55+ - bash
56+ - -c
57+ - |
58+ # model="ibm-granite/granite-guardian-hap-38m"
59+ # model="h2oai/deberta_finetuned_pii"
60+ model="ibm-granite/granite-guardian-3.0-2b"
61+ # model="microsoft/Phi-3-mini-4k-instruct"
62+ echo "starting download"
63+ /tmp/venv/bin/huggingface-cli download $model --local-dir /mnt/models/huggingface/$(basename $model)
64+ echo "Done!"
65+ resources :
66+ limits :
67+ memory : " 2Gi"
68+ cpu : " 2"
69+ volumeMounts :
70+ - mountPath : " /mnt/models/"
71+ name : model-volume
72+ containers :
73+ - args :
74+ - server
75+ - /models
76+ env :
77+ - name : MINIO_ACCESS_KEY
78+ value : THEACCESSKEY
79+ - name : MINIO_SECRET_KEY
80+ value : THESECRETKEY
81+ image : quay.io/trustyai/modelmesh-minio-examples:latest
82+ name : minio
83+ securityContext :
84+ allowPrivilegeEscalation : false
85+ capabilities :
86+ drop :
87+ - ALL
88+ seccompProfile :
89+ type : RuntimeDefault
90+ volumeMounts :
91+ - mountPath : " /models/"
92+ name : model-volume
93+ ---
94+ apiVersion : v1
95+ kind : Secret
96+ metadata :
97+ name : aws-connection-minio-data-connection-guardrails-guardian
98+ labels :
99+ opendatahub.io/dashboard : ' true'
100+ opendatahub.io/managed : ' true'
101+ annotations :
102+ opendatahub.io/connection-type : s3
103+ openshift.io/display-name : Minio Data Connection
104+ data :
105+ AWS_ACCESS_KEY_ID : VEhFQUNDRVNTS0VZ
106+ AWS_DEFAULT_REGION : dXMtc291dGg=
107+ AWS_S3_BUCKET : aHVnZ2luZ2ZhY2U=
108+ AWS_S3_ENDPOINT : aHR0cDovL21pbmlvLWd1YXJkcmFpbHMtZ3VhcmRpYW46OTAwMA==
109+ AWS_SECRET_ACCESS_KEY : VEhFU0VDUkVUS0VZ
110+ type : Opaque
111+ ---
112+ apiVersion : v1
113+ kind : ServiceAccount
114+ metadata :
115+ name : user-one
116+ ---
117+ kind : RoleBinding
118+ apiVersion : rbac.authorization.k8s.io/v1
119+ metadata :
120+ name : user-one-view
121+ subjects :
122+ - kind : ServiceAccount
123+ name : user-one
124+ roleRef :
125+ apiGroup : rbac.authorization.k8s.io
126+ kind : ClusterRole
127+ name : view
0 commit comments