dyff-schema 0.9.1__py3-none-any.whl → 0.10.1__py3-none-any.whl
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.
- dyff/schema/v0/r1/platform.py +68 -0
- dyff/schema/v0/r1/requests.py +10 -0
- {dyff_schema-0.9.1.dist-info → dyff_schema-0.10.1.dist-info}/METADATA +1 -1
- {dyff_schema-0.9.1.dist-info → dyff_schema-0.10.1.dist-info}/RECORD +8 -8
- {dyff_schema-0.9.1.dist-info → dyff_schema-0.10.1.dist-info}/LICENSE +0 -0
- {dyff_schema-0.9.1.dist-info → dyff_schema-0.10.1.dist-info}/NOTICE +0 -0
- {dyff_schema-0.9.1.dist-info → dyff_schema-0.10.1.dist-info}/WHEEL +0 -0
- {dyff_schema-0.9.1.dist-info → dyff_schema-0.10.1.dist-info}/top_level.txt +0 -0
dyff/schema/v0/r1/platform.py
CHANGED
|
@@ -18,6 +18,7 @@ We use the following naming convention:
|
|
|
18
18
|
# mypy: disable-error-code="import-untyped"
|
|
19
19
|
import abc
|
|
20
20
|
import enum
|
|
21
|
+
import urllib.parse
|
|
21
22
|
from datetime import datetime
|
|
22
23
|
from enum import Enum
|
|
23
24
|
from typing import Any, Literal, NamedTuple, Optional, Type, Union
|
|
@@ -998,8 +999,74 @@ class InferenceServiceRunnerKind(str, Enum):
|
|
|
998
999
|
VLLM = "vllm"
|
|
999
1000
|
|
|
1000
1001
|
|
|
1002
|
+
class ContainerImageSource(DyffSchemaBaseModel):
|
|
1003
|
+
host: str = pydantic.Field(description="The host of the container image registry.")
|
|
1004
|
+
name: str = pydantic.Field(
|
|
1005
|
+
description="The name of the image",
|
|
1006
|
+
# https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pull
|
|
1007
|
+
regex=r"^[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*(\/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*$",
|
|
1008
|
+
)
|
|
1009
|
+
digest: str = pydantic.Field(
|
|
1010
|
+
description="The digest of the image. The image is always pulled by"
|
|
1011
|
+
" digest, even if 'tag' is specified.",
|
|
1012
|
+
regex=r"^sha256:[0-9a-f]{64}$",
|
|
1013
|
+
)
|
|
1014
|
+
tag: Optional[str] = pydantic.Field(
|
|
1015
|
+
default=None,
|
|
1016
|
+
description="The tag of the image. Although the image is always pulled"
|
|
1017
|
+
" by digest, including the tag is strongly recommended as it is often"
|
|
1018
|
+
" the main source of versioning information.",
|
|
1019
|
+
# https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pull
|
|
1020
|
+
regex=r"^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$",
|
|
1021
|
+
)
|
|
1022
|
+
|
|
1023
|
+
def url(self) -> str:
|
|
1024
|
+
return f"{self.host}/{self.name}@{self.digest}"
|
|
1025
|
+
|
|
1026
|
+
@pydantic.validator("host")
|
|
1027
|
+
def validate_host(cls, v: str):
|
|
1028
|
+
if "/" in v:
|
|
1029
|
+
raise ValueError(
|
|
1030
|
+
"host: slashes not allowed; do not specify a scheme or path"
|
|
1031
|
+
)
|
|
1032
|
+
if "_" in v:
|
|
1033
|
+
# https://docs.docker.com/reference/cli/docker/image/tag/#description
|
|
1034
|
+
raise ValueError(
|
|
1035
|
+
"host: image registry hostnames may not contain underscores"
|
|
1036
|
+
)
|
|
1037
|
+
|
|
1038
|
+
# This works because we know there are no slashes in the value
|
|
1039
|
+
# "Following the syntax specifications in RFC 1808, urlparse recognizes
|
|
1040
|
+
# a netloc only if it is properly introduced by ‘//’. Otherwise the
|
|
1041
|
+
# input is presumed to be a relative URL and thus to start with a path
|
|
1042
|
+
# component."
|
|
1043
|
+
# https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse
|
|
1044
|
+
parsed = urllib.parse.urlparse(f"//{v}")
|
|
1045
|
+
if (
|
|
1046
|
+
parsed.scheme
|
|
1047
|
+
or parsed.path
|
|
1048
|
+
or parsed.params
|
|
1049
|
+
or parsed.query
|
|
1050
|
+
or parsed.fragment
|
|
1051
|
+
):
|
|
1052
|
+
raise ValueError(
|
|
1053
|
+
"host: must be 'hostname' or 'hostname:port', and nothing else"
|
|
1054
|
+
)
|
|
1055
|
+
|
|
1056
|
+
return v
|
|
1057
|
+
|
|
1058
|
+
|
|
1001
1059
|
class InferenceServiceRunner(DyffSchemaBaseModel):
|
|
1002
1060
|
kind: InferenceServiceRunnerKind
|
|
1061
|
+
|
|
1062
|
+
# TODO: (DYFF-421) Make .image required
|
|
1063
|
+
image: Optional[ContainerImageSource] = pydantic.Field(
|
|
1064
|
+
default=None,
|
|
1065
|
+
description="The container image that implements the runner. This field is"
|
|
1066
|
+
" optional for schema backwards-compatibility, but creating new"
|
|
1067
|
+
" services with image=None will result in an error.",
|
|
1068
|
+
)
|
|
1069
|
+
|
|
1003
1070
|
args: Optional[list[str]] = pydantic.Field(
|
|
1004
1071
|
default=None, description="Command line arguments to forward to the runner"
|
|
1005
1072
|
)
|
|
@@ -1878,6 +1945,7 @@ __all__ = [
|
|
|
1878
1945
|
"Audit",
|
|
1879
1946
|
"AuditProcedure",
|
|
1880
1947
|
"AuditRequirement",
|
|
1948
|
+
"ContainerImageSource",
|
|
1881
1949
|
"DataSchema",
|
|
1882
1950
|
"Dataset",
|
|
1883
1951
|
"DatasetBase",
|
dyff/schema/v0/r1/requests.py
CHANGED
|
@@ -83,6 +83,16 @@ class InferenceServiceCreateRequest(DyffEntityCreateRequest, InferenceServiceBas
|
|
|
83
83
|
default=None, description="ID of Model backing the service, if applicable"
|
|
84
84
|
)
|
|
85
85
|
|
|
86
|
+
# TODO: (DYFF-421) Make .image required and remove this validator
|
|
87
|
+
@pydantic.validator("image", check_fields=False)
|
|
88
|
+
def validate_image_not_none(cls, v):
|
|
89
|
+
if v is None:
|
|
90
|
+
raise ValueError(
|
|
91
|
+
".image is required for new services; it is defined as Optional"
|
|
92
|
+
" for schema backwards-compatibility only"
|
|
93
|
+
)
|
|
94
|
+
return v
|
|
95
|
+
|
|
86
96
|
|
|
87
97
|
class InferenceSessionCreateRequest(DyffEntityCreateRequest, InferenceSessionBase):
|
|
88
98
|
inferenceService: str = pydantic.Field(description="InferenceService ID")
|
|
@@ -22,8 +22,8 @@ dyff/schema/v0/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
|
22
22
|
dyff/schema/v0/r1/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
23
23
|
dyff/schema/v0/r1/adapters.py,sha256=2t2oxsnGfSEDKKDIEYw4qqLXMH7qlFIwPVuLyUmbsHs,23552
|
|
24
24
|
dyff/schema/v0/r1/base.py,sha256=QX1TfqX3jBafxpBnf2bUTcgP0sMyqZFFNJZQHhM48BI,19385
|
|
25
|
-
dyff/schema/v0/r1/platform.py,sha256=
|
|
26
|
-
dyff/schema/v0/r1/requests.py,sha256=
|
|
25
|
+
dyff/schema/v0/r1/platform.py,sha256=XNrL-H1wuY9CaBpfbCVzDK7hqclS87OouyAnS9FlM4g,64134
|
|
26
|
+
dyff/schema/v0/r1/requests.py,sha256=2Xu1iA2m1bCNzITPcwrnNagqAOtB8Fahav9zzV8oGJ0,10245
|
|
27
27
|
dyff/schema/v0/r1/test.py,sha256=X6dUyVd5svcPCI-PBMOAqEfK9jv3bRDvkQTJzwS96c0,10720
|
|
28
28
|
dyff/schema/v0/r1/version.py,sha256=isKAGuGxsdru8vDaYmI4YiZdJOu_wNxXK7u6QzD6FE4,392
|
|
29
29
|
dyff/schema/v0/r1/dataset/__init__.py,sha256=LbVlkO2asyGYBKk2z49xjJYTM-pu9y9e4eQDXgTDLnM,2553
|
|
@@ -34,9 +34,9 @@ dyff/schema/v0/r1/dataset/text.py,sha256=nLIn91Zlt0tNdXUklSgjJ-kEDxoPX32ISLkiv2D
|
|
|
34
34
|
dyff/schema/v0/r1/dataset/vision.py,sha256=aIe0fbfM_g3DsrDTdg2K803YKLjZBpurM_VJcJFuZLc,369
|
|
35
35
|
dyff/schema/v0/r1/io/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
36
36
|
dyff/schema/v0/r1/io/vllm.py,sha256=CUE9y8KthtUI7sD49S875rDmPvKotSXVIRaBS79aBZs,5320
|
|
37
|
-
dyff_schema-0.
|
|
38
|
-
dyff_schema-0.
|
|
39
|
-
dyff_schema-0.
|
|
40
|
-
dyff_schema-0.
|
|
41
|
-
dyff_schema-0.
|
|
42
|
-
dyff_schema-0.
|
|
37
|
+
dyff_schema-0.10.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
38
|
+
dyff_schema-0.10.1.dist-info/METADATA,sha256=1yQ9XLIRO4uugg3K5OBROsnHoBCA4ekh1PRWImfFSU0,3460
|
|
39
|
+
dyff_schema-0.10.1.dist-info/NOTICE,sha256=YONACu0s_Ui6jNi-wtEsVQbTU1JIkh8wvLH6d1-Ni_w,43
|
|
40
|
+
dyff_schema-0.10.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
41
|
+
dyff_schema-0.10.1.dist-info/top_level.txt,sha256=9e3VVdeX73t_sUJOPQPCcGtYO1JhoErhHIi3WoWGcFI,5
|
|
42
|
+
dyff_schema-0.10.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|