truefoundry 0.5.3rc5__py3-none-any.whl → 0.5.5__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.
Potentially problematic release.
This version of truefoundry might be problematic. Click here for more details.
- truefoundry/deploy/__init__.py +9 -2
- truefoundry/deploy/auto_gen/models.py +164 -44
- truefoundry/deploy/lib/clients/servicefoundry_client.py +1 -24
- truefoundry/deploy/lib/session.py +7 -0
- truefoundry/deploy/v2/lib/deploy.py +2 -0
- truefoundry/deploy/v2/lib/deployable_patched_models.py +10 -0
- truefoundry/deploy/v2/lib/patched_models.py +8 -0
- truefoundry/deploy/v2/lib/source.py +2 -2
- truefoundry/ml/autogen/client/__init__.py +2 -2
- truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +18 -16
- truefoundry/ml/autogen/client/models/__init__.py +2 -2
- truefoundry/ml/autogen/client/models/artifact_version_manifest.py +23 -5
- truefoundry/ml/autogen/client/models/{get_artifact_tags_response_dto.py → get_artifact_version_aliases_response_dto.py} +12 -10
- truefoundry/ml/autogen/client/models/model_version_manifest.py +16 -5
- truefoundry/ml/autogen/client_README.md +2 -2
- truefoundry/ml/autogen/entities/artifacts.py +4 -9
- truefoundry/ml/log_types/artifacts/artifact.py +13 -13
- truefoundry/ml/log_types/artifacts/model.py +14 -14
- {truefoundry-0.5.3rc5.dist-info → truefoundry-0.5.5.dist-info}/METADATA +2 -2
- {truefoundry-0.5.3rc5.dist-info → truefoundry-0.5.5.dist-info}/RECORD +22 -27
- {truefoundry-0.5.3rc5.dist-info → truefoundry-0.5.5.dist-info}/WHEEL +1 -1
- truefoundry/cli/commands/pat.py +0 -24
- truefoundry/gateway/__init__.py +0 -1
- truefoundry/gateway/cli/cli.py +0 -30
- truefoundry/gateway/lib/entities.py +0 -28
- truefoundry/gateway/lib/models.py +0 -29
- {truefoundry-0.5.3rc5.dist-info → truefoundry-0.5.5.dist-info}/entry_points.txt +0 -0
truefoundry/deploy/__init__.py
CHANGED
|
@@ -9,6 +9,10 @@ from truefoundry.deploy.auto_gen.models import (
|
|
|
9
9
|
Kustomize,
|
|
10
10
|
ParamType,
|
|
11
11
|
Protocol,
|
|
12
|
+
SparkDriverConfig,
|
|
13
|
+
SparkExecutorConfig,
|
|
14
|
+
SparkExecutorDynamicScaling,
|
|
15
|
+
SparkExecutorFixedInstances,
|
|
12
16
|
WorkbenchImage,
|
|
13
17
|
)
|
|
14
18
|
from truefoundry.deploy.lib.dao.application import (
|
|
@@ -36,11 +40,12 @@ from truefoundry.deploy.v2.lib.deployable_patched_models import (
|
|
|
36
40
|
Application,
|
|
37
41
|
ApplicationSet,
|
|
38
42
|
AsyncService,
|
|
39
|
-
Codeserver,
|
|
40
43
|
Helm,
|
|
41
44
|
Job,
|
|
42
45
|
Notebook,
|
|
46
|
+
RStudio,
|
|
43
47
|
Service,
|
|
48
|
+
SparkJob,
|
|
44
49
|
SSHServer,
|
|
45
50
|
Volume,
|
|
46
51
|
Workflow,
|
|
@@ -110,7 +115,9 @@ from truefoundry.deploy.v2.lib.patched_models import (
|
|
|
110
115
|
StaticVolumeConfig,
|
|
111
116
|
StringDataMount,
|
|
112
117
|
TPUType,
|
|
113
|
-
|
|
118
|
+
TrueFoundryArtifactSource,
|
|
119
|
+
TruefoundryArtifactSource, # deprecated, kept for backwards compatibility
|
|
120
|
+
TrueFoundryInteractiveLogin,
|
|
114
121
|
VolumeBrowser,
|
|
115
122
|
VolumeMount,
|
|
116
123
|
WorkerConfig,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: application.json
|
|
3
|
-
# timestamp:
|
|
3
|
+
# timestamp: 2025-01-20T07:24:00+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -659,6 +659,10 @@ class Profile(str, Enum):
|
|
|
659
659
|
|
|
660
660
|
class NvidiaMIGGPU(BaseModel):
|
|
661
661
|
type: Literal["nvidia_mig_gpu"] = Field(..., description="+value=nvidia_mig_gpu")
|
|
662
|
+
name: Optional[str] = Field(
|
|
663
|
+
None,
|
|
664
|
+
description="+label=GPU Name\n+usage=Name of the Nvidia GPU. One of [P4, P100, V100, T4, A10G, A100_40GB, A100_80GB]\nThis field is required for Node Selector and can be ignored in Nodepool Selector.\nOne instance of the card contains the following amount of memory -\nP4: 8 GB, P100: 16 GB, V100: 16 GB, T4: 16 GB, A10G: 24 GB, A100_40GB: 40GB, A100_80GB: 80 GB",
|
|
665
|
+
)
|
|
662
666
|
profile: Profile = Field(
|
|
663
667
|
...,
|
|
664
668
|
description="+label=MIG Profile\n+usage=Name of the MIG profile to use. One of [1g.5gb, 2g.10gb, 3g.20gb, 1g.10gb, 2g.20gb, 3g.40gb]",
|
|
@@ -669,6 +673,10 @@ class NvidiaTimeslicingGPU(BaseModel):
|
|
|
669
673
|
type: Literal["nvidia_timeslicing_gpu"] = Field(
|
|
670
674
|
..., description="+value=nvidia_timeslicing_gpu"
|
|
671
675
|
)
|
|
676
|
+
name: Optional[str] = Field(
|
|
677
|
+
None,
|
|
678
|
+
description="+label=GPU Name\n+usage=Name of the Nvidia GPU. One of [P4, P100, V100, T4, A10G, A100_40GB, A100_80GB]\nThis field is required for Node Selector and can be ignored in Nodepool Selector.\nOne instance of the card contains the following amount of memory -\nP4: 8 GB, P100: 16 GB, V100: 16 GB, T4: 16 GB, A10G: 24 GB, A100_40GB: 40GB, A100_80GB: 80 GB",
|
|
679
|
+
)
|
|
672
680
|
gpu_memory: conint(ge=1, le=200000) = Field(
|
|
673
681
|
...,
|
|
674
682
|
description="+label=GPU Memory (MB)\n+usage=Amount of GPU memory (in MB) to allocate. Please note, this limit is not being enforced today but will be in future. Applications are expected to operate in co-opertative mode",
|
|
@@ -735,45 +743,6 @@ class AppProtocol(str, Enum):
|
|
|
735
743
|
tcp = "tcp"
|
|
736
744
|
|
|
737
745
|
|
|
738
|
-
class Port(BaseModel):
|
|
739
|
-
"""
|
|
740
|
-
+docs=Describes the ports the service should be exposed to.
|
|
741
|
-
"""
|
|
742
|
-
|
|
743
|
-
port: conint(ge=1, le=65535) = Field(
|
|
744
|
-
80, description="+usage=Port number to expose."
|
|
745
|
-
)
|
|
746
|
-
protocol: Protocol = Field("TCP", description="+usage=Protocol for the port.")
|
|
747
|
-
expose: bool = Field(True, description="+usage=Expose the port")
|
|
748
|
-
app_protocol: AppProtocol = Field(
|
|
749
|
-
"http",
|
|
750
|
-
description="+label=Application Protocol\n+usage=Application Protocol for the port.\nSelect the application protocol used by your service. For most use cases, this should be `http`(HTTP/1.1).\nIf you are running a gRPC server, select the `grpc` option.\nThis is only applicable if `expose=true`.",
|
|
751
|
-
)
|
|
752
|
-
host: Optional[
|
|
753
|
-
constr(
|
|
754
|
-
regex=r"^((([a-zA-Z0-9\-]{1,63}\.)([a-zA-Z0-9\-]{1,63}\.)*([A-Za-z]{1,63}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))$"
|
|
755
|
-
)
|
|
756
|
-
] = Field(
|
|
757
|
-
None,
|
|
758
|
-
description="+usage=Host e.g. ai.example.com, app.truefoundry.com\n+message=Upto 253 characters, each part of host should be at most 63 characters long, can contain alphabets, digits and hypen, must begin and end with an alphanumeric characters. Parts must be separated by periods (.)",
|
|
759
|
-
)
|
|
760
|
-
path: Optional[
|
|
761
|
-
constr(regex=r"^(/([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9]))*/$")
|
|
762
|
-
] = Field(
|
|
763
|
-
None,
|
|
764
|
-
description="+usage=Path e.g. /v1/api/ml/, /v2/docs/\n+message=Should begin and end with a forward slash (/). Each part can can contain alphabets, digits and hypen, must begin and end with an alphanumeric characters. Parts should be separated by forward slashes (/)",
|
|
765
|
-
)
|
|
766
|
-
rewrite_path_to: Optional[
|
|
767
|
-
constr(regex=r"^(/([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9]))*/$")
|
|
768
|
-
] = Field(
|
|
769
|
-
None,
|
|
770
|
-
description="+label=Rewrite Path to\n+usage=Rewrite the path prefix to a different path.\nIf `path` is `/v1/api` and `rewrite_path_to` is `/api`. The URI in the HTTP request `http://0.0.0.0:8080/v1/api/houses` will be rewritten to `http://0.0.0.0:8080/api/houses` before the request is forwarded your service.\nDefaults to `/`.\nThis is only applicable if `path` is given.\n+message=Should begin and end with a forward slash (/). Each part can can contain alphabets, digits and hypen, must begin and end with an alphanumeric characters. Parts should be separated by forward slashes (/)",
|
|
771
|
-
)
|
|
772
|
-
auth: Optional[Union[BasicAuthCreds, JwtAuthCreds]] = Field(
|
|
773
|
-
None, description="+usage=Username and Password for service auth"
|
|
774
|
-
)
|
|
775
|
-
|
|
776
|
-
|
|
777
746
|
class PythonBuild(BaseModel):
|
|
778
747
|
"""
|
|
779
748
|
+docs=Describes that we are using python to build a container image with a specific python version and pip packages installed.
|
|
@@ -1021,6 +990,42 @@ class ServiceAutoscaling(BaseAutoscaling):
|
|
|
1021
990
|
)
|
|
1022
991
|
|
|
1023
992
|
|
|
993
|
+
class SparkDriverConfig(BaseModel):
|
|
994
|
+
"""
|
|
995
|
+
+label=Driver Config
|
|
996
|
+
"""
|
|
997
|
+
|
|
998
|
+
ui_endpoint: Endpoint
|
|
999
|
+
resources: Optional[Resources] = None
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
class SparkExecutorDynamicScaling(BaseModel):
|
|
1003
|
+
"""
|
|
1004
|
+
+label=Dynamic Scaling
|
|
1005
|
+
"""
|
|
1006
|
+
|
|
1007
|
+
type: Literal["dynamic"] = Field(..., description="+value=dynamic")
|
|
1008
|
+
min: conint(ge=0, le=500) = Field(
|
|
1009
|
+
1,
|
|
1010
|
+
description="+label=Min Instances\n+usage=Minimum number of instances to start / scale down to\n+sort=100",
|
|
1011
|
+
)
|
|
1012
|
+
max: conint(ge=0, le=500) = Field(
|
|
1013
|
+
1,
|
|
1014
|
+
description="+label=Max Instances\n+usage=Maximum number of instances to scale up to\n+sort=200",
|
|
1015
|
+
)
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
class SparkExecutorFixedInstances(BaseModel):
|
|
1019
|
+
"""
|
|
1020
|
+
+label=Fixed Instances
|
|
1021
|
+
"""
|
|
1022
|
+
|
|
1023
|
+
type: Literal["fixed"] = Field(..., description="+value=fixed")
|
|
1024
|
+
count: conint(ge=0, le=500) = Field(
|
|
1025
|
+
1, description="+label=Instances Count\n+usage=Number of instances to start"
|
|
1026
|
+
)
|
|
1027
|
+
|
|
1028
|
+
|
|
1024
1029
|
class StaticVolumeConfig(BaseModel):
|
|
1025
1030
|
"""
|
|
1026
1031
|
+label=Static Volume Config
|
|
@@ -1106,6 +1111,16 @@ class TaskPythonBuild(BaseModel):
|
|
|
1106
1111
|
)
|
|
1107
1112
|
|
|
1108
1113
|
|
|
1114
|
+
class TrueFoundryInteractiveLogin(BaseModel):
|
|
1115
|
+
"""
|
|
1116
|
+
+label=Login with truefoundry
|
|
1117
|
+
"""
|
|
1118
|
+
|
|
1119
|
+
type: Literal["truefoundry_oauth"] = Field(
|
|
1120
|
+
..., description="+value=truefoundry_oauth"
|
|
1121
|
+
)
|
|
1122
|
+
|
|
1123
|
+
|
|
1109
1124
|
class TruefoundryArtifactSource(BaseModel):
|
|
1110
1125
|
"""
|
|
1111
1126
|
+docs=Input for Artifact from Truefoundry Artifact Registry
|
|
@@ -1279,9 +1294,8 @@ class Codeserver(BaseWorkbenchInput):
|
|
|
1279
1294
|
+docs=Describes the configuration for the code server
|
|
1280
1295
|
"""
|
|
1281
1296
|
|
|
1282
|
-
type: Literal["codeserver"] = Field(..., description="+value=
|
|
1297
|
+
type: Literal["codeserver"] = Field(..., description="+value=codeserver")
|
|
1283
1298
|
image: WorkbenchImage
|
|
1284
|
-
auth: Optional[BasicAuthCreds] = None
|
|
1285
1299
|
|
|
1286
1300
|
|
|
1287
1301
|
class ContainerTaskConfig(BaseModel):
|
|
@@ -1549,13 +1563,51 @@ class Notebook(BaseWorkbenchInput):
|
|
|
1549
1563
|
|
|
1550
1564
|
type: Literal["notebook"] = Field(..., description="+value=notebook")
|
|
1551
1565
|
image: WorkbenchImage
|
|
1552
|
-
auth: Optional[BasicAuthCreds] = None
|
|
1553
1566
|
cull_timeout: conint(ge=5) = Field(
|
|
1554
1567
|
30,
|
|
1555
1568
|
description="+label=Stop after (minutes of inactivity)\n+usage=Stop the notebook instance after this much time in minutes of inactivity.\nThe notebook instance will be stopped even if the notebook is open in your browser, but nothing is running on the notebook.\n+sort=5",
|
|
1556
1569
|
)
|
|
1557
1570
|
|
|
1558
1571
|
|
|
1572
|
+
class Port(BaseModel):
|
|
1573
|
+
"""
|
|
1574
|
+
+docs=Describes the ports the service should be exposed to.
|
|
1575
|
+
"""
|
|
1576
|
+
|
|
1577
|
+
port: conint(ge=1, le=65535) = Field(
|
|
1578
|
+
80, description="+usage=Port number to expose."
|
|
1579
|
+
)
|
|
1580
|
+
protocol: Protocol = Field("TCP", description="+usage=Protocol for the port.")
|
|
1581
|
+
expose: bool = Field(True, description="+usage=Expose the port")
|
|
1582
|
+
app_protocol: AppProtocol = Field(
|
|
1583
|
+
"http",
|
|
1584
|
+
description="+label=Application Protocol\n+usage=Application Protocol for the port.\nSelect the application protocol used by your service. For most use cases, this should be `http`(HTTP/1.1).\nIf you are running a gRPC server, select the `grpc` option.\nThis is only applicable if `expose=true`.",
|
|
1585
|
+
)
|
|
1586
|
+
host: Optional[
|
|
1587
|
+
constr(
|
|
1588
|
+
regex=r"^((([a-zA-Z0-9\-]{1,63}\.)([a-zA-Z0-9\-]{1,63}\.)*([A-Za-z]{1,63}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))$"
|
|
1589
|
+
)
|
|
1590
|
+
] = Field(
|
|
1591
|
+
None,
|
|
1592
|
+
description="+usage=Host e.g. ai.example.com, app.truefoundry.com\n+message=Upto 253 characters, each part of host should be at most 63 characters long, can contain alphabets, digits and hypen, must begin and end with an alphanumeric characters. Parts must be separated by periods (.)",
|
|
1593
|
+
)
|
|
1594
|
+
path: Optional[
|
|
1595
|
+
constr(regex=r"^(/([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9]))*/$")
|
|
1596
|
+
] = Field(
|
|
1597
|
+
None,
|
|
1598
|
+
description="+usage=Path e.g. /v1/api/ml/, /v2/docs/\n+message=Should begin and end with a forward slash (/). Each part can can contain alphabets, digits and hypen, must begin and end with an alphanumeric characters. Parts should be separated by forward slashes (/)",
|
|
1599
|
+
)
|
|
1600
|
+
rewrite_path_to: Optional[
|
|
1601
|
+
constr(regex=r"^(/([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9]))*/$")
|
|
1602
|
+
] = Field(
|
|
1603
|
+
None,
|
|
1604
|
+
description="+label=Rewrite Path to\n+usage=Rewrite the path prefix to a different path.\nIf `path` is `/v1/api` and `rewrite_path_to` is `/api`. The URI in the HTTP request `http://0.0.0.0:8080/v1/api/houses` will be rewritten to `http://0.0.0.0:8080/api/houses` before the request is forwarded your service.\nDefaults to `/`.\nThis is only applicable if `path` is given.\n+message=Should begin and end with a forward slash (/). Each part can can contain alphabets, digits and hypen, must begin and end with an alphanumeric characters. Parts should be separated by forward slashes (/)",
|
|
1605
|
+
)
|
|
1606
|
+
auth: Optional[Union[BasicAuthCreds, JwtAuthCreds, TrueFoundryInteractiveLogin]] = (
|
|
1607
|
+
Field(None, description="+usage=Authentication method for inbound traffic")
|
|
1608
|
+
)
|
|
1609
|
+
|
|
1610
|
+
|
|
1559
1611
|
class PythonTaskConfig(BaseModel):
|
|
1560
1612
|
"""
|
|
1561
1613
|
+docs=Describes the configuration for the python function task
|
|
@@ -1582,17 +1634,83 @@ class PythonTaskConfig(BaseModel):
|
|
|
1582
1634
|
)
|
|
1583
1635
|
|
|
1584
1636
|
|
|
1637
|
+
class RStudio(BaseWorkbenchInput):
|
|
1638
|
+
"""
|
|
1639
|
+
+docs=Describes the configuration for the Rstudio server
|
|
1640
|
+
"""
|
|
1641
|
+
|
|
1642
|
+
type: Literal["rstudio"] = Field(..., description="+value=rstudio")
|
|
1643
|
+
image: WorkbenchImage
|
|
1644
|
+
|
|
1645
|
+
|
|
1585
1646
|
class SSHServer(BaseWorkbenchInput):
|
|
1586
1647
|
"""
|
|
1587
1648
|
+docs=Describes the configuration for the ssh server
|
|
1588
1649
|
"""
|
|
1589
1650
|
|
|
1590
|
-
type: Literal["ssh-server"] = Field(..., description="+value=
|
|
1651
|
+
type: Literal["ssh-server"] = Field(..., description="+value=ssh-server")
|
|
1591
1652
|
image: WorkbenchImage
|
|
1592
1653
|
ssh_public_key: str = Field(
|
|
1593
1654
|
...,
|
|
1594
1655
|
description="+label: SSH Public Key\n+usage=Add Your SSH Public Key, this will be used to authenticate you to the SSH Server. \\\nYou can find it using `cat ~/.ssh/id_rsa.pub` in Mac/Linux or `type $home\\.ssh\\id_rsa.pub` in Windows Powershell. \\\nYou can also generate a new SSH key pair using `ssh-keygen -t rsa` in your local terminal. (same for both Mac/Linux and Windows Powershell)\n+uiType=TextArea\n+sort=4",
|
|
1595
1656
|
)
|
|
1657
|
+
cull_timeout: Optional[conint(ge=5)] = Field(
|
|
1658
|
+
None,
|
|
1659
|
+
description="+label=Stop after (minutes of inactivity)\n+usage=Stop the SSH Server instance after this much time in minutes of inactivity. \\\nThe instance is considered active if there is at least one active SSH connection (a client connected to the SSH server), \\\nor if a background job is running using tmux or screen, or if the pod has restarted.\n+sort=5",
|
|
1660
|
+
)
|
|
1661
|
+
|
|
1662
|
+
|
|
1663
|
+
class SparkExecutorConfig(BaseModel):
|
|
1664
|
+
"""
|
|
1665
|
+
+label=Executor Config
|
|
1666
|
+
"""
|
|
1667
|
+
|
|
1668
|
+
instances: Union[SparkExecutorFixedInstances, SparkExecutorDynamicScaling] = Field(
|
|
1669
|
+
{"type": "fixed", "count": 1}, description="+label=Executor Instances"
|
|
1670
|
+
)
|
|
1671
|
+
resources: Optional[Resources] = None
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
class SparkJob(BaseModel):
|
|
1675
|
+
type: Literal["spark-job"] = Field(..., description="+value=spark-job\n+sort=1")
|
|
1676
|
+
name: constr(regex=r"^[a-z][a-z0-9\-]{1,30}[a-z0-9]$") = Field(
|
|
1677
|
+
...,
|
|
1678
|
+
description="+label=Name\n+usage=Name of the job\n+message=3 to 32 lower case characters long alphanumeric word, may contain - in between, cannot start with a number\n+sort=2",
|
|
1679
|
+
)
|
|
1680
|
+
image: Image
|
|
1681
|
+
spark_version: str = Field(
|
|
1682
|
+
"3.5.2",
|
|
1683
|
+
description="+label=Spark Version\n+usage=Spark version should match the spark version installed in the image.\n+sort=2000",
|
|
1684
|
+
)
|
|
1685
|
+
main_application_file: str = Field(
|
|
1686
|
+
...,
|
|
1687
|
+
description="+label=Main Application File\n+usage=The main application file to be executed by the spark job.\n+sort=3000",
|
|
1688
|
+
)
|
|
1689
|
+
arguments: Optional[str] = Field(
|
|
1690
|
+
None,
|
|
1691
|
+
description="+label=Arguments\n+usage=Arguments to be passed to the main application file.\n+sort=4000",
|
|
1692
|
+
)
|
|
1693
|
+
driver_config: SparkDriverConfig
|
|
1694
|
+
executor_config: SparkExecutorConfig
|
|
1695
|
+
env: Optional[Dict[str, Any]] = Field(
|
|
1696
|
+
None,
|
|
1697
|
+
description="+label=Environment Variables\n+usage=Configure environment variables to be injected in the service either as plain text. [Docs](https://docs.truefoundry.com/docs/env-variables)\n+icon=fa-globe\n+sort=21000",
|
|
1698
|
+
)
|
|
1699
|
+
mounts: Optional[List[VolumeMount]] = Field(
|
|
1700
|
+
None,
|
|
1701
|
+
description="+label=Mounts\n+usage=Configure volumes to be mounted to driver and executors. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-job)\n+sort=22000\n+uiType=Mounts",
|
|
1702
|
+
)
|
|
1703
|
+
retries: conint(ge=0, le=10) = Field(
|
|
1704
|
+
0,
|
|
1705
|
+
description="+label=Retries\n+usage=Specify the maximum number of attempts to retry a job before it is marked as failed.\n+icon=fa-repeat\n+sort=23000",
|
|
1706
|
+
)
|
|
1707
|
+
service_account: Optional[str] = Field(
|
|
1708
|
+
None, description="+label=Service Account\n+sort=24000"
|
|
1709
|
+
)
|
|
1710
|
+
workspace_fqn: Optional[str] = Field(
|
|
1711
|
+
None,
|
|
1712
|
+
description="+label=Workspace FQN\n+docs=Fully qualified name of the workspace\n+uiType=Hidden",
|
|
1713
|
+
)
|
|
1596
1714
|
|
|
1597
1715
|
|
|
1598
1716
|
class Volume(BaseModel):
|
|
@@ -1780,8 +1898,10 @@ class Application(BaseModel):
|
|
|
1780
1898
|
Notebook,
|
|
1781
1899
|
Codeserver,
|
|
1782
1900
|
SSHServer,
|
|
1901
|
+
RStudio,
|
|
1783
1902
|
Helm,
|
|
1784
1903
|
Volume,
|
|
1785
1904
|
ApplicationSet,
|
|
1786
1905
|
Workflow,
|
|
1906
|
+
SparkJob,
|
|
1787
1907
|
]
|
|
@@ -4,7 +4,7 @@ import json
|
|
|
4
4
|
import os
|
|
5
5
|
import time
|
|
6
6
|
from datetime import datetime, timezone
|
|
7
|
-
from typing import TYPE_CHECKING, Any, Dict, List,
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
|
8
8
|
from urllib.parse import urljoin
|
|
9
9
|
|
|
10
10
|
import requests
|
|
@@ -43,7 +43,6 @@ from truefoundry.deploy.v2.lib.models import (
|
|
|
43
43
|
BuildResponse,
|
|
44
44
|
DeploymentFqnResponse,
|
|
45
45
|
)
|
|
46
|
-
from truefoundry.gateway.lib.entities import ProviderModels
|
|
47
46
|
from truefoundry.logger import logger
|
|
48
47
|
from truefoundry.pydantic_v1 import parse_obj_as
|
|
49
48
|
|
|
@@ -708,25 +707,3 @@ class ServiceFoundryServiceClient(BaseServiceFoundryServiceClient):
|
|
|
708
707
|
)
|
|
709
708
|
response_data = request_handling(response)
|
|
710
709
|
return response_data
|
|
711
|
-
|
|
712
|
-
def get_gateway_models(
|
|
713
|
-
self, model_type: Optional[Literal["chat", "completion", "embedding"]] = None
|
|
714
|
-
) -> ProviderModels:
|
|
715
|
-
url = f"{self._api_server_url}/{VERSION_PREFIX}/llm-gateway/model/enabled"
|
|
716
|
-
params = {}
|
|
717
|
-
if model_type:
|
|
718
|
-
params["modelType"] = model_type
|
|
719
|
-
response = session_with_retries().get(
|
|
720
|
-
url, headers=self._get_header(), params=params
|
|
721
|
-
)
|
|
722
|
-
response = request_handling(response)
|
|
723
|
-
return parse_obj_as(ProviderModels, response)
|
|
724
|
-
|
|
725
|
-
def create_pat(self, name: str):
|
|
726
|
-
url = f"{self._api_server_url}/{VERSION_PREFIX}/service-account/pat"
|
|
727
|
-
body = {"name": name}
|
|
728
|
-
response = session_with_retries().post(
|
|
729
|
-
url, headers=self._get_header(), json=body
|
|
730
|
-
)
|
|
731
|
-
response = request_handling(response)
|
|
732
|
-
return response
|
|
@@ -8,6 +8,7 @@ from truefoundry.common.constants import TFY_API_KEY_ENV_KEY, TFY_HOST_ENV_KEY
|
|
|
8
8
|
from truefoundry.common.credential_file_manager import CredentialsFileManager
|
|
9
9
|
from truefoundry.common.credential_provider import EnvCredentialProvider
|
|
10
10
|
from truefoundry.common.entities import CredentialsFileContent, Token
|
|
11
|
+
from truefoundry.common.session import Session
|
|
11
12
|
from truefoundry.common.utils import relogin_error_message, resolve_tfy_host
|
|
12
13
|
from truefoundry.deploy.io.output_callback import OutputCallBack
|
|
13
14
|
from truefoundry.deploy.lib.const import (
|
|
@@ -98,6 +99,12 @@ def logout(
|
|
|
98
99
|
output_hook.print_line(PROMPT_ALREADY_LOGGED_OUT)
|
|
99
100
|
|
|
100
101
|
|
|
102
|
+
def get_access_token():
|
|
103
|
+
# Create a new session which handles token refresh
|
|
104
|
+
session = Session.new()
|
|
105
|
+
return session.access_token
|
|
106
|
+
|
|
107
|
+
|
|
101
108
|
def _login_with_device_code(
|
|
102
109
|
base_url: str,
|
|
103
110
|
auth_service: AuthServiceClient,
|
|
@@ -74,10 +74,12 @@ def _handle_if_local_source(component: Component, workspace_fqn: str) -> Compone
|
|
|
74
74
|
else:
|
|
75
75
|
# We'll build image on TrueFoundry servers, upload the source and update image.build_source
|
|
76
76
|
logger.info("Uploading code for %s '%s'", component.type, component.name)
|
|
77
|
+
client = ServiceFoundryServiceClient()
|
|
77
78
|
new_component.image.build_source = local_source_to_remote_source(
|
|
78
79
|
local_source=component.image.build_source,
|
|
79
80
|
workspace_fqn=workspace_fqn,
|
|
80
81
|
component_name=component.name,
|
|
82
|
+
upload_code_package=client.upload_code_package,
|
|
81
83
|
)
|
|
82
84
|
logger.debug("Uploaded code for %s '%s'", component.type, component.name)
|
|
83
85
|
return new_component
|
|
@@ -30,6 +30,10 @@ class Job(models.Job, DeployablePatchedModelBase):
|
|
|
30
30
|
resources: models.Resources = Field(default_factory=models.Resources)
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
class SparkJob(models.SparkJob, DeployablePatchedModelBase):
|
|
34
|
+
type: Literal["spark-job"] = "spark-job"
|
|
35
|
+
|
|
36
|
+
|
|
33
37
|
class Notebook(models.Notebook, DeployablePatchedModelBase):
|
|
34
38
|
type: Literal["notebook"] = "notebook"
|
|
35
39
|
resources: models.Resources = Field(default_factory=models.Resources)
|
|
@@ -37,6 +41,12 @@ class Notebook(models.Notebook, DeployablePatchedModelBase):
|
|
|
37
41
|
|
|
38
42
|
class Codeserver(models.Codeserver, DeployablePatchedModelBase):
|
|
39
43
|
type: Literal["codeserver"] = "codeserver"
|
|
44
|
+
resources: models.Resources = Field(default_factory=models.Resources)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class RStudio(models.RStudio, DeployablePatchedModelBase):
|
|
48
|
+
type: Literal["rstudio"] = "rstudio"
|
|
49
|
+
resources: models.Resources = Field(default_factory=models.Resources)
|
|
40
50
|
|
|
41
51
|
|
|
42
52
|
class Helm(models.Helm, DeployablePatchedModelBase):
|
|
@@ -256,6 +256,10 @@ class JwtAuthCreds(models.JwtAuthCreds, PatchedModelBase):
|
|
|
256
256
|
type: Literal["jwt_auth"] = "jwt_auth"
|
|
257
257
|
|
|
258
258
|
|
|
259
|
+
class TrueFoundryInteractiveLogin(models.TrueFoundryInteractiveLogin, PatchedModelBase):
|
|
260
|
+
type: Literal["truefoundry_oauth"] = "truefoundry_oauth"
|
|
261
|
+
|
|
262
|
+
|
|
259
263
|
class HealthProbe(models.HealthProbe, PatchedModelBase):
|
|
260
264
|
pass
|
|
261
265
|
|
|
@@ -504,6 +508,10 @@ class TruefoundryArtifactSource(models.TruefoundryArtifactSource, PatchedModelBa
|
|
|
504
508
|
type: Literal["truefoundry-artifact"] = "truefoundry-artifact"
|
|
505
509
|
|
|
506
510
|
|
|
511
|
+
# TODO: When we do the renaming in CUE, we will make TruefoundryArtifactSource the alias and mark it deprecated
|
|
512
|
+
TrueFoundryArtifactSource = TruefoundryArtifactSource
|
|
513
|
+
|
|
514
|
+
|
|
507
515
|
class ArtifactsDownload(models.ArtifactsDownload, PatchedModelBase):
|
|
508
516
|
pass
|
|
509
517
|
|
|
@@ -136,6 +136,7 @@ def local_source_to_remote_source(
|
|
|
136
136
|
local_source: models.LocalSource,
|
|
137
137
|
workspace_fqn: str,
|
|
138
138
|
component_name: str,
|
|
139
|
+
upload_code_package: Callable[[str, str, str], str],
|
|
139
140
|
) -> RemoteSource:
|
|
140
141
|
with tempfile.TemporaryDirectory() as local_dir:
|
|
141
142
|
package_local_path = os.path.join(local_dir, "build.tar.gz")
|
|
@@ -164,8 +165,7 @@ def local_source_to_remote_source(
|
|
|
164
165
|
logger.exception("Failed to calculate code archive size")
|
|
165
166
|
|
|
166
167
|
logger.debug("Uploading code archive.")
|
|
167
|
-
|
|
168
|
-
remote_uri = client.upload_code_package(
|
|
168
|
+
remote_uri = upload_code_package(
|
|
169
169
|
workspace_fqn=workspace_fqn,
|
|
170
170
|
component_name=component_name,
|
|
171
171
|
package_local_path=package_local_path,
|
|
@@ -184,8 +184,8 @@ from truefoundry.ml.autogen.client.models.finalize_artifact_version_request_dto
|
|
|
184
184
|
FinalizeArtifactVersionRequestDto,
|
|
185
185
|
)
|
|
186
186
|
from truefoundry.ml.autogen.client.models.framework import Framework
|
|
187
|
-
from truefoundry.ml.autogen.client.models.
|
|
188
|
-
|
|
187
|
+
from truefoundry.ml.autogen.client.models.get_artifact_version_aliases_response_dto import (
|
|
188
|
+
GetArtifactVersionAliasesResponseDto,
|
|
189
189
|
)
|
|
190
190
|
from truefoundry.ml.autogen.client.models.get_experiment_response_dto import (
|
|
191
191
|
GetExperimentResponseDto,
|
|
@@ -79,8 +79,8 @@ from truefoundry.ml.autogen.client.models.export_deployment_files_request_dto im
|
|
|
79
79
|
from truefoundry.ml.autogen.client.models.finalize_artifact_version_request_dto import (
|
|
80
80
|
FinalizeArtifactVersionRequestDto,
|
|
81
81
|
)
|
|
82
|
-
from truefoundry.ml.autogen.client.models.
|
|
83
|
-
|
|
82
|
+
from truefoundry.ml.autogen.client.models.get_artifact_version_aliases_response_dto import (
|
|
83
|
+
GetArtifactVersionAliasesResponseDto,
|
|
84
84
|
)
|
|
85
85
|
from truefoundry.ml.autogen.client.models.get_signed_url_for_dataset_write_request_dto import (
|
|
86
86
|
GetSignedURLForDatasetWriteRequestDto,
|
|
@@ -5342,15 +5342,15 @@ class MlfoundryArtifactsApi:
|
|
|
5342
5342
|
)
|
|
5343
5343
|
|
|
5344
5344
|
@validate_arguments
|
|
5345
|
-
def
|
|
5345
|
+
def get_version_aliases_for_artifact_get(
|
|
5346
5346
|
self, artifact_id: StrictStr, **kwargs
|
|
5347
|
-
) ->
|
|
5348
|
-
"""Get
|
|
5347
|
+
) -> GetArtifactVersionAliasesResponseDto: # noqa: E501
|
|
5348
|
+
"""Get Version Aliases For Artifact # noqa: E501
|
|
5349
5349
|
|
|
5350
5350
|
This method makes a synchronous HTTP request by default. To make an
|
|
5351
5351
|
asynchronous HTTP request, please pass async_req=True
|
|
5352
5352
|
|
|
5353
|
-
>>> thread = api.
|
|
5353
|
+
>>> thread = api.get_version_aliases_for_artifact_get(artifact_id, async_req=True)
|
|
5354
5354
|
>>> result = thread.get()
|
|
5355
5355
|
|
|
5356
5356
|
:param artifact_id: (required)
|
|
@@ -5364,24 +5364,26 @@ class MlfoundryArtifactsApi:
|
|
|
5364
5364
|
:return: Returns the result object.
|
|
5365
5365
|
If the method is called asynchronously,
|
|
5366
5366
|
returns the request thread.
|
|
5367
|
-
:rtype:
|
|
5367
|
+
:rtype: GetArtifactVersionAliasesResponseDto
|
|
5368
5368
|
"""
|
|
5369
5369
|
kwargs["_return_http_data_only"] = True
|
|
5370
5370
|
if "_preload_content" in kwargs:
|
|
5371
|
-
message = "Error! Please call the
|
|
5371
|
+
message = "Error! Please call the get_version_aliases_for_artifact_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
|
|
5372
5372
|
raise ValueError(message)
|
|
5373
|
-
return self.
|
|
5373
|
+
return self.get_version_aliases_for_artifact_get_with_http_info(
|
|
5374
|
+
artifact_id, **kwargs
|
|
5375
|
+
) # noqa: E501
|
|
5374
5376
|
|
|
5375
5377
|
@validate_arguments
|
|
5376
|
-
def
|
|
5378
|
+
def get_version_aliases_for_artifact_get_with_http_info(
|
|
5377
5379
|
self, artifact_id: StrictStr, **kwargs
|
|
5378
5380
|
) -> ApiResponse: # noqa: E501
|
|
5379
|
-
"""Get
|
|
5381
|
+
"""Get Version Aliases For Artifact # noqa: E501
|
|
5380
5382
|
|
|
5381
5383
|
This method makes a synchronous HTTP request by default. To make an
|
|
5382
5384
|
asynchronous HTTP request, please pass async_req=True
|
|
5383
5385
|
|
|
5384
|
-
>>> thread = api.
|
|
5386
|
+
>>> thread = api.get_version_aliases_for_artifact_get_with_http_info(artifact_id, async_req=True)
|
|
5385
5387
|
>>> result = thread.get()
|
|
5386
5388
|
|
|
5387
5389
|
:param artifact_id: (required)
|
|
@@ -5408,7 +5410,7 @@ class MlfoundryArtifactsApi:
|
|
|
5408
5410
|
:return: Returns the result object.
|
|
5409
5411
|
If the method is called asynchronously,
|
|
5410
5412
|
returns the request thread.
|
|
5411
|
-
:rtype: tuple(
|
|
5413
|
+
:rtype: tuple(GetArtifactVersionAliasesResponseDto, status_code(int), headers(HTTPHeaderDict))
|
|
5412
5414
|
"""
|
|
5413
5415
|
|
|
5414
5416
|
_params = locals()
|
|
@@ -5431,7 +5433,7 @@ class MlfoundryArtifactsApi:
|
|
|
5431
5433
|
if _key not in _all_params:
|
|
5432
5434
|
raise ApiTypeError(
|
|
5433
5435
|
"Got an unexpected keyword argument '%s'"
|
|
5434
|
-
" to method
|
|
5436
|
+
" to method get_version_aliases_for_artifact_get" % _key
|
|
5435
5437
|
)
|
|
5436
5438
|
_params[_key] = _val
|
|
5437
5439
|
del _params["kwargs"]
|
|
@@ -5462,12 +5464,12 @@ class MlfoundryArtifactsApi:
|
|
|
5462
5464
|
_auth_settings = ["HTTPBearer", "APIKeyCookie"] # noqa: E501
|
|
5463
5465
|
|
|
5464
5466
|
_response_types_map = {
|
|
5465
|
-
"200": "
|
|
5467
|
+
"200": "GetArtifactVersionAliasesResponseDto",
|
|
5466
5468
|
"422": "HTTPValidationError",
|
|
5467
5469
|
}
|
|
5468
5470
|
|
|
5469
5471
|
return self.api_client.call_api(
|
|
5470
|
-
"/api/2.0/mlflow/mlfoundry-artifacts/artifacts/get-
|
|
5472
|
+
"/api/2.0/mlflow/mlfoundry-artifacts/artifacts/get-version-aliases",
|
|
5471
5473
|
"GET",
|
|
5472
5474
|
_path_params,
|
|
5473
5475
|
_query_params,
|
|
@@ -155,8 +155,8 @@ from truefoundry.ml.autogen.client.models.finalize_artifact_version_request_dto
|
|
|
155
155
|
FinalizeArtifactVersionRequestDto,
|
|
156
156
|
)
|
|
157
157
|
from truefoundry.ml.autogen.client.models.framework import Framework
|
|
158
|
-
from truefoundry.ml.autogen.client.models.
|
|
159
|
-
|
|
158
|
+
from truefoundry.ml.autogen.client.models.get_artifact_version_aliases_response_dto import (
|
|
159
|
+
GetArtifactVersionAliasesResponseDto,
|
|
160
160
|
)
|
|
161
161
|
from truefoundry.ml.autogen.client.models.get_experiment_response_dto import (
|
|
162
162
|
GetExperimentResponseDto,
|
|
@@ -24,7 +24,6 @@ from truefoundry.pydantic_v1 import (
|
|
|
24
24
|
Field,
|
|
25
25
|
StrictStr,
|
|
26
26
|
conint,
|
|
27
|
-
conlist,
|
|
28
27
|
constr,
|
|
29
28
|
validator,
|
|
30
29
|
)
|
|
@@ -43,16 +42,35 @@ class ArtifactVersionManifest(BaseModel):
|
|
|
43
42
|
default=...,
|
|
44
43
|
description="+label=Metadata +docs=Metadata for the artifact or model version +usage=Metadata for the artifact or model version +uiType=JsonInput",
|
|
45
44
|
)
|
|
46
|
-
|
|
45
|
+
version_alias: Optional[constr(strict=True, max_length=128)] = Field(
|
|
47
46
|
default=None,
|
|
48
|
-
description="+label=
|
|
47
|
+
description="+label=Version Alias +usage=The version alias for artifact or model version which should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc) +docs=The version alias for artifact or model version which should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc) +message=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc)",
|
|
49
48
|
)
|
|
50
49
|
type: Optional[StrictStr] = "artifact-version"
|
|
51
50
|
source: Source = Field(...)
|
|
52
51
|
step: Optional[conint(strict=True, ge=0)] = Field(
|
|
53
52
|
default=0, description="+label=Step"
|
|
54
53
|
)
|
|
55
|
-
__properties = [
|
|
54
|
+
__properties = [
|
|
55
|
+
"description",
|
|
56
|
+
"metadata",
|
|
57
|
+
"version_alias",
|
|
58
|
+
"type",
|
|
59
|
+
"source",
|
|
60
|
+
"step",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
@validator("version_alias")
|
|
64
|
+
def version_alias_validate_regular_expression(cls, value):
|
|
65
|
+
"""Validates the regular expression"""
|
|
66
|
+
if value is None:
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
if not re.match(r"^v[a-zA-Z0-9.-]*([a-zA-Z0-9]+)$", value):
|
|
70
|
+
raise ValueError(
|
|
71
|
+
r"must validate the regular expression /^v[a-zA-Z0-9.-]*([a-zA-Z0-9]+)$/"
|
|
72
|
+
)
|
|
73
|
+
return value
|
|
56
74
|
|
|
57
75
|
@validator("type")
|
|
58
76
|
def type_validate_enum(cls, value):
|
|
@@ -104,7 +122,7 @@ class ArtifactVersionManifest(BaseModel):
|
|
|
104
122
|
{
|
|
105
123
|
"description": obj.get("description"),
|
|
106
124
|
"metadata": obj.get("metadata"),
|
|
107
|
-
"
|
|
125
|
+
"version_alias": obj.get("version_alias"),
|
|
108
126
|
"type": obj.get("type")
|
|
109
127
|
if obj.get("type") is not None
|
|
110
128
|
else "artifact-version",
|
|
@@ -20,13 +20,13 @@ import re # noqa: F401
|
|
|
20
20
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, conlist
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
class
|
|
23
|
+
class GetArtifactVersionAliasesResponseDto(BaseModel):
|
|
24
24
|
"""
|
|
25
|
-
|
|
25
|
+
GetArtifactVersionAliasesResponseDto
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
__properties = ["
|
|
28
|
+
version_aliases: conlist(StrictStr) = Field(...)
|
|
29
|
+
__properties = ["version_aliases"]
|
|
30
30
|
|
|
31
31
|
class Config:
|
|
32
32
|
"""Pydantic configuration"""
|
|
@@ -43,8 +43,8 @@ class GetArtifactTagsResponseDto(BaseModel):
|
|
|
43
43
|
return json.dumps(self.to_dict())
|
|
44
44
|
|
|
45
45
|
@classmethod
|
|
46
|
-
def from_json(cls, json_str: str) ->
|
|
47
|
-
"""Create an instance of
|
|
46
|
+
def from_json(cls, json_str: str) -> GetArtifactVersionAliasesResponseDto:
|
|
47
|
+
"""Create an instance of GetArtifactVersionAliasesResponseDto from a JSON string"""
|
|
48
48
|
return cls.from_dict(json.loads(json_str))
|
|
49
49
|
|
|
50
50
|
def to_dict(self):
|
|
@@ -53,13 +53,15 @@ class GetArtifactTagsResponseDto(BaseModel):
|
|
|
53
53
|
return _dict
|
|
54
54
|
|
|
55
55
|
@classmethod
|
|
56
|
-
def from_dict(cls, obj: dict) ->
|
|
57
|
-
"""Create an instance of
|
|
56
|
+
def from_dict(cls, obj: dict) -> GetArtifactVersionAliasesResponseDto:
|
|
57
|
+
"""Create an instance of GetArtifactVersionAliasesResponseDto from a dict"""
|
|
58
58
|
if obj is None:
|
|
59
59
|
return None
|
|
60
60
|
|
|
61
61
|
if not isinstance(obj, dict):
|
|
62
|
-
return
|
|
62
|
+
return GetArtifactVersionAliasesResponseDto.parse_obj(obj)
|
|
63
63
|
|
|
64
|
-
_obj =
|
|
64
|
+
_obj = GetArtifactVersionAliasesResponseDto.parse_obj(
|
|
65
|
+
{"version_aliases": obj.get("version_aliases")}
|
|
66
|
+
)
|
|
65
67
|
return _obj
|
|
@@ -28,7 +28,6 @@ from truefoundry.pydantic_v1 import (
|
|
|
28
28
|
Field,
|
|
29
29
|
StrictStr,
|
|
30
30
|
conint,
|
|
31
|
-
conlist,
|
|
32
31
|
constr,
|
|
33
32
|
validator,
|
|
34
33
|
)
|
|
@@ -47,9 +46,9 @@ class ModelVersionManifest(BaseModel):
|
|
|
47
46
|
default=...,
|
|
48
47
|
description="+label=Metadata +docs=Metadata for the artifact or model version +usage=Metadata for the artifact or model version +uiType=JsonInput",
|
|
49
48
|
)
|
|
50
|
-
|
|
49
|
+
version_alias: Optional[constr(strict=True, max_length=128)] = Field(
|
|
51
50
|
default=None,
|
|
52
|
-
description="+label=
|
|
51
|
+
description="+label=Version Alias +usage=The version alias for artifact or model version which should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc) +docs=The version alias for artifact or model version which should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc) +message=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc)",
|
|
53
52
|
)
|
|
54
53
|
type: Optional[StrictStr] = "model-version"
|
|
55
54
|
source: Source1 = Field(...)
|
|
@@ -61,7 +60,7 @@ class ModelVersionManifest(BaseModel):
|
|
|
61
60
|
__properties = [
|
|
62
61
|
"description",
|
|
63
62
|
"metadata",
|
|
64
|
-
"
|
|
63
|
+
"version_alias",
|
|
65
64
|
"type",
|
|
66
65
|
"source",
|
|
67
66
|
"framework",
|
|
@@ -69,6 +68,18 @@ class ModelVersionManifest(BaseModel):
|
|
|
69
68
|
"step",
|
|
70
69
|
]
|
|
71
70
|
|
|
71
|
+
@validator("version_alias")
|
|
72
|
+
def version_alias_validate_regular_expression(cls, value):
|
|
73
|
+
"""Validates the regular expression"""
|
|
74
|
+
if value is None:
|
|
75
|
+
return value
|
|
76
|
+
|
|
77
|
+
if not re.match(r"^v[a-zA-Z0-9.-]*([a-zA-Z0-9]+)$", value):
|
|
78
|
+
raise ValueError(
|
|
79
|
+
r"must validate the regular expression /^v[a-zA-Z0-9.-]*([a-zA-Z0-9]+)$/"
|
|
80
|
+
)
|
|
81
|
+
return value
|
|
82
|
+
|
|
72
83
|
@validator("type")
|
|
73
84
|
def type_validate_enum(cls, value):
|
|
74
85
|
"""Validates the enum"""
|
|
@@ -125,7 +136,7 @@ class ModelVersionManifest(BaseModel):
|
|
|
125
136
|
{
|
|
126
137
|
"description": obj.get("description"),
|
|
127
138
|
"metadata": obj.get("metadata"),
|
|
128
|
-
"
|
|
139
|
+
"version_alias": obj.get("version_alias"),
|
|
129
140
|
"type": obj.get("type")
|
|
130
141
|
if obj.get("type") is not None
|
|
131
142
|
else "model-version",
|
|
@@ -121,7 +121,7 @@ Class | Method | HTTP request | Description
|
|
|
121
121
|
*MlfoundryArtifactsApi* | [**get_signed_urls_for_dataset_write_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#get_signed_urls_for_dataset_write_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/datasets/get-signed-urls-for-write | Get Signed Urls For Dataset Write
|
|
122
122
|
*MlfoundryArtifactsApi* | [**get_signed_urls_for_read_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#get_signed_urls_for_read_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/artifact-versions/get-signed-urls-for-read | Get Signed Urls For Read
|
|
123
123
|
*MlfoundryArtifactsApi* | [**get_signed_urls_for_write_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#get_signed_urls_for_write_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/artifact-versions/get-signed-urls-for-write | Get Signed Urls For Write
|
|
124
|
-
*MlfoundryArtifactsApi* | [**
|
|
124
|
+
*MlfoundryArtifactsApi* | [**get_version_aliases_for_artifact_get**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#get_version_aliases_for_artifact_get) | **GET** /api/2.0/mlflow/mlfoundry-artifacts/artifacts/get-version-aliases | Get Version Aliases For Artifact
|
|
125
125
|
*MlfoundryArtifactsApi* | [**list_artifact_versions_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#list_artifact_versions_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/artifact-versions/list | List Artifact Versions
|
|
126
126
|
*MlfoundryArtifactsApi* | [**list_artifacts_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#list_artifacts_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/artifacts/list | List Artifacts
|
|
127
127
|
*MlfoundryArtifactsApi* | [**list_datasets_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#list_datasets_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/datasets/list | List Datasets
|
|
@@ -220,7 +220,7 @@ Class | Method | HTTP request | Description
|
|
|
220
220
|
- [FileInfoDto](truefoundry/ml/autogen/client/docs/FileInfoDto.md)
|
|
221
221
|
- [FinalizeArtifactVersionRequestDto](truefoundry/ml/autogen/client/docs/FinalizeArtifactVersionRequestDto.md)
|
|
222
222
|
- [Framework](truefoundry/ml/autogen/client/docs/Framework.md)
|
|
223
|
-
- [
|
|
223
|
+
- [GetArtifactVersionAliasesResponseDto](truefoundry/ml/autogen/client/docs/GetArtifactVersionAliasesResponseDto.md)
|
|
224
224
|
- [GetExperimentResponseDto](truefoundry/ml/autogen/client/docs/GetExperimentResponseDto.md)
|
|
225
225
|
- [GetLatestRunLogResponseDto](truefoundry/ml/autogen/client/docs/GetLatestRunLogResponseDto.md)
|
|
226
226
|
- [GetMetricHistoryResponse](truefoundry/ml/autogen/client/docs/GetMetricHistoryResponse.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: artifacts.json
|
|
3
|
-
# timestamp:
|
|
3
|
+
# timestamp: 2025-01-03T09:11:54+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -58,16 +58,11 @@ class BaseArtifactVersion(BaseModel):
|
|
|
58
58
|
...,
|
|
59
59
|
description="+label=Metadata\n+docs=Metadata for the artifact or model version\n+usage=Metadata for the artifact or model version\n+uiType=JsonInput",
|
|
60
60
|
)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
constr(
|
|
64
|
-
regex=r"^(?!^\d+$)(?!.*[._-]{2,})[a-zA-Z0-9]+([._-][a-zA-Z0-9]+)*$",
|
|
65
|
-
max_length=128,
|
|
66
|
-
)
|
|
67
|
-
]
|
|
61
|
+
version_alias: Optional[
|
|
62
|
+
constr(regex=r"^v[a-zA-Z0-9.-]*([a-zA-Z0-9]+)$", max_length=128)
|
|
68
63
|
] = Field(
|
|
69
64
|
None,
|
|
70
|
-
description="+label=
|
|
65
|
+
description="+label=Version Alias\n+usage=The version alias for artifact or model version which should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc)\n+docs=The version alias for artifact or model version which should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc)\n+message=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v-prod, v-dev, etc)",
|
|
71
66
|
)
|
|
72
67
|
|
|
73
68
|
|
|
@@ -84,7 +84,7 @@ class ArtifactVersion:
|
|
|
84
84
|
self._deleted = False
|
|
85
85
|
self._description: str = ""
|
|
86
86
|
self._metadata: Dict[str, Any] = {}
|
|
87
|
-
self.
|
|
87
|
+
self._version_alias: Optional[str] = None
|
|
88
88
|
self._set_mutable_attrs()
|
|
89
89
|
|
|
90
90
|
@classmethod
|
|
@@ -132,13 +132,13 @@ class ArtifactVersion:
|
|
|
132
132
|
manifest = self._artifact_version.manifest.actual_instance
|
|
133
133
|
self._description = manifest.description or ""
|
|
134
134
|
self._metadata = copy.deepcopy(manifest.metadata)
|
|
135
|
-
self.
|
|
135
|
+
self._version_alias = manifest.version_alias or None
|
|
136
136
|
else:
|
|
137
137
|
self._description = self._artifact_version.description or ""
|
|
138
138
|
self._metadata = copy.deepcopy(
|
|
139
139
|
self._artifact_version.artifact_metadata or {}
|
|
140
140
|
)
|
|
141
|
-
self.
|
|
141
|
+
self._version_alias = None
|
|
142
142
|
|
|
143
143
|
def _refetch_artifact_version(self, reset_mutable_attrs: bool = True):
|
|
144
144
|
_artifact_version = (
|
|
@@ -211,31 +211,31 @@ class ArtifactVersion:
|
|
|
211
211
|
self._metadata = copy.deepcopy(value)
|
|
212
212
|
|
|
213
213
|
@property
|
|
214
|
-
def
|
|
214
|
+
def version_alias(self) -> Optional[str]:
|
|
215
215
|
"""
|
|
216
|
-
Get
|
|
216
|
+
Get version alias for the current artifact version
|
|
217
217
|
"""
|
|
218
218
|
if not self._artifact_version.manifest:
|
|
219
219
|
warnings.warn(
|
|
220
|
-
message="This
|
|
220
|
+
message="This artifact version was created using an older serialization format. version alias does not exist",
|
|
221
221
|
category=TrueFoundryDeprecationWarning,
|
|
222
222
|
stacklevel=2,
|
|
223
223
|
)
|
|
224
|
-
return self.
|
|
224
|
+
return self._version_alias
|
|
225
225
|
|
|
226
|
-
@
|
|
227
|
-
def
|
|
226
|
+
@version_alias.setter
|
|
227
|
+
def version_alias(self, value: Optional[str]):
|
|
228
228
|
"""
|
|
229
|
-
Set the
|
|
229
|
+
Set the version alias for current artifact version
|
|
230
230
|
"""
|
|
231
231
|
if not self._artifact_version.manifest:
|
|
232
232
|
warnings.warn(
|
|
233
|
-
message="This
|
|
233
|
+
message="This artifact version was created using an older serialization format. version alias will not be updated",
|
|
234
234
|
category=TrueFoundryDeprecationWarning,
|
|
235
235
|
stacklevel=2,
|
|
236
236
|
)
|
|
237
237
|
return
|
|
238
|
-
self.
|
|
238
|
+
self._version_alias = value
|
|
239
239
|
|
|
240
240
|
@property
|
|
241
241
|
def created_at(self) -> Optional[datetime.datetime]:
|
|
@@ -399,7 +399,7 @@ class ArtifactVersion:
|
|
|
399
399
|
assert isinstance(manifest, ArtifactVersionManifest)
|
|
400
400
|
manifest.description = self.description
|
|
401
401
|
manifest.metadata = self.metadata
|
|
402
|
-
manifest.
|
|
402
|
+
manifest.version_alias = self.version_alias
|
|
403
403
|
else:
|
|
404
404
|
manifest = None
|
|
405
405
|
try:
|
|
@@ -8,7 +8,7 @@ import typing
|
|
|
8
8
|
import uuid
|
|
9
9
|
import warnings
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
from typing import TYPE_CHECKING, Any, Dict,
|
|
11
|
+
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
|
12
12
|
|
|
13
13
|
from truefoundry.common.warnings import TrueFoundryDeprecationWarning
|
|
14
14
|
from truefoundry.ml.artifact.truefoundry_artifact_repo import (
|
|
@@ -109,7 +109,7 @@ class ModelVersion:
|
|
|
109
109
|
self._metadata: Dict[str, Any] = {}
|
|
110
110
|
self._environment: Optional[ModelVersionEnvironment] = None
|
|
111
111
|
self._framework: Optional[ModelFrameworkType] = None
|
|
112
|
-
self.
|
|
112
|
+
self._version_alias: Optional[str] = None
|
|
113
113
|
self._set_mutable_attrs()
|
|
114
114
|
|
|
115
115
|
@classmethod
|
|
@@ -160,7 +160,7 @@ class ModelVersion:
|
|
|
160
160
|
if manifest.framework
|
|
161
161
|
else None
|
|
162
162
|
)
|
|
163
|
-
self.
|
|
163
|
+
self._version_alias = self._model_version.manifest.version_alias or None
|
|
164
164
|
else:
|
|
165
165
|
self._description = self._model_version.description or ""
|
|
166
166
|
self._metadata = copy.deepcopy(self._model_version.artifact_metadata or {})
|
|
@@ -168,7 +168,7 @@ class ModelVersion:
|
|
|
168
168
|
self._framework = _ModelFramework.to_model_framework_type(
|
|
169
169
|
self._model_version.model_framework
|
|
170
170
|
)
|
|
171
|
-
self.
|
|
171
|
+
self._version_alias = None
|
|
172
172
|
|
|
173
173
|
def _refetch_model_version(self, reset_mutable_attrs: bool = True):
|
|
174
174
|
_model_version = self._mlfoundry_artifacts_api.get_model_version_get(
|
|
@@ -239,31 +239,31 @@ class ModelVersion:
|
|
|
239
239
|
self._metadata = copy.deepcopy(value)
|
|
240
240
|
|
|
241
241
|
@property
|
|
242
|
-
def
|
|
242
|
+
def version_alias(self) -> Optional[str]:
|
|
243
243
|
"""
|
|
244
|
-
Get
|
|
244
|
+
Get version alias for the current model version
|
|
245
245
|
"""
|
|
246
246
|
if not self._model_version.manifest:
|
|
247
247
|
warnings.warn(
|
|
248
|
-
message="This model version was created using an older serialization format.
|
|
248
|
+
message="This model version was created using an older serialization format. version alias does not exist",
|
|
249
249
|
category=TrueFoundryDeprecationWarning,
|
|
250
250
|
stacklevel=2,
|
|
251
251
|
)
|
|
252
|
-
return self.
|
|
252
|
+
return self._version_alias
|
|
253
253
|
|
|
254
|
-
@
|
|
255
|
-
def
|
|
254
|
+
@version_alias.setter
|
|
255
|
+
def version_alias(self, value: Optional[str]):
|
|
256
256
|
"""
|
|
257
|
-
Set the
|
|
257
|
+
Set the version alias for current artifact version
|
|
258
258
|
"""
|
|
259
259
|
if not self._model_version.manifest:
|
|
260
260
|
warnings.warn(
|
|
261
|
-
message="This model version was created using an older serialization format.
|
|
261
|
+
message="This model version was created using an older serialization format. version alias will not be updated",
|
|
262
262
|
category=TrueFoundryDeprecationWarning,
|
|
263
263
|
stacklevel=2,
|
|
264
264
|
)
|
|
265
265
|
return
|
|
266
|
-
self.
|
|
266
|
+
self._version_alias = value
|
|
267
267
|
|
|
268
268
|
@property
|
|
269
269
|
def environment(self) -> Optional[ModelVersionEnvironment]:
|
|
@@ -489,7 +489,7 @@ class ModelVersion:
|
|
|
489
489
|
self._model_version.manifest.framework = (
|
|
490
490
|
Framework.from_dict(self.framework.dict()) if self.framework else None
|
|
491
491
|
)
|
|
492
|
-
self._model_version.manifest.
|
|
492
|
+
self._model_version.manifest.version_alias = self.version_alias
|
|
493
493
|
try:
|
|
494
494
|
_model_version = self._mlfoundry_artifacts_api.update_model_version_post(
|
|
495
495
|
update_model_version_request_dto=UpdateModelVersionRequestDto(
|
|
@@ -25,7 +25,6 @@ truefoundry/autodeploy/utils/diff.py,sha256=Ef8Y-VffDKel_-q-GxRam6gqiv8qTLMcqVg6
|
|
|
25
25
|
truefoundry/autodeploy/utils/pydantic_compat.py,sha256=hEAUy5kLjhPdzw7yGZ2iXGMXbbMVXVlGzIofmyHafXQ,412
|
|
26
26
|
truefoundry/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
27
|
truefoundry/cli/__main__.py,sha256=0nEwE0UkFagCO5ctGcqEThdmBT2fN8MVcr0ERItnsNQ,3483
|
|
28
|
-
truefoundry/cli/commands/pat.py,sha256=0rm95ny1b3KfeBJSRWh1M4lR46ERnp96ovUZKu-P5Ss,602
|
|
29
28
|
truefoundry/cli/config.py,sha256=tf8w4UfVzcC6eYkENvuuCPYt_V3sqVpO1bclORV9tAk,206
|
|
30
29
|
truefoundry/cli/console.py,sha256=9-dMy4YPisCJQziRKTg8Qa0UJnOGl1soiUnJjsnLDvE,242
|
|
31
30
|
truefoundry/cli/const.py,sha256=dVHPo1uAiDSSMXwXoT2mR5kNQjExT98QNVRz98Hz_Ts,510
|
|
@@ -44,8 +43,8 @@ truefoundry/common/session.py,sha256=BiTJ2WEzLkTvzpqy67xX3fXgiKH_ltzzmQdFG7xUtwI
|
|
|
44
43
|
truefoundry/common/storage_provider_utils.py,sha256=yURhMw8k0FLFvaviRHDiifhvc6GnuQwGMC9Qd2uM440,10934
|
|
45
44
|
truefoundry/common/utils.py,sha256=sZyg-vpShVXvnrwnINrdsyWJR3FHMUBiOB1CslYdQTo,6072
|
|
46
45
|
truefoundry/common/warnings.py,sha256=rs6BHwk7imQYedo07iwh3TWEOywAR3Lqhj0AY4khByg,504
|
|
47
|
-
truefoundry/deploy/__init__.py,sha256=
|
|
48
|
-
truefoundry/deploy/auto_gen/models.py,sha256=
|
|
46
|
+
truefoundry/deploy/__init__.py,sha256=e0EgG-fVJ6N9PNIlBINO6QtIMEehQgmz3ONPPjYlcSY,2596
|
|
47
|
+
truefoundry/deploy/auto_gen/models.py,sha256=B1Ze90HKsMTh0telC_nyPaep1guos-hqfZr6ztAZ9LM,87574
|
|
49
48
|
truefoundry/deploy/builder/__init__.py,sha256=1qjHMNBE1poRCZW0WrG46dFM1f1IlivD5352qzsioMU,4953
|
|
50
49
|
truefoundry/deploy/builder/builders/__init__.py,sha256=tlFLXqyDaKLd4iZbo4Hcu_8gOmgtL6drnXpbmQ6x1P8,636
|
|
51
50
|
truefoundry/deploy/builder/builders/dockerfile.py,sha256=AXXTziCkaqIhuM_bwyD1vT1znOwemN1TKgU7eyo-KuM,1522
|
|
@@ -83,7 +82,7 @@ truefoundry/deploy/io/output_callback.py,sha256=V2YwUFec4G4a67lM4r-x_64AqdOVNo_9
|
|
|
83
82
|
truefoundry/deploy/io/rich_output_callback.py,sha256=TJLiRD-EnFVwgcepxR7WN0koKqW1X2DevETPhNPi_nU,829
|
|
84
83
|
truefoundry/deploy/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
85
84
|
truefoundry/deploy/lib/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
|
-
truefoundry/deploy/lib/clients/servicefoundry_client.py,sha256=
|
|
85
|
+
truefoundry/deploy/lib/clients/servicefoundry_client.py,sha256=E1AZo3KmvvXoCQV4Z7A8Iy_iPH8HethHPR-xnAImEEE,26096
|
|
87
86
|
truefoundry/deploy/lib/const.py,sha256=Wg0GDnfFu-g1fJr4lU80NH2ULw0R0dYjV7LnW-PbOeM,173
|
|
88
87
|
truefoundry/deploy/lib/dao/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
88
|
truefoundry/deploy/lib/dao/application.py,sha256=oMszpueXPUfTUuN_XdKwoRjQyqAgWHhZ-10cbprCVdM,9226
|
|
@@ -94,28 +93,24 @@ truefoundry/deploy/lib/logs_utils.py,sha256=SQxRv3jDDmgHdOUMhlMaAPGYskybnBUMpst7
|
|
|
94
93
|
truefoundry/deploy/lib/messages.py,sha256=nhp0bCYf_XpUM68hTq5lBY-__vtEyV2uP7NgnJXJ_Vg,925
|
|
95
94
|
truefoundry/deploy/lib/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
95
|
truefoundry/deploy/lib/model/entity.py,sha256=3YRdyvMYI1aUXUu2tB5b5lZWwpxKdAhjpT79gzTCZGo,8373
|
|
97
|
-
truefoundry/deploy/lib/session.py,sha256=
|
|
96
|
+
truefoundry/deploy/lib/session.py,sha256=FBSq3bxf3my_613NzgtPoeeaAYLGZEoF0n7XccTFNf4,5141
|
|
98
97
|
truefoundry/deploy/lib/util.py,sha256=J7r8San2wKo48A7-BlH2-OKTlBO67zlPjLEhMsL8os0,1059
|
|
99
98
|
truefoundry/deploy/lib/win32.py,sha256=1RcvPTdlOAJ48rt8rCbE2Ufha2ztRqBAE9dueNXArrY,5009
|
|
100
99
|
truefoundry/deploy/python_deploy_codegen.py,sha256=qJHH1BJQII9e6PhkcRFYiE_3De7_VMMm8nM4AX5Eq1o,6513
|
|
101
100
|
truefoundry/deploy/v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
101
|
truefoundry/deploy/v2/lib/__init__.py,sha256=WEiVMZXOVljzEE3tpGJil14liIn_PCDoACJ6b3tZ6sI,188
|
|
103
|
-
truefoundry/deploy/v2/lib/deploy.py,sha256=
|
|
102
|
+
truefoundry/deploy/v2/lib/deploy.py,sha256=Q4CL8SKnFLQ1FRqFyIwOAf77j_rP-fv58e-F-s3GqBw,12105
|
|
104
103
|
truefoundry/deploy/v2/lib/deploy_workflow.py,sha256=6Y4PNhd5PCc_4TjpcIZPkr6FCm3BNIQ_SsJTvpUu7a0,12579
|
|
105
|
-
truefoundry/deploy/v2/lib/deployable_patched_models.py,sha256=
|
|
104
|
+
truefoundry/deploy/v2/lib/deployable_patched_models.py,sha256=FmpZWpSbBTHe4yt0XMIPgdCNy_Rw1aXQCt8icv8TcWE,3701
|
|
106
105
|
truefoundry/deploy/v2/lib/models.py,sha256=pSolLMTArDuYpeNsmeeS5DWliloN_iCDfZSpRllMHUg,1120
|
|
107
|
-
truefoundry/deploy/v2/lib/patched_models.py,sha256=
|
|
108
|
-
truefoundry/deploy/v2/lib/source.py,sha256=
|
|
109
|
-
truefoundry/gateway/__init__.py,sha256=HvAMuk60-fuZcMmdOtozHrUaH_JcbEHxpMSlS9ci4ls,41
|
|
110
|
-
truefoundry/gateway/cli/cli.py,sha256=9raS6Nq_CNzagEPpbKICwUZ01zMoqmZINKMB9m_gJRE,908
|
|
111
|
-
truefoundry/gateway/lib/entities.py,sha256=1P9YjrMoHbg58M57Pq-HlsT1ISHRyyX4JxK-o4of6cY,695
|
|
112
|
-
truefoundry/gateway/lib/models.py,sha256=TXOur51tuYkq4Xil-icNVaVH-7xZbdOUyqS8N9295dg,876
|
|
106
|
+
truefoundry/deploy/v2/lib/patched_models.py,sha256=VkDzYzlKpFu7yCsqdMUL44YS-pTIxHegBO87-jjttTM,16370
|
|
107
|
+
truefoundry/deploy/v2/lib/source.py,sha256=wArU8AwSy7U9EUGLEMmB4Ke7ZwgZWmh8fFU-PACogIk,9347
|
|
113
108
|
truefoundry/logger.py,sha256=u-YCNjg5HBwE70uQcpjIG64Ghos-K2ulTWaxC03BSj4,714
|
|
114
109
|
truefoundry/ml/__init__.py,sha256=ssUEIs8BixPWxynKoeSh-dkRl6AtLXG0PBGYnUR5Az8,2217
|
|
115
110
|
truefoundry/ml/artifact/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
116
111
|
truefoundry/ml/artifact/truefoundry_artifact_repo.py,sha256=myDpr3RZzEkd_UG9C3rZ4UKEFxXopO5HMVJNpNDiuAo,37737
|
|
117
112
|
truefoundry/ml/autogen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
118
|
-
truefoundry/ml/autogen/client/__init__.py,sha256=
|
|
113
|
+
truefoundry/ml/autogen/client/__init__.py,sha256=28MIn6pjqHZlnjuljt-kgrR7Dw07It7khbMZm3dlQlY,20118
|
|
119
114
|
truefoundry/ml/autogen/client/api/__init__.py,sha256=NyMBxBmIzB1o5LzZZwz9LiydHB3-hPqc_sevsnY6Jrw,746
|
|
120
115
|
truefoundry/ml/autogen/client/api/auth_api.py,sha256=zpWzJhUmW6HHMY_atlUf0B25k77E1kue2hmix5I5Ih0,7017
|
|
121
116
|
truefoundry/ml/autogen/client/api/deprecated_api.py,sha256=mu5x_skNcwz8v1Tr6VP72-tVP7pmBV9muyKy_2NH3F0,38824
|
|
@@ -123,14 +118,14 @@ truefoundry/ml/autogen/client/api/experiments_api.py,sha256=mRKS8qGzcFJUpTWjfQoF
|
|
|
123
118
|
truefoundry/ml/autogen/client/api/generate_code_snippet_api.py,sha256=C8iABP-pYIyIoTlL8PFi3ZBG_6B_dkQf09eErNeoj7A,22316
|
|
124
119
|
truefoundry/ml/autogen/client/api/health_api.py,sha256=IAPhRAo9CLUT5ipVR1fCf-qDx57UR0wg5ekhtUl8lug,11554
|
|
125
120
|
truefoundry/ml/autogen/client/api/metrics_api.py,sha256=q3L38eD-2hu4_9YvcSdnWDYXD2V8il-X9reinOAABek,14908
|
|
126
|
-
truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py,sha256=
|
|
121
|
+
truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py,sha256=i3OaGysy3Th-ZVqJ6HenSn7W7cQkRUDS_G5D28tk6e4,319913
|
|
127
122
|
truefoundry/ml/autogen/client/api/run_artifacts_api.py,sha256=x-vVnY2LEFChZxiiFauswRWwFz6Qqh30PKXjzuTvxmc,8799
|
|
128
123
|
truefoundry/ml/autogen/client/api/runs_api.py,sha256=-aghrZ2VYuZOw_vBtOzWDsnK7Ji29oZQxK2CLRgyo2w,119232
|
|
129
124
|
truefoundry/ml/autogen/client/api_client.py,sha256=M31IycWorn10FYS8WbO_Whaipr0tVu2pVWFCfbS7XCo,29167
|
|
130
125
|
truefoundry/ml/autogen/client/api_response.py,sha256=KRyvecPMXF05PaxILHZ8JHoP4rgKBjKONMgG83aU-rM,844
|
|
131
126
|
truefoundry/ml/autogen/client/configuration.py,sha256=V1oaEnxt-NfpaNmp-EZpf2glovzVhM2coWYt8HBNB4M,15723
|
|
132
127
|
truefoundry/ml/autogen/client/exceptions.py,sha256=XbCbDHhYT3BVejdoGNPgEa4oS56ypkwFdxk1iOc_tFY,5355
|
|
133
|
-
truefoundry/ml/autogen/client/models/__init__.py,sha256=
|
|
128
|
+
truefoundry/ml/autogen/client/models/__init__.py,sha256=m2SztLLPzl_aifXj8-aFFl_gqkArLijw0ZLabOFOdCM,18740
|
|
134
129
|
truefoundry/ml/autogen/client/models/add_custom_metrics_to_model_version_request_dto.py,sha256=_ISDspicTGjBCYYXubKfRYYSSQVyW3AvG-jFh47-Zfc,2163
|
|
135
130
|
truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py,sha256=OT1-98DyWNfAHz_EgD2gMX2XkrGQ4Re945fhoAl8qSE,2099
|
|
136
131
|
truefoundry/ml/autogen/client/models/agent.py,sha256=lUAbs092yo9hZmqzX6atKebDNf1uEwTf5jLvjOdvoeM,3872
|
|
@@ -142,7 +137,7 @@ truefoundry/ml/autogen/client/models/artifact_dto.py,sha256=JWL8_sITJJXbxywcfRj4
|
|
|
142
137
|
truefoundry/ml/autogen/client/models/artifact_response_dto.py,sha256=T_HLjkHnqiO1bnSXiCUOlwDEHGz89mlUNhBq0SJTapo,2226
|
|
143
138
|
truefoundry/ml/autogen/client/models/artifact_type.py,sha256=LBXGYUoesmL5J-0xzCR8jBST3bjb6HY86RmqSGvytRs,828
|
|
144
139
|
truefoundry/ml/autogen/client/models/artifact_version_dto.py,sha256=GXjjKycpsEgJ60V2hAfL4NMxM2gZKLP2qV2yBb9WgdM,6174
|
|
145
|
-
truefoundry/ml/autogen/client/models/artifact_version_manifest.py,sha256=
|
|
140
|
+
truefoundry/ml/autogen/client/models/artifact_version_manifest.py,sha256=AOg17pPxbOuqmSLCBj_us4_heijpr_k-CZWnl87RExw,4829
|
|
146
141
|
truefoundry/ml/autogen/client/models/artifact_version_response_dto.py,sha256=JmiSYdPYG-ki6LCBeF7NtihdQ2LPiHld8cSPivY2GmQ,2421
|
|
147
142
|
truefoundry/ml/autogen/client/models/artifact_version_serialization_format.py,sha256=2Qfgq1nykn0_mKNEJzOxhQwHm_95WIr9wJcHLeFWXQM,774
|
|
148
143
|
truefoundry/ml/autogen/client/models/artifact_version_status.py,sha256=iIcomqhuaJkZH2rT3e6IjQutM79t9hEshW-RCIMKHEY,780
|
|
@@ -193,7 +188,7 @@ truefoundry/ml/autogen/client/models/fast_ai_framework.py,sha256=GwVoMbIzYhr4srF
|
|
|
193
188
|
truefoundry/ml/autogen/client/models/file_info_dto.py,sha256=7oc8venicsFVk8zT9wHNhHnZGtFkFlqimFnS7ozGL9k,2156
|
|
194
189
|
truefoundry/ml/autogen/client/models/finalize_artifact_version_request_dto.py,sha256=tkPcNjI0_qhX-D3m6AXqLzdmo9_K0tFBtbPDeg0Zo7U,3818
|
|
195
190
|
truefoundry/ml/autogen/client/models/framework.py,sha256=W_KrqH1qKRvlrssCCWFIlmPaeAw0eiM6VqS3pbdlMXU,14720
|
|
196
|
-
truefoundry/ml/autogen/client/models/
|
|
191
|
+
truefoundry/ml/autogen/client/models/get_artifact_version_aliases_response_dto.py,sha256=W064ced8EQCeyJLpKikEtkCzuiqUDwNjS56sh7Mc3yg,2029
|
|
197
192
|
truefoundry/ml/autogen/client/models/get_experiment_response_dto.py,sha256=FhJpoUeRbZV1s1KR3Y07Kv6U4enLbbgdpGbguT9us0A,2923
|
|
198
193
|
truefoundry/ml/autogen/client/models/get_latest_run_log_response_dto.py,sha256=g5NG252VzjGHiA-w5nhxmZxGrowJO9XCHDQTjf8y2KE,2266
|
|
199
194
|
truefoundry/ml/autogen/client/models/get_metric_history_response.py,sha256=rTchO8o4sjGsNaZj8TW-VGtGGxsOBjUGzgaAWNtBZ-k,2428
|
|
@@ -252,7 +247,7 @@ truefoundry/ml/autogen/client/models/model_response_dto.py,sha256=osrTxfygkuhxWj
|
|
|
252
247
|
truefoundry/ml/autogen/client/models/model_server.py,sha256=N5mcWmnX0KzTMtTH8A9h_FmiQcMld3B8CXD_UYeDKaA,700
|
|
253
248
|
truefoundry/ml/autogen/client/models/model_version_dto.py,sha256=9Mh4d8V33gEGYr4sys5lYYDA3bHKajR3oAZLZMAy_io,7094
|
|
254
249
|
truefoundry/ml/autogen/client/models/model_version_environment.py,sha256=wTayQjMen24eJCqXQugzoXLANY5NXdVsAvZSh-QIhJA,2827
|
|
255
|
-
truefoundry/ml/autogen/client/models/model_version_manifest.py,sha256=
|
|
250
|
+
truefoundry/ml/autogen/client/models/model_version_manifest.py,sha256=UrusTkY39LBGpVfjIt0xG-zbnSIa6zVfqzxMXOQGOPI,5822
|
|
256
251
|
truefoundry/ml/autogen/client/models/model_version_response_dto.py,sha256=D6XOCyggxqTkbePuypqYSHYh1PYeDv7R_J32q61sDM0,2320
|
|
257
252
|
truefoundry/ml/autogen/client/models/multi_part_upload_dto.py,sha256=Ckq405vud8RQmMyKCJQJBlW5iXO7Y2mlgo8eVkiMvxg,3738
|
|
258
253
|
truefoundry/ml/autogen/client/models/multi_part_upload_response_dto.py,sha256=VjH0kvl7rMjgDHjYGHnsh7KsZ5-qn-k3ksdGLJ49nIM,2431
|
|
@@ -313,8 +308,8 @@ truefoundry/ml/autogen/client/models/xg_boost_framework.py,sha256=a0EHzncxe_hSFU
|
|
|
313
308
|
truefoundry/ml/autogen/client/models/xg_boost_model_schema.py,sha256=QKJkiERNqF8UiolX2FjvhkUkUlUgDoo3CpTYPAdCxV8,2735
|
|
314
309
|
truefoundry/ml/autogen/client/models/xg_boost_serialization_format.py,sha256=wFFSH0Z9MP8eT_fysHfUu4iqdjEZART-HxTH4e4gNI8,872
|
|
315
310
|
truefoundry/ml/autogen/client/rest.py,sha256=9goba8qHjQuVx5O_yRaTKu7PvBnb7r7swfy3dwuTEgk,14281
|
|
316
|
-
truefoundry/ml/autogen/client_README.md,sha256=
|
|
317
|
-
truefoundry/ml/autogen/entities/artifacts.py,sha256=
|
|
311
|
+
truefoundry/ml/autogen/client_README.md,sha256=qrAp9e6D4rKZETpvJry0U8Yn2ZkxDHMA9NUNsfmO_JY,37326
|
|
312
|
+
truefoundry/ml/autogen/entities/artifacts.py,sha256=jLBQk5OYpdhXwwLEIAQLkT-ttZbg522FBWHvgwOCQGQ,20995
|
|
318
313
|
truefoundry/ml/autogen/models/__init__.py,sha256=--TGRea9SQBWFfwtcl3ekb1XGfFTdEkQGSG8a2SJ60I,187
|
|
319
314
|
truefoundry/ml/autogen/models/exceptions.py,sha256=q3n7FGBrg_hUy1UyoefhMnhcXUAaqXlLIGHoOVzn_d8,1390
|
|
320
315
|
truefoundry/ml/autogen/models/schema.py,sha256=IhpO9qbygLqEamP3NIt3m90SseJXCOm1ZTqNbNbW-M0,55772
|
|
@@ -335,11 +330,11 @@ truefoundry/ml/exceptions.py,sha256=QpDJSWmF7dIsByS0qOQbQZ_jytdNTzkHDDO3BxhTSo0,
|
|
|
335
330
|
truefoundry/ml/git_info.py,sha256=jvAVm9ilqivnGq8qJdUvYdd8Siv0PLtqurB-PXsS5ho,2023
|
|
336
331
|
truefoundry/ml/internal_namespace.py,sha256=QcqMHp6-C2im2H_02hlhi01EIcr1HhNaZprszs13EMU,1790
|
|
337
332
|
truefoundry/ml/log_types/__init__.py,sha256=g4u4D4Jaj0aBK5GtrLV88-qThKZR9pSZ17vFEkN-LmM,125
|
|
338
|
-
truefoundry/ml/log_types/artifacts/artifact.py,sha256=
|
|
333
|
+
truefoundry/ml/log_types/artifacts/artifact.py,sha256=b7GXYQx6MVI5qnPIS96xGqwwWVKGY4LYrEU9pCKkU_Y,21772
|
|
339
334
|
truefoundry/ml/log_types/artifacts/constants.py,sha256=qKxQ5mMvJE4j83BvGW3qNTKunxCiBg_EEjTdgbgJtyE,1036
|
|
340
335
|
truefoundry/ml/log_types/artifacts/dataset.py,sha256=a4dxd2EN8p7Ci-cLGGiDOboN3t0395_XhWE1dmTw1Q4,13112
|
|
341
336
|
truefoundry/ml/log_types/artifacts/general_artifact.py,sha256=B4XErLr-m6RmQWtxMTu3wlFRFcqSwPYp6J0OL4Ng6L0,3179
|
|
342
|
-
truefoundry/ml/log_types/artifacts/model.py,sha256=
|
|
337
|
+
truefoundry/ml/log_types/artifacts/model.py,sha256=UfGKJA9ywDtXEIH6E-VfdjvlQNdaKO-Kv76KaTZOVkA,24413
|
|
343
338
|
truefoundry/ml/log_types/artifacts/utils.py,sha256=MuPk6by8jIt7LepB1fqUC8emQBSxrTGJmIel7rbMBAc,7533
|
|
344
339
|
truefoundry/ml/log_types/image/__init__.py,sha256=fcOq8yQnNj1rkLcPeIjLXBpdA1WIeiPsXOlAAvMxx7M,76
|
|
345
340
|
truefoundry/ml/log_types/image/constants.py,sha256=wLtGEOA4T5fZHSlOXPuNDLX3lpbCtwlvGKPFk_1fah0,255
|
|
@@ -373,7 +368,7 @@ truefoundry/workflow/remote_filesystem/tfy_signed_url_client.py,sha256=xcT0wQmQl
|
|
|
373
368
|
truefoundry/workflow/remote_filesystem/tfy_signed_url_fs.py,sha256=nSGPZu0Gyd_jz0KsEE-7w_BmnTD8CVF1S8cUJoxaCbc,13305
|
|
374
369
|
truefoundry/workflow/task.py,sha256=ToitYiKcNzFCtOVQwz1W8sRjbR97eVS7vQBdbgUQtKg,1779
|
|
375
370
|
truefoundry/workflow/workflow.py,sha256=WaTqUjhwfAXDWu4E5ehuwAxrCbDJkoAf1oWmR2E9Qy0,4575
|
|
376
|
-
truefoundry-0.5.
|
|
377
|
-
truefoundry-0.5.
|
|
378
|
-
truefoundry-0.5.
|
|
379
|
-
truefoundry-0.5.
|
|
371
|
+
truefoundry-0.5.5.dist-info/METADATA,sha256=tAB2DHOeD0JgYGfDPp48HY1IU0b5zX1yOzMoYzrdbh0,2884
|
|
372
|
+
truefoundry-0.5.5.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
373
|
+
truefoundry-0.5.5.dist-info/entry_points.txt,sha256=TXvUxQkI6zmqJuycPsyxEIMr3oqfDjgrWj0m_9X12x4,95
|
|
374
|
+
truefoundry-0.5.5.dist-info/RECORD,,
|
truefoundry/cli/commands/pat.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import click
|
|
2
|
-
|
|
3
|
-
from truefoundry.cli.console import console
|
|
4
|
-
from truefoundry.cli.const import COMMAND_CLS
|
|
5
|
-
from truefoundry.deploy.lib.clients.servicefoundry_client import (
|
|
6
|
-
ServiceFoundryServiceClient,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@click.command(cls=COMMAND_CLS, name="generate-api-key")
|
|
11
|
-
@click.option(
|
|
12
|
-
"--name",
|
|
13
|
-
required=True,
|
|
14
|
-
help="Name for the API key",
|
|
15
|
-
)
|
|
16
|
-
def generate_pat(name: str):
|
|
17
|
-
"""Generate a new Personal Access Token with specified name"""
|
|
18
|
-
client = ServiceFoundryServiceClient()
|
|
19
|
-
pat = client.create_pat(name)
|
|
20
|
-
console.print(pat)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def get_generate_pat_command():
|
|
24
|
-
return generate_pat
|
truefoundry/gateway/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""Gateway module for Truefoundry CLI"""
|
truefoundry/gateway/cli/cli.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import click
|
|
2
|
-
|
|
3
|
-
from truefoundry.cli.const import COMMAND_CLS, GROUP_CLS
|
|
4
|
-
from truefoundry.cli.display_util import print_entity_list
|
|
5
|
-
from truefoundry.gateway.lib.models import list_models
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def get_gateway_cli():
|
|
9
|
-
@click.group(cls=GROUP_CLS, help="Commands to interact with TrueFoundry Gateway")
|
|
10
|
-
def gateway(): ...
|
|
11
|
-
|
|
12
|
-
@gateway.group("list", cls=GROUP_CLS, help="List gateway resources")
|
|
13
|
-
def list_group():
|
|
14
|
-
"""List gateway resources"""
|
|
15
|
-
pass
|
|
16
|
-
|
|
17
|
-
@list_group.command(
|
|
18
|
-
"models", cls=COMMAND_CLS, help="List available models filtered by type"
|
|
19
|
-
)
|
|
20
|
-
@click.option(
|
|
21
|
-
"--type",
|
|
22
|
-
"model_type",
|
|
23
|
-
type=click.Choice(["chat", "completion", "embedding"]),
|
|
24
|
-
help="Filter models by type",
|
|
25
|
-
)
|
|
26
|
-
def list_models_cli(model_type: str):
|
|
27
|
-
enabled_models = list_models(model_type)
|
|
28
|
-
print_entity_list("Models", enabled_models)
|
|
29
|
-
|
|
30
|
-
return gateway
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
from typing import Any, Dict, List, Optional, Union
|
|
2
|
-
|
|
3
|
-
from truefoundry.pydantic_v1 import BaseModel
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class GatewayModel(BaseModel):
|
|
7
|
-
id: str
|
|
8
|
-
name: str
|
|
9
|
-
provider: str
|
|
10
|
-
model_id: Optional[str]
|
|
11
|
-
provider_account_name: str
|
|
12
|
-
tfy_application_id: Optional[str] = None
|
|
13
|
-
enabled: bool = True
|
|
14
|
-
types: Union[str, List[str]] = ""
|
|
15
|
-
created_by: str
|
|
16
|
-
tenant_name: str
|
|
17
|
-
model_fqn: str
|
|
18
|
-
|
|
19
|
-
def list_row_data(self) -> Dict[str, Any]:
|
|
20
|
-
return {
|
|
21
|
-
"model_id": self.model_fqn,
|
|
22
|
-
"provider": self.provider,
|
|
23
|
-
"provider_model_id": self.model_id,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class ProviderModels(BaseModel):
|
|
28
|
-
__root__: Dict[str, Dict[str, List[GatewayModel]]]
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
from typing import List, Literal, Optional
|
|
2
|
-
|
|
3
|
-
from truefoundry.deploy.lib.clients.servicefoundry_client import (
|
|
4
|
-
ServiceFoundryServiceClient,
|
|
5
|
-
)
|
|
6
|
-
from truefoundry.gateway.lib.entities import GatewayModel
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def list_models(
|
|
10
|
-
model_type: Optional[Literal["chat", "completion", "embedding"]] = None,
|
|
11
|
-
) -> List[GatewayModel]:
|
|
12
|
-
"""List available models filtered by type
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
model_type (Optional[str], optional): Filter models by type ('chat' or 'completion'). Defaults to None.
|
|
16
|
-
|
|
17
|
-
Returns:
|
|
18
|
-
List: List of enabled models
|
|
19
|
-
"""
|
|
20
|
-
client = ServiceFoundryServiceClient()
|
|
21
|
-
models = client.get_gateway_models(model_type)
|
|
22
|
-
|
|
23
|
-
enabled_models = []
|
|
24
|
-
for _, accounts in models.__root__.items():
|
|
25
|
-
for _, model_list in accounts.items():
|
|
26
|
-
for model in model_list:
|
|
27
|
-
enabled_models.append(model)
|
|
28
|
-
|
|
29
|
-
return enabled_models
|
|
File without changes
|