forked from opendatahub-io/opendatahub-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
290 lines (215 loc) · 9.14 KB
/
constants.py
File metadata and controls
290 lines (215 loc) · 9.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
from typing import Any
from ocp_resources.resource import Resource
class KServeDeploymentType:
SERVERLESS: str = "Serverless"
RAW_DEPLOYMENT: str = "RawDeployment"
MODEL_MESH: str = "ModelMesh"
class ModelFormat:
CAIKIT: str = "caikit"
ONNX: str = "onnx"
OPENVINO: str = "openvino"
OVMS: str = "ovms"
VLLM: str = "vllm"
TENSORFLOW: str = "tensorflow"
PYTORCH: str = "pytorch"
class ModelName:
FLAN_T5_SMALL: str = "flan-t5-small"
FLAN_T5_SMALL_HF: str = f"{FLAN_T5_SMALL}-hf"
CAIKIT_BGE_LARGE_EN: str = f"bge-large-en-v1.5-{ModelFormat.CAIKIT}"
BLOOM_560M: str = "bloom-560m"
MNIST: str = "mnist"
class ModelAndFormat:
FLAN_T5_SMALL_CAIKIT: str = f"{ModelName.FLAN_T5_SMALL}-{ModelFormat.CAIKIT}"
OPENVINO_IR: str = f"{ModelFormat.OPENVINO}_ir"
KSERVE_OPENVINO_IR: str = f"{OPENVINO_IR}_kserve"
ONNX_1: str = f"{ModelFormat.ONNX}-1"
BLOOM_560M_CAIKIT: str = f"bloom-560m-{ModelFormat.CAIKIT}"
class ModelStoragePath:
FLAN_T5_SMALL_CAIKIT: str = f"{ModelName.FLAN_T5_SMALL}/{ModelAndFormat.FLAN_T5_SMALL_CAIKIT}"
OPENVINO_EXAMPLE_MODEL: str = f"{ModelFormat.OPENVINO}-example-model"
KSERVE_OPENVINO_EXAMPLE_MODEL: str = f"kserve-openvino-test/{OPENVINO_EXAMPLE_MODEL}"
EMBEDDING_MODEL: str = "embeddingsmodel"
TENSORFLOW_MODEL: str = "inception_resnet_v2.pb"
OPENVINO_VEHICLE_DETECTION: str = "vehicle-detection"
FLAN_T5_SMALL_HF: str = f"{ModelName.FLAN_T5_SMALL}/{ModelName.FLAN_T5_SMALL_HF}"
BLOOM_560M_CAIKIT: str = f"{ModelName.BLOOM_560M}/{ModelAndFormat.BLOOM_560M_CAIKIT}"
MNIST_8_ONNX: str = f"{ModelName.MNIST}-8.onnx"
DOG_BREED_ONNX: str = "dog_breed_classification"
CAT_DOG_ONNX: str = "cat_dog_classification"
class CurlOutput:
HEALTH_OK: str = "OK"
class ModelEndpoint:
HEALTH: str = "health"
class ModelVersion:
OPSET1: str = "opset1"
OPSET13: str = "opset13"
class RuntimeTemplates:
CAIKIT_TGIS_SERVING: str = "caikit-tgis-serving-template"
OVMS_MODEL_MESH: str = ModelFormat.OVMS
OVMS_KSERVE: str = f"kserve-{ModelFormat.OVMS}"
CAIKIT_STANDALONE_SERVING: str = "caikit-standalone-serving-template"
TGIS_GRPC_SERVING: str = "tgis-grpc-serving-template"
VLLM_CUDA: str = "vllm-cuda-runtime-template"
VLLM_ROCM: str = "vllm-rocm-runtime-template"
VLLM_GAUDUI: str = "vllm-gaudi-runtime-template"
class ModelInferenceRuntime:
TGIS_RUNTIME: str = "tgis-runtime"
CAIKIT_TGIS_RUNTIME: str = f"{ModelFormat.CAIKIT}-{TGIS_RUNTIME}"
OPENVINO_RUNTIME: str = f"{ModelFormat.OPENVINO}-runtime"
OPENVINO_KSERVE_RUNTIME: str = f"{ModelFormat.OPENVINO}-kserve-runtime"
ONNX_RUNTIME: str = f"{ModelFormat.ONNX}-runtime"
CAIKIT_STANDALONE_RUNTIME: str = f"{ModelFormat.CAIKIT}-standalone-runtime"
VLLM_RUNTIME: str = f"{ModelFormat.VLLM}-runtime"
TENSORFLOW_RUNTIME: str = f"{ModelFormat.TENSORFLOW}-runtime"
class Protocols:
HTTP: str = "http"
HTTPS: str = "https"
GRPC: str = "grpc"
REST: str = "rest"
TCP: str = "TCP"
TCP_PROTOCOLS: set[str] = {HTTP, HTTPS}
ALL_SUPPORTED_PROTOCOLS: set[str] = TCP_PROTOCOLS.union({GRPC})
class Ports:
GRPC_PORT: int = 8033
REST_PORT: int = 8080
class PortNames:
REST_PORT_NAME: str = "http1"
GRPC_PORT_NAME: str = "h2c"
class HTTPRequest:
# Use string formatting to set the token value when using this constant
AUTH_HEADER: str = "-H 'Authorization: Bearer {token}'"
CONTENT_JSON: str = "-H 'Content-Type: application/json'"
class AcceleratorType:
NVIDIA: str = "nvidia"
AMD: str = "amd"
GAUDI: str = "gaudi"
SUPPORTED_LISTS: list[str] = [NVIDIA, AMD, GAUDI]
class ApiGroups:
OPENDATAHUB_IO: str = "opendatahub.io"
class Annotations:
class KubernetesIo:
NAME: str = f"{Resource.ApiGroup.APP_KUBERNETES_IO}/name"
INSTANCE: str = f"{Resource.ApiGroup.APP_KUBERNETES_IO}/instance"
PART_OF: str = f"{Resource.ApiGroup.APP_KUBERNETES_IO}/part-of"
CREATED_BY: str = f"{Resource.ApiGroup.APP_KUBERNETES_IO}/created-by"
class KserveIo:
DEPLOYMENT_MODE: str = "serving.kserve.io/deploymentMode"
class KserveAuth:
SECURITY: str = f"security.{ApiGroups.OPENDATAHUB_IO}/enable-auth"
class OpenDataHubIo:
MANAGED: str = f"{ApiGroups.OPENDATAHUB_IO}/managed"
SERVICE_MESH: str = f"{ApiGroups.OPENDATAHUB_IO}/service-mesh"
class StorageClassName:
NFS: str = "nfs"
class DscComponents:
MODELMESHSERVING: str = "modelmeshserving"
KSERVE: str = "kserve"
MODELREGISTRY: str = "modelregistry"
class ManagementState:
MANAGED: str = "Managed"
REMOVED: str = "Removed"
class ConditionType:
MODEL_REGISTRY_READY: str = "ModelRegistryReady"
KSERVE_READY: str = "KserveReady"
MODEL_MESH_SERVING_READY: str = "ModelMeshServingReady"
COMPONENT_MAPPING: dict[str, str] = {
MODELMESHSERVING: ConditionType.MODEL_MESH_SERVING_READY,
KSERVE: ConditionType.KSERVE_READY,
MODELREGISTRY: ConditionType.MODEL_REGISTRY_READY,
}
class Labels:
class OpenDataHub:
DASHBOARD: str = f"{ApiGroups.OPENDATAHUB_IO}/dashboard"
class KserveAuth:
SECURITY: str = f"security.{ApiGroups.OPENDATAHUB_IO}/enable-auth"
class Notebook:
INJECT_OAUTH: str = f"notebooks.{ApiGroups.OPENDATAHUB_IO}/inject-oauth"
class OpenDataHubIo:
MANAGED: str = Annotations.OpenDataHubIo.MANAGED
NAME: str = f"component.{ApiGroups.OPENDATAHUB_IO}/name"
class Openshift:
APP: str = "app"
class Kserve:
NETWORKING_KSERVE_IO: str = "networking.kserve.io/visibility"
NETWORKING_KNATIVE_IO: str = "networking.knative.dev/visibility"
EXPOSED: str = "exposed"
class Nvidia:
NVIDIA_COM_GPU: str = "nvidia.com/gpu"
class Kueue:
# TODO: Change to kueue.openshift.io/managed once it's working
MANAGED: str = "kueue-managed"
# MANAGED: str = "kueue.openshift.io/managed"
class Timeout:
TIMEOUT_15_SEC: int = 15
TIMEOUT_30SEC: int = 30
TIMEOUT_1MIN: int = 60
TIMEOUT_2MIN: int = 2 * TIMEOUT_1MIN
TIMEOUT_4MIN: int = 4 * TIMEOUT_1MIN
TIMEOUT_5MIN: int = 5 * TIMEOUT_1MIN
TIMEOUT_10MIN: int = 10 * TIMEOUT_1MIN
TIMEOUT_15MIN: int = 15 * TIMEOUT_1MIN
TIMEOUT_20MIN: int = 20 * TIMEOUT_1MIN
class Containers:
KSERVE_CONTAINER_NAME: str = "kserve-container"
class RunTimeConfigs:
ONNX_OPSET13_RUNTIME_CONFIG: dict[str, Any] = {
"runtime-name": ModelInferenceRuntime.ONNX_RUNTIME,
"model-format": {ModelFormat.ONNX: ModelVersion.OPSET13},
}
class ModelCarImage:
MNIST_8_1: str = (
"oci://quay.io/mwaykole/test@sha256:8a3217bcfa2cc5fa3d07496cff8b234acdf2c9725dd307dc0a80401f55e1a11c" # noqa: E501
)
class MinIo:
class Metadata:
NAME: str = "minio"
DEFAULT_PORT: int = 9000
DEFAULT_ENDPOINT: str = f"{Protocols.HTTP}://{NAME}:{DEFAULT_PORT}"
class Credentials:
ACCESS_KEY_NAME: str = "MINIO_ROOT_USER"
ACCESS_KEY_VALUE: str = "THEACCESSKEY"
SECRET_KEY_NAME: str = "MINIO_ROOT_PASSWORD"
SECRET_KEY_VALUE: str = "THESECRETKEY"
class Buckets:
EXAMPLE_MODELS: str = "example-models"
MODELMESH_EXAMPLE_MODELS: str = f"modelmesh-{EXAMPLE_MODELS}"
class PodConfig:
KSERVE_MINIO_IMAGE: str = (
"quay.io/jooholee/model-minio@sha256:b50aa0fbfea740debb314ece8e925b3e8e761979f345b6cd12a6833efd04e2c2" # noqa: E501
)
MINIO_BASE_CONFIG: dict[str, Any] = {
"args": ["server", "/data1"],
"labels": {
"maistra.io/expose-route": "true",
},
"annotations": {
"sidecar.istio.io/inject": "true",
},
}
MODEL_MESH_MINIO_CONFIG: dict[str, Any] = {
"image": "quay.io/trustyai_testing/modelmesh-minio-examples@sha256:d2ccbe92abf9aa5085b594b2cae6c65de2bf06306c30ff5207956eb949bb49da", # noqa: E501
**MINIO_BASE_CONFIG,
}
KSERVE_MINIO_CONFIG: dict[str, Any] = {
"image": KSERVE_MINIO_IMAGE,
**MINIO_BASE_CONFIG,
}
class RunTimeConfig:
# TODO: Remove runtime_image once ovms/loan_model_alpha model works with latest ovms
IMAGE = "quay.io/opendatahub/openvino_model_server@sha256:564664371d3a21b9e732a5c1b4b40bacad714a5144c0a9aaf675baec4a04b148" # noqa: E501
MODEL_REGISTRY: str = "model-registry"
MODELMESH_SERVING: str = "modelmesh-serving"
ISTIO_CA_BUNDLE_FILENAME: str = "istio_knative.crt"
OPENSHIFT_CA_BUNDLE_FILENAME: str = "openshift_ca.crt"
INTERNAL_IMAGE_REGISTRY_PATH: str = "image-registry.openshift-image-registry.svc:5000"
vLLM_CONFIG: dict[str, dict[str, Any]] = {
"port_configurations": {
"grpc": [{"containerPort": Ports.GRPC_PORT, "name": PortNames.GRPC_PORT_NAME, "protocol": Protocols.TCP}],
"raw": [
{"containerPort": Ports.REST_PORT, "name": PortNames.REST_PORT_NAME, "protocol": Protocols.TCP},
{"containerPort": Ports.GRPC_PORT, "name": PortNames.GRPC_PORT_NAME, "protocol": Protocols.TCP},
],
},
"commands": {"GRPC": "vllm_tgis_adapter"},
}
RHOAI_OPERATOR_NAMESPACE = "redhat-ods-operator"