dyff-schema 0.33.0__tar.gz → 0.34.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dyff-schema might be problematic. Click here for more details.
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/.gitlab-ci.yml +2 -2
- {dyff_schema-0.33.0/dyff_schema.egg-info → dyff_schema-0.34.0}/PKG-INFO +1 -1
- dyff_schema-0.34.0/dyff/schema/_version.py +2 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/oci.py +12 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/platform.py +169 -25
- {dyff_schema-0.33.0 → dyff_schema-0.34.0/dyff_schema.egg-info}/PKG-INFO +1 -1
- dyff_schema-0.33.0/dyff/schema/_version.py +0 -2
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/.gitignore +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/.idea/dyff-schema.iml +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/.licenserc.yaml +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/.pre-commit-config.yaml +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/.prettierignore +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/.secrets.baseline +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/CODE_OF_CONDUCT.md +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/LICENSE +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/NOTICE +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/README.md +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/__init__.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/adapters.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/annotations.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/base.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/commands.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/copydoc.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/dataset/__init__.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/dataset/arrow.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/dataset/binary.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/dataset/classification.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/dataset/embedding.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/dataset/text.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/dataset/vision.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/errors.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/ids.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/io/__init__.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/io/vllm.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/platform.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/py.typed +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/quantity.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/requests.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/responses.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/test.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/__init__.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/__init__.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/adapters.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/base.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/commands.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/dataset/binary.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/dataset/classification.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/dataset/embedding.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/dataset/text.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/dataset/vision.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/io/__init__.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/io/vllm.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/requests.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/responses.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/test.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/v0/r1/version.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff/schema/version.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff_schema.egg-info/SOURCES.txt +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff_schema.egg-info/dependency_links.txt +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff_schema.egg-info/requires.txt +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/dyff_schema.egg-info/top_level.txt +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/makefile +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/pyproject.toml +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/setup.cfg +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/tests/test_adapters.py +0 -0
- {dyff_schema-0.33.0 → dyff_schema-0.34.0}/tests/test_import.py +0 -0
|
@@ -8,7 +8,7 @@ stages:
|
|
|
8
8
|
|
|
9
9
|
include:
|
|
10
10
|
- project: saferatday0/library/gitlab
|
|
11
|
-
ref: 0.
|
|
11
|
+
ref: 0.18.3
|
|
12
12
|
file:
|
|
13
13
|
- gitlab-release.yml
|
|
14
14
|
- project: saferatday0/library/detect-secrets
|
|
@@ -20,7 +20,7 @@ include:
|
|
|
20
20
|
file:
|
|
21
21
|
- prettier.yml
|
|
22
22
|
- project: saferatday0/library/python
|
|
23
|
-
ref: 0.
|
|
23
|
+
ref: 0.22.0
|
|
24
24
|
file:
|
|
25
25
|
- python-autoflake.yml
|
|
26
26
|
- python-black.yml
|
|
@@ -181,3 +181,15 @@ class ImageManifest(_OCISchemaBaseModel):
|
|
|
181
181
|
" if .artifactType is unspecified"
|
|
182
182
|
)
|
|
183
183
|
return self
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
__all__ = [
|
|
187
|
+
"Descriptor",
|
|
188
|
+
"ExecutionParameters",
|
|
189
|
+
"HistoryEntry",
|
|
190
|
+
"ImageConfig",
|
|
191
|
+
"ImageDescriptor",
|
|
192
|
+
"ImageManifest",
|
|
193
|
+
"Platform",
|
|
194
|
+
"RootFS",
|
|
195
|
+
]
|
|
@@ -24,6 +24,7 @@ import enum
|
|
|
24
24
|
import urllib.parse
|
|
25
25
|
from datetime import datetime
|
|
26
26
|
from enum import Enum
|
|
27
|
+
from pathlib import Path
|
|
27
28
|
from typing import Any, Literal, NamedTuple, Optional, Type, Union
|
|
28
29
|
|
|
29
30
|
import pyarrow
|
|
@@ -194,7 +195,8 @@ class Entities(str, enum.Enum):
|
|
|
194
195
|
|
|
195
196
|
Account = "Account"
|
|
196
197
|
Analysis = "Analysis"
|
|
197
|
-
|
|
198
|
+
# FIXME: (schema v1) Rename to Artifact
|
|
199
|
+
Artifact = "OCIArtifact"
|
|
198
200
|
Audit = "Audit"
|
|
199
201
|
AuditProcedure = "AuditProcedure"
|
|
200
202
|
Concern = "Concern"
|
|
@@ -262,6 +264,9 @@ class Resources(str, enum.Enum):
|
|
|
262
264
|
@staticmethod
|
|
263
265
|
def for_kind(kind: Entities) -> "Resources":
|
|
264
266
|
try:
|
|
267
|
+
# FIXME: (schema v1) Special case for legacy OCIArtifact name
|
|
268
|
+
if kind == Entities.Artifact:
|
|
269
|
+
return Resources.Artifact
|
|
265
270
|
return Resources[kind.value]
|
|
266
271
|
except KeyError:
|
|
267
272
|
raise ValueError(f"No Resources for Entity kind: {kind}")
|
|
@@ -269,7 +274,6 @@ class Resources(str, enum.Enum):
|
|
|
269
274
|
|
|
270
275
|
EntityKindLiteral = Literal[
|
|
271
276
|
"Analysis",
|
|
272
|
-
"Artifact",
|
|
273
277
|
"Audit",
|
|
274
278
|
"AuditProcedure",
|
|
275
279
|
"DataSource",
|
|
@@ -284,6 +288,8 @@ EntityKindLiteral = Literal[
|
|
|
284
288
|
"Method",
|
|
285
289
|
"Model",
|
|
286
290
|
"Module",
|
|
291
|
+
# FIXME: (schema v1) Rename to Artifact
|
|
292
|
+
"OCIArtifact",
|
|
287
293
|
"Report",
|
|
288
294
|
"Revision",
|
|
289
295
|
"SafetyCase",
|
|
@@ -312,6 +318,9 @@ class EntityIdentifier(DyffSchemaBaseModel):
|
|
|
312
318
|
description="The .kind of the entity.",
|
|
313
319
|
)
|
|
314
320
|
|
|
321
|
+
def resource_path(self) -> str:
|
|
322
|
+
return f"{Resources.for_kind(Entities(self.kind)).value}/{self.id}"
|
|
323
|
+
|
|
315
324
|
|
|
316
325
|
def LabelKey() -> type[str]:
|
|
317
326
|
return Annotated[
|
|
@@ -492,7 +501,6 @@ class DyffEntityMetadata(DyffSchemaBaseModel):
|
|
|
492
501
|
class DyffEntity(Status, Labeled, SchemaVersion, DyffModelWithID):
|
|
493
502
|
kind: Literal[
|
|
494
503
|
"Analysis",
|
|
495
|
-
"Artifact",
|
|
496
504
|
"Audit",
|
|
497
505
|
"AuditProcedure",
|
|
498
506
|
"DataSource",
|
|
@@ -507,6 +515,8 @@ class DyffEntity(Status, Labeled, SchemaVersion, DyffModelWithID):
|
|
|
507
515
|
"Method",
|
|
508
516
|
"Model",
|
|
509
517
|
"Module",
|
|
518
|
+
# FIXME: (schema v1) Rename to Artifact
|
|
519
|
+
"OCIArtifact",
|
|
510
520
|
"Report",
|
|
511
521
|
"Revision",
|
|
512
522
|
"SafetyCase",
|
|
@@ -1076,6 +1086,32 @@ class Dataset(DyffEntity, DatasetBase):
|
|
|
1076
1086
|
return None
|
|
1077
1087
|
|
|
1078
1088
|
|
|
1089
|
+
# ----------------------------------------------------------------------------
|
|
1090
|
+
# Model
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
class File(DyffSchemaBaseModel):
|
|
1094
|
+
mediaType: Optional[str] = pydantic.Field(
|
|
1095
|
+
default=None, description="The media type (MIME type) of the file"
|
|
1096
|
+
)
|
|
1097
|
+
path: str = pydantic.Field(
|
|
1098
|
+
description="The relative path of the file within the containing volume"
|
|
1099
|
+
)
|
|
1100
|
+
digest: Digest = pydantic.Field(
|
|
1101
|
+
default_factory=Digest,
|
|
1102
|
+
description="One or more message digests (hashes) of the file data",
|
|
1103
|
+
)
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
class FileStorageURL(DyffSchemaBaseModel):
|
|
1107
|
+
file: File
|
|
1108
|
+
signedURL: StorageSignedURL
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
class Volume(DyffSchemaBaseModel):
|
|
1112
|
+
files: list[File] = pydantic.Field(description="A list of files in the volume")
|
|
1113
|
+
|
|
1114
|
+
|
|
1079
1115
|
class ModelSourceKinds(str, enum.Enum):
|
|
1080
1116
|
GitLFS = "GitLFS"
|
|
1081
1117
|
HuggingFaceHub = "HuggingFaceHub"
|
|
@@ -1129,10 +1165,6 @@ class ModelSource(DyffSchemaBaseModel):
|
|
|
1129
1165
|
)
|
|
1130
1166
|
|
|
1131
1167
|
|
|
1132
|
-
class ContainerImage(DyffSchemaBaseModel):
|
|
1133
|
-
pass
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
1168
|
class AcceleratorGPU(DyffSchemaBaseModel):
|
|
1137
1169
|
hardwareTypes: list[str] = pydantic.Field(
|
|
1138
1170
|
min_length=1,
|
|
@@ -1154,14 +1186,23 @@ class Accelerator(DyffSchemaBaseModel):
|
|
|
1154
1186
|
)
|
|
1155
1187
|
|
|
1156
1188
|
|
|
1189
|
+
# FIXME: Remove .storage because it's replaced by ScratchVolume, and rename to
|
|
1190
|
+
# ResourceRequirements for consistency with k8s.
|
|
1157
1191
|
class ModelResources(DyffSchemaBaseModel):
|
|
1158
|
-
storage: Quantity = pydantic.Field(
|
|
1159
|
-
|
|
1192
|
+
storage: Optional[Quantity] = pydantic.Field(
|
|
1193
|
+
default=None,
|
|
1194
|
+
deprecated=True,
|
|
1195
|
+
description="Storage required for packaged model, in k8s Quantity notation",
|
|
1160
1196
|
)
|
|
1161
1197
|
|
|
1162
1198
|
memory: Optional[Quantity] = pydantic.Field(
|
|
1163
1199
|
default=None,
|
|
1164
|
-
description="
|
|
1200
|
+
description="Memory, in k8s Quantity notation",
|
|
1201
|
+
)
|
|
1202
|
+
|
|
1203
|
+
cpu: Optional[Quantity] = pydantic.Field(
|
|
1204
|
+
default=None,
|
|
1205
|
+
description="Number of CPUs, in k8s Quantity notation",
|
|
1165
1206
|
)
|
|
1166
1207
|
|
|
1167
1208
|
|
|
@@ -1175,6 +1216,7 @@ class ModelStorageMedium(str, enum.Enum):
|
|
|
1175
1216
|
class ModelArtifactKind(str, enum.Enum):
|
|
1176
1217
|
HuggingFaceCache = "HuggingFaceCache"
|
|
1177
1218
|
Mock = "Mock"
|
|
1219
|
+
Volume = "Volume"
|
|
1178
1220
|
|
|
1179
1221
|
|
|
1180
1222
|
class ModelArtifactHuggingFaceCache(DyffSchemaBaseModel):
|
|
@@ -1194,6 +1236,9 @@ class ModelArtifact(DyffSchemaBaseModel):
|
|
|
1194
1236
|
huggingFaceCache: Optional[ModelArtifactHuggingFaceCache] = pydantic.Field(
|
|
1195
1237
|
default=None, description="Model stored in a HuggingFace cache"
|
|
1196
1238
|
)
|
|
1239
|
+
volume: Optional[Volume] = pydantic.Field(
|
|
1240
|
+
default=None, description="Model stored as a generic volume"
|
|
1241
|
+
)
|
|
1197
1242
|
|
|
1198
1243
|
|
|
1199
1244
|
class ModelStorage(DyffSchemaBaseModel):
|
|
@@ -1245,6 +1290,7 @@ class InferenceServiceBuilder(DyffSchemaBaseModel):
|
|
|
1245
1290
|
|
|
1246
1291
|
class InferenceServiceRunnerKind(str, Enum):
|
|
1247
1292
|
BENTOML_SERVICE_OPENLLM = "bentoml_service_openllm"
|
|
1293
|
+
CONTAINER = "container"
|
|
1248
1294
|
HUGGINGFACE = "huggingface"
|
|
1249
1295
|
MOCK = "mock"
|
|
1250
1296
|
STANDALONE = "standalone"
|
|
@@ -1306,29 +1352,116 @@ class ContainerImageSource(DyffSchemaBaseModel):
|
|
|
1306
1352
|
return v
|
|
1307
1353
|
|
|
1308
1354
|
|
|
1309
|
-
class
|
|
1310
|
-
|
|
1355
|
+
class EnvVar(DyffSchemaBaseModel):
|
|
1356
|
+
name: str
|
|
1357
|
+
value: str
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
# TODO: ModelResources is deprecated
|
|
1361
|
+
ResourceRequirements = ModelResources
|
|
1362
|
+
|
|
1363
|
+
|
|
1364
|
+
class VolumeMountKind(str, enum.Enum):
|
|
1365
|
+
data = "Data"
|
|
1366
|
+
scratch = "Scratch"
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
class VolumeMountData(DyffSchemaBaseModel):
|
|
1370
|
+
source: EntityIdentifier = pydantic.Field(
|
|
1371
|
+
description="The Dyff platform resource to mount."
|
|
1372
|
+
" Must be a volume-like entity such as a Model or Dataset."
|
|
1373
|
+
)
|
|
1374
|
+
|
|
1311
1375
|
|
|
1376
|
+
class VolumeMountScratch(DyffSchemaBaseModel):
|
|
1377
|
+
capacity: Quantity = pydantic.Field(
|
|
1378
|
+
description="Minimum storage capacity of the Scratch volume."
|
|
1379
|
+
)
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
class VolumeMount(DyffSchemaBaseModel):
|
|
1383
|
+
kind: VolumeMountKind = pydantic.Field(description="The kind of volume mount.")
|
|
1384
|
+
name: str = pydantic.Field(description="A descriptive name for the mount.")
|
|
1385
|
+
mountPath: Path = pydantic.Field(
|
|
1386
|
+
description="Where to mount the volume in the running container."
|
|
1387
|
+
" Must be an absolute path."
|
|
1388
|
+
)
|
|
1389
|
+
data: Optional[VolumeMountData] = pydantic.Field(
|
|
1390
|
+
default=None, description="Configuration for Data volume mounts."
|
|
1391
|
+
)
|
|
1392
|
+
scratch: Optional[VolumeMountScratch] = pydantic.Field(
|
|
1393
|
+
default=None, description="Configuration for Scratch volume mounts."
|
|
1394
|
+
)
|
|
1395
|
+
|
|
1396
|
+
|
|
1397
|
+
class Container(DyffSchemaBaseModel):
|
|
1398
|
+
"""Configuration of a runnable container backed by either an image hosted in an
|
|
1399
|
+
external registyr, or an image artifact hosted in the Dyff system.
|
|
1400
|
+
|
|
1401
|
+
This is mostly a subset of the Kubernetes Container schema.
|
|
1402
|
+
"""
|
|
1403
|
+
|
|
1404
|
+
args: Optional[list[str]] = pydantic.Field(
|
|
1405
|
+
default=None,
|
|
1406
|
+
description="Arguments to the entrypoint."
|
|
1407
|
+
" The container image's CMD is used if this is not provided.",
|
|
1408
|
+
)
|
|
1409
|
+
command: Optional[list[str]] = pydantic.Field(
|
|
1410
|
+
default=None,
|
|
1411
|
+
description="Entrypoint array. Not executed within a shell."
|
|
1412
|
+
" The container image's ENTRYPOINT is used if this is not provided.",
|
|
1413
|
+
)
|
|
1414
|
+
env: Optional[list[EnvVar]] = pydantic.Field(
|
|
1415
|
+
default=None,
|
|
1416
|
+
description="List of environment variables to set in the container.",
|
|
1417
|
+
)
|
|
1312
1418
|
# TODO: (DYFF-421) Make .image required
|
|
1313
1419
|
image: Optional[ContainerImageSource] = pydantic.Field(
|
|
1314
1420
|
default=None,
|
|
1315
|
-
description="The container image that implements the runner.
|
|
1316
|
-
"
|
|
1317
|
-
" services with image=None will result in an error.",
|
|
1421
|
+
description="The container image that implements the runner."
|
|
1422
|
+
" Exactly one of .image and .imageRef must be set.",
|
|
1318
1423
|
)
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1424
|
+
imageRef: Optional[EntityIdentifier] = pydantic.Field(
|
|
1425
|
+
default=None,
|
|
1426
|
+
description="Container image reference. Must be an image artifact"
|
|
1427
|
+
" that has been uploaded to this Dyff instance and is in Ready status."
|
|
1428
|
+
" Exactly one of .image and .imageRef must be set.",
|
|
1429
|
+
)
|
|
1430
|
+
resources: ResourceRequirements = pydantic.Field(
|
|
1431
|
+
description="Compute Resources required by this container."
|
|
1432
|
+
)
|
|
1433
|
+
volumeMounts: Optional[list[VolumeMount]] = pydantic.Field(
|
|
1434
|
+
default=None, description="Volumes to mount into the container's filesystem."
|
|
1435
|
+
)
|
|
1436
|
+
workingDir: Optional[Path] = pydantic.Field(
|
|
1437
|
+
default=None,
|
|
1438
|
+
description="Container's working directory. If not specified,"
|
|
1439
|
+
" the container runtime's default will be used,"
|
|
1440
|
+
" which might be configured in the container image.",
|
|
1322
1441
|
)
|
|
1323
1442
|
|
|
1443
|
+
@pydantic.model_validator(mode="after")
|
|
1444
|
+
def check_image_exactly_one(cls, values):
|
|
1445
|
+
image = values.image is not None
|
|
1446
|
+
imageRef = values.imageRef is not None
|
|
1447
|
+
if sum([image, imageRef]) != 1:
|
|
1448
|
+
raise ValueError("must specify exactly one of {image, imageRef}")
|
|
1449
|
+
return values
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
class InferenceServiceRunner(Container):
|
|
1453
|
+
"""Configuration of a managed runner to use to run an inference service.
|
|
1454
|
+
|
|
1455
|
+
Using a managed runner simplifies the configuration of inference services backed by
|
|
1456
|
+
models in common formats, such as HuggingFace models.
|
|
1457
|
+
"""
|
|
1458
|
+
|
|
1459
|
+
kind: InferenceServiceRunnerKind
|
|
1460
|
+
|
|
1324
1461
|
accelerator: Optional[Accelerator] = pydantic.Field(
|
|
1325
1462
|
default=None, description="Optional accelerator hardware to use, per node."
|
|
1326
1463
|
)
|
|
1327
1464
|
|
|
1328
|
-
resources: ModelResources = pydantic.Field(
|
|
1329
|
-
description="Resource requirements to run the service, per node."
|
|
1330
|
-
)
|
|
1331
|
-
|
|
1332
1465
|
nodes: int = pydantic.Field(
|
|
1333
1466
|
default=1,
|
|
1334
1467
|
ge=1,
|
|
@@ -1366,7 +1499,9 @@ class InferenceServiceBase(DyffSchemaBaseModel):
|
|
|
1366
1499
|
|
|
1367
1500
|
# FIXME: (DYFF-261) .runner should be required
|
|
1368
1501
|
runner: Optional[InferenceServiceRunner] = pydantic.Field(
|
|
1369
|
-
default=None,
|
|
1502
|
+
default=None,
|
|
1503
|
+
description="Configuration of the managed runner used to run the service."
|
|
1504
|
+
" Only one of .container or .runner may be specified.",
|
|
1370
1505
|
)
|
|
1371
1506
|
|
|
1372
1507
|
interface: InferenceInterface = pydantic.Field(
|
|
@@ -2146,8 +2281,8 @@ class Score(ScoreData):
|
|
|
2146
2281
|
|
|
2147
2282
|
|
|
2148
2283
|
# TODO: (schema-v1) Rename this to Artifact
|
|
2149
|
-
class OCIArtifact(
|
|
2150
|
-
kind: Literal["
|
|
2284
|
+
class OCIArtifact(DyffEntity):
|
|
2285
|
+
kind: Literal["OCIArtifact"] = Entities.Artifact.value
|
|
2151
2286
|
|
|
2152
2287
|
manifest: oci.ImageManifest = pydantic.Field(
|
|
2153
2288
|
description="The OCI image manifest of the artifact"
|
|
@@ -2519,6 +2654,7 @@ __all__ = [
|
|
|
2519
2654
|
"AuditRequirement",
|
|
2520
2655
|
"Concern",
|
|
2521
2656
|
"ConcernBase",
|
|
2657
|
+
"Container",
|
|
2522
2658
|
"ContainerImageSource",
|
|
2523
2659
|
"DataSchema",
|
|
2524
2660
|
"Dataset",
|
|
@@ -2552,6 +2688,8 @@ __all__ = [
|
|
|
2552
2688
|
"FamilyMemberBase",
|
|
2553
2689
|
"FamilyMemberKind",
|
|
2554
2690
|
"FamilyMembers",
|
|
2691
|
+
"File",
|
|
2692
|
+
"FileStorageURL",
|
|
2555
2693
|
"ForeignInferenceService",
|
|
2556
2694
|
"ForeignMethod",
|
|
2557
2695
|
"ForeignModel",
|
|
@@ -2616,6 +2754,7 @@ __all__ = [
|
|
|
2616
2754
|
"Report",
|
|
2617
2755
|
"ReportBase",
|
|
2618
2756
|
"Resources",
|
|
2757
|
+
"ResourceRequirements",
|
|
2619
2758
|
"Revision",
|
|
2620
2759
|
"RevisionData",
|
|
2621
2760
|
"RevisionMetadata",
|
|
@@ -2634,6 +2773,11 @@ __all__ = [
|
|
|
2634
2773
|
"TagNameType",
|
|
2635
2774
|
"TaskSchema",
|
|
2636
2775
|
"UseCase",
|
|
2776
|
+
"Volume",
|
|
2777
|
+
"VolumeMount",
|
|
2778
|
+
"VolumeMountData",
|
|
2779
|
+
"VolumeMountKind",
|
|
2780
|
+
"VolumeMountScratch",
|
|
2637
2781
|
"entity_class",
|
|
2638
2782
|
"JobStatus",
|
|
2639
2783
|
"EntityStatus",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|