truefoundry 0.2.10__py3-none-any.whl → 0.3.0rc2__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.

Files changed (100) hide show
  1. truefoundry/__init__.py +1 -0
  2. truefoundry/autodeploy/cli.py +31 -18
  3. truefoundry/deploy/__init__.py +119 -1
  4. truefoundry/deploy/auto_gen/models.py +1791 -0
  5. truefoundry/deploy/builder/__init__.py +138 -0
  6. truefoundry/deploy/builder/builders/__init__.py +22 -0
  7. truefoundry/deploy/builder/builders/dockerfile.py +57 -0
  8. truefoundry/deploy/builder/builders/tfy_notebook_buildpack/__init__.py +44 -0
  9. truefoundry/deploy/builder/builders/tfy_notebook_buildpack/dockerfile_template.py +51 -0
  10. truefoundry/deploy/builder/builders/tfy_python_buildpack/__init__.py +44 -0
  11. truefoundry/deploy/builder/builders/tfy_python_buildpack/dockerfile_template.py +158 -0
  12. truefoundry/deploy/builder/docker_service.py +168 -0
  13. truefoundry/deploy/cli/cli.py +19 -26
  14. truefoundry/deploy/cli/commands/__init__.py +18 -0
  15. truefoundry/deploy/cli/commands/apply_command.py +52 -0
  16. truefoundry/deploy/cli/commands/build_command.py +45 -0
  17. truefoundry/deploy/cli/commands/build_logs_command.py +89 -0
  18. truefoundry/deploy/cli/commands/create_command.py +75 -0
  19. truefoundry/deploy/cli/commands/delete_command.py +77 -0
  20. truefoundry/deploy/cli/commands/deploy_command.py +99 -0
  21. truefoundry/deploy/cli/commands/get_command.py +216 -0
  22. truefoundry/deploy/cli/commands/list_command.py +171 -0
  23. truefoundry/deploy/cli/commands/login_command.py +33 -0
  24. truefoundry/deploy/cli/commands/logout_command.py +20 -0
  25. truefoundry/deploy/cli/commands/logs_command.py +134 -0
  26. truefoundry/deploy/cli/commands/patch_application_command.py +79 -0
  27. truefoundry/deploy/cli/commands/patch_command.py +70 -0
  28. truefoundry/deploy/cli/commands/redeploy_command.py +41 -0
  29. truefoundry/deploy/cli/commands/terminate_comand.py +44 -0
  30. truefoundry/deploy/cli/commands/trigger_command.py +87 -0
  31. truefoundry/deploy/cli/config.py +10 -0
  32. truefoundry/deploy/cli/console.py +5 -0
  33. truefoundry/deploy/cli/const.py +12 -0
  34. truefoundry/deploy/cli/display_util.py +118 -0
  35. truefoundry/deploy/cli/util.py +92 -0
  36. truefoundry/deploy/core/__init__.py +7 -0
  37. truefoundry/deploy/core/login.py +9 -0
  38. truefoundry/deploy/core/logout.py +5 -0
  39. truefoundry/deploy/function_service/__init__.py +3 -0
  40. truefoundry/deploy/function_service/__main__.py +27 -0
  41. truefoundry/deploy/function_service/app.py +92 -0
  42. truefoundry/deploy/function_service/build.py +45 -0
  43. truefoundry/deploy/function_service/remote/__init__.py +6 -0
  44. truefoundry/deploy/function_service/remote/context.py +3 -0
  45. truefoundry/deploy/function_service/remote/method.py +67 -0
  46. truefoundry/deploy/function_service/remote/remote.py +144 -0
  47. truefoundry/deploy/function_service/route.py +137 -0
  48. truefoundry/deploy/function_service/service.py +113 -0
  49. truefoundry/deploy/function_service/utils.py +53 -0
  50. truefoundry/deploy/io/__init__.py +0 -0
  51. truefoundry/deploy/io/output_callback.py +23 -0
  52. truefoundry/deploy/io/rich_output_callback.py +27 -0
  53. truefoundry/deploy/json_util.py +7 -0
  54. truefoundry/deploy/lib/__init__.py +0 -0
  55. truefoundry/deploy/lib/auth/auth_service_client.py +81 -0
  56. truefoundry/deploy/lib/auth/credential_file_manager.py +115 -0
  57. truefoundry/deploy/lib/auth/credential_provider.py +131 -0
  58. truefoundry/deploy/lib/auth/servicefoundry_session.py +59 -0
  59. truefoundry/deploy/lib/clients/__init__.py +0 -0
  60. truefoundry/deploy/lib/clients/servicefoundry_client.py +723 -0
  61. truefoundry/deploy/lib/clients/shell_client.py +13 -0
  62. truefoundry/deploy/lib/clients/utils.py +41 -0
  63. truefoundry/deploy/lib/const.py +43 -0
  64. truefoundry/deploy/lib/dao/__init__.py +0 -0
  65. truefoundry/deploy/lib/dao/application.py +246 -0
  66. truefoundry/deploy/lib/dao/apply.py +80 -0
  67. truefoundry/deploy/lib/dao/version.py +33 -0
  68. truefoundry/deploy/lib/dao/workspace.py +71 -0
  69. truefoundry/deploy/lib/exceptions.py +23 -0
  70. truefoundry/deploy/lib/logs_utils.py +43 -0
  71. truefoundry/deploy/lib/messages.py +12 -0
  72. truefoundry/deploy/lib/model/__init__.py +0 -0
  73. truefoundry/deploy/lib/model/entity.py +382 -0
  74. truefoundry/deploy/lib/session.py +146 -0
  75. truefoundry/deploy/lib/util.py +70 -0
  76. truefoundry/deploy/lib/win32.py +129 -0
  77. truefoundry/deploy/v2/__init__.py +0 -0
  78. truefoundry/deploy/v2/lib/__init__.py +3 -0
  79. truefoundry/deploy/v2/lib/deploy.py +232 -0
  80. truefoundry/deploy/v2/lib/deployable_patched_models.py +72 -0
  81. truefoundry/deploy/v2/lib/models.py +53 -0
  82. truefoundry/deploy/v2/lib/patched_models.py +515 -0
  83. truefoundry/deploy/v2/lib/source.py +267 -0
  84. truefoundry/flyte/__init__.py +6 -0
  85. truefoundry/langchain/__init__.py +12 -1
  86. truefoundry/langchain/deprecated.py +302 -0
  87. truefoundry/langchain/truefoundry_chat.py +130 -0
  88. truefoundry/langchain/truefoundry_embeddings.py +171 -0
  89. truefoundry/langchain/truefoundry_llm.py +106 -0
  90. truefoundry/langchain/utils.py +85 -0
  91. truefoundry/logger.py +17 -0
  92. truefoundry/pydantic_v1.py +5 -0
  93. truefoundry/python_deploy_codegen.py +132 -0
  94. {truefoundry-0.2.10.dist-info → truefoundry-0.3.0rc2.dist-info}/METADATA +25 -6
  95. truefoundry-0.3.0rc2.dist-info/RECORD +125 -0
  96. truefoundry/deploy/cli/deploy.py +0 -165
  97. truefoundry-0.2.10.dist-info/RECORD +0 -38
  98. /truefoundry/{deploy/cli/version.py → version.py} +0 -0
  99. {truefoundry-0.2.10.dist-info → truefoundry-0.3.0rc2.dist-info}/WHEEL +0 -0
  100. {truefoundry-0.2.10.dist-info → truefoundry-0.3.0rc2.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,515 @@
1
+ import enum
2
+ import re
3
+ import warnings
4
+ from collections.abc import Mapping
5
+ from typing import Literal, Optional, Union
6
+
7
+ from truefoundry.deploy.auto_gen import models
8
+ from truefoundry.pydantic_v1 import (
9
+ BaseModel,
10
+ Field,
11
+ constr,
12
+ root_validator,
13
+ validator,
14
+ )
15
+
16
+ LEGACY_GPU_TYPE_COUNT_WARNING_MESSAGE_TEMPLATE = """
17
+ ---------
18
+ The `gpu_count` and `gpu_type` fields are deprecated. Please remove these fields
19
+ from your deployment Python script or YAML Spec.
20
+
21
+ If you are using Python SDK, add GPUs in the following way:
22
+
23
+ ```
24
+ from truefoundry.deploy import NvidiaGPU, Resources
25
+ ...
26
+
27
+ resources=Resources(
28
+ ...
29
+ devices=[NvidiaGPU(name="{gpu_type}", count={gpu_count})],
30
+ )
31
+ ```
32
+
33
+ If you are using YAML Spec to deploy, add GPUs in the following way:
34
+
35
+ ```
36
+ resources:
37
+ devices:
38
+ - type: nvidia_gpu
39
+ name: {gpu_type}
40
+ count: {gpu_count}
41
+ ```
42
+ ---------
43
+ """
44
+
45
+ LEGACY_GPU_COUNT_WARNING_MESSAGE_TEMPLATE = """
46
+ ---------
47
+ The `gpu_count` field is deprecated. Please remove this field from your
48
+ deployment Python script or YAML Spec.
49
+
50
+ If you are using Python SDK, add GPUs in the following way:
51
+
52
+ ```
53
+ from truefoundry.deploy import NvidiaGPU, Resources
54
+ ...
55
+
56
+ resources=Resources(
57
+ ...
58
+ devices=[NvidiaGPU(count={gpu_count})],
59
+ )
60
+ ```
61
+
62
+ If you are using YAML Spec to deploy, add GPUs in the following way:
63
+
64
+ ```
65
+ resources:
66
+ devices:
67
+ - type: nvidia_gpu
68
+ count: {gpu_count}
69
+ ```
70
+ ---------
71
+ """
72
+
73
+
74
+ class CUDAVersion(str, enum.Enum):
75
+ CUDA_11_0_CUDNN8 = "11.0-cudnn8"
76
+ CUDA_11_1_CUDNN8 = "11.1-cudnn8"
77
+ CUDA_11_2_CUDNN8 = "11.2-cudnn8"
78
+ CUDA_11_3_CUDNN8 = "11.3-cudnn8"
79
+ CUDA_11_4_CUDNN8 = "11.4-cudnn8"
80
+ CUDA_11_5_CUDNN8 = "11.5-cudnn8"
81
+ CUDA_11_6_CUDNN8 = "11.6-cudnn8"
82
+ CUDA_11_7_CUDNN8 = "11.7-cudnn8"
83
+ CUDA_11_8_CUDNN8 = "11.8-cudnn8"
84
+ CUDA_12_0_CUDNN8 = "12.0-cudnn8"
85
+ CUDA_12_1_CUDNN8 = "12.1-cudnn8"
86
+ CUDA_12_2_CUDNN8 = "12.2-cudnn8"
87
+
88
+
89
+ class GPUType(str, enum.Enum):
90
+ P4 = "P4"
91
+ P100 = "P100"
92
+ V100 = "V100"
93
+ T4 = "T4"
94
+ A10G = "A10G"
95
+ A100_40GB = "A100_40GB"
96
+ A100_80GB = "A100_80GB"
97
+ L4 = "L4"
98
+ H100_80GB = "H100_80GB"
99
+ H100_94GB = "H100_94GB"
100
+
101
+
102
+ class TPUType(str, enum.Enum):
103
+ V4_PODSLICE = "tpu-v4-podslice"
104
+ V5_LITE_DEVICE = "tpu-v5-lite-device"
105
+ V5_LITE_PODSLICE = "tpu-v5-lite-podslice"
106
+ V5P_SLICE = "tpu-v5p-slice"
107
+
108
+
109
+ class AWSInferentiaAccelerator(str, enum.Enum):
110
+ INF1 = "INF1"
111
+ INF2 = "INF2"
112
+
113
+
114
+ class PatchedModelBase(BaseModel):
115
+ class Config:
116
+ extra = "forbid"
117
+
118
+
119
+ class DockerFileBuild(models.DockerFileBuild, PatchedModelBase):
120
+ type: Literal["dockerfile"] = "dockerfile"
121
+
122
+ @validator("build_args")
123
+ def validate_build_args(cls, value):
124
+ if not isinstance(value, dict):
125
+ raise TypeError("build_args should be of type dict")
126
+ for k, v in value.items():
127
+ if not isinstance(k, str) or not isinstance(v, str):
128
+ raise TypeError("build_args should have keys and values as string")
129
+ if not k.strip() or not v.strip():
130
+ raise ValueError("build_args cannot have empty keys or values")
131
+ return value
132
+
133
+
134
+ class PythonBuild(models.PythonBuild, PatchedModelBase):
135
+ type: Literal["tfy-python-buildpack"] = "tfy-python-buildpack"
136
+
137
+ @root_validator
138
+ def validate_python_version_when_cuda_version(cls, values):
139
+ if values.get("cuda_version"):
140
+ python_version = values.get("python_version")
141
+ if python_version and not re.match(r"^3\.\d+$", python_version):
142
+ raise ValueError(
143
+ f'`python_version` must be 3.x (e.g. "3.9") when `cuda_version` field is '
144
+ f"provided but got {python_version!r}. If you are adding a "
145
+ f'patch version, please remove it (e.g. "3.9.2" should be "3.9")'
146
+ )
147
+ return values
148
+
149
+
150
+ class RemoteSource(models.RemoteSource, PatchedModelBase):
151
+ type: Literal["remote"] = "remote"
152
+
153
+
154
+ class LocalSource(models.LocalSource, PatchedModelBase):
155
+ type: Literal["local"] = "local"
156
+
157
+
158
+ class Build(models.Build, PatchedModelBase):
159
+ type: Literal["build"] = "build"
160
+ build_source: Union[models.RemoteSource, models.GitSource, models.LocalSource] = (
161
+ Field(default_factory=LocalSource)
162
+ )
163
+
164
+
165
+ class Manual(models.Manual, PatchedModelBase):
166
+ type: Literal["manual"] = "manual"
167
+
168
+
169
+ class Schedule(models.Schedule, PatchedModelBase):
170
+ type: Literal["scheduled"] = "scheduled"
171
+
172
+
173
+ class GitSource(models.GitSource, PatchedModelBase):
174
+ type: Literal["git"] = "git"
175
+
176
+
177
+ class HttpProbe(models.HttpProbe, PatchedModelBase):
178
+ type: Literal["http"] = "http"
179
+
180
+
181
+ class BasicAuthCreds(models.BasicAuthCreds, PatchedModelBase):
182
+ type: Literal["basic_auth"] = "basic_auth"
183
+
184
+
185
+ class HealthProbe(models.HealthProbe, PatchedModelBase):
186
+ pass
187
+
188
+
189
+ class Image(models.Image, PatchedModelBase):
190
+ type: Literal["image"] = "image"
191
+
192
+
193
+ class Port(models.Port, PatchedModelBase):
194
+ app_protocol: Optional[models.AppProtocol] = Field(
195
+ "http",
196
+ 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`.",
197
+ )
198
+
199
+ @root_validator(pre=True)
200
+ def app_protocol_set_default(cls, values):
201
+ if values.get("app_protocol", None) is None:
202
+ values["app_protocol"] = models.AppProtocol.http.value
203
+ return values
204
+
205
+ @root_validator(pre=True)
206
+ def verify_host(cls, values):
207
+ expose = values.get("expose", True)
208
+ host = values.get("host", None)
209
+ if expose:
210
+ if not host:
211
+ raise ValueError("Host must be provided to expose port")
212
+ if not (
213
+ re.fullmatch(
214
+ 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]?)))$",
215
+ host,
216
+ )
217
+ ):
218
+ raise ValueError(
219
+ "Invalid value for `host`. A valid host must contain only alphanumeric letters and hypens e.g. `ai.example.com`, `app.truefoundry.com`.\nYou can get the list of configured hosts for the cluster from the Integrations > Clusters page. Please see https://docs.truefoundry.com/docs/checking-configured-domain for more information."
220
+ )
221
+ else:
222
+ if host:
223
+ raise ValueError("Cannot pass host when expose=False")
224
+
225
+ return values
226
+
227
+
228
+ class Resources(models.Resources, PatchedModelBase):
229
+ @root_validator(pre=False)
230
+ def warn_gpu_count_type_depreciation(cls, values):
231
+ gpu_count = values.get("gpu_count")
232
+ gpu_type = None
233
+ node = values.get("node")
234
+ if node:
235
+ if isinstance(node, NodeSelector):
236
+ gpu_type = node.gpu_type
237
+ elif isinstance(node, Mapping):
238
+ gpu_count = node.get("gpu_type")
239
+
240
+ if gpu_count and gpu_type:
241
+ warnings.warn(
242
+ LEGACY_GPU_TYPE_COUNT_WARNING_MESSAGE_TEMPLATE.format(
243
+ gpu_type=gpu_type,
244
+ gpu_count=gpu_count,
245
+ ),
246
+ category=FutureWarning,
247
+ stacklevel=2,
248
+ )
249
+ elif gpu_count:
250
+ warnings.warn(
251
+ LEGACY_GPU_COUNT_WARNING_MESSAGE_TEMPLATE.format(
252
+ gpu_count=gpu_count,
253
+ ),
254
+ category=FutureWarning,
255
+ stacklevel=2,
256
+ )
257
+ return values
258
+
259
+
260
+ class Param(models.Param, PatchedModelBase):
261
+ pass
262
+
263
+
264
+ class CPUUtilizationMetric(models.CPUUtilizationMetric, PatchedModelBase):
265
+ type: Literal["cpu_utilization"] = "cpu_utilization"
266
+
267
+
268
+ class RPSMetric(models.RPSMetric, PatchedModelBase):
269
+ type: Literal["rps"] = "rps"
270
+
271
+
272
+ class CronMetric(models.CronMetric, PatchedModelBase):
273
+ type: Literal["cron"] = "cron"
274
+
275
+
276
+ class ServiceAutoscaling(models.ServiceAutoscaling, PatchedModelBase):
277
+ pass
278
+
279
+
280
+ class AsyncServiceAutoscaling(models.AsyncServiceAutoscaling, PatchedModelBase):
281
+ pass
282
+
283
+
284
+ class Autoscaling(ServiceAutoscaling):
285
+ def __init__(self, **kwargs):
286
+ warnings.warn(
287
+ "`truefoundry.deploy.Autoscaling` is deprecated and will be removed in a future version. "
288
+ "Please use `truefoundry.deploy.ServiceAutoscaling` instead. "
289
+ "You can rename `Autoscaling` to `ServiceAutoscaling` in your script.",
290
+ category=DeprecationWarning,
291
+ stacklevel=2,
292
+ )
293
+ super().__init__(**kwargs)
294
+
295
+
296
+ class BlueGreen(models.BlueGreen, PatchedModelBase):
297
+ type: Literal["blue_green"] = "blue_green"
298
+
299
+
300
+ class Canary(models.Canary, PatchedModelBase):
301
+ type: Literal["canary"] = "canary"
302
+
303
+
304
+ class Rolling(models.Rolling, PatchedModelBase):
305
+ type: Literal["rolling_update"] = "rolling_update"
306
+
307
+
308
+ class SecretMount(models.SecretMount, PatchedModelBase):
309
+ type: Literal["secret"] = "secret"
310
+
311
+
312
+ class StringDataMount(models.StringDataMount, PatchedModelBase):
313
+ type: Literal["string"] = "string"
314
+
315
+
316
+ class VolumeMount(models.VolumeMount, PatchedModelBase):
317
+ type: Literal["volume"] = "volume"
318
+
319
+
320
+ class NodeSelector(models.NodeSelector, PatchedModelBase):
321
+ type: Literal["node_selector"] = "node_selector"
322
+ gpu_type: Optional[Union[GPUType, str]] = None
323
+
324
+
325
+ class NodepoolSelector(models.NodepoolSelector, PatchedModelBase):
326
+ type: Literal["nodepool_selector"] = "nodepool_selector"
327
+
328
+
329
+ class Endpoint(models.Endpoint, PatchedModelBase):
330
+ pass
331
+
332
+
333
+ class TruefoundryImageBase(models.TruefoundryImageBase, PatchedModelBase):
334
+ type: Literal["truefoundrybase"] = "truefoundrybase"
335
+
336
+
337
+ class TruefoundryImageFull(models.TruefoundryImageFull, PatchedModelBase):
338
+ type: Literal["truefoundryfull"] = "truefoundryfull"
339
+
340
+
341
+ class CodeserverImage(models.CodeserverImage, PatchedModelBase):
342
+ type: Literal["codeserver"] = "codeserver"
343
+
344
+
345
+ class HelmRepo(models.HelmRepo, PatchedModelBase):
346
+ type: Literal["helm-repo"] = "helm-repo"
347
+
348
+
349
+ class OCIRepo(models.OCIRepo, PatchedModelBase):
350
+ type: Literal["oci-repo"] = "oci-repo"
351
+
352
+
353
+ class VolumeBrowser(models.VolumeBrowser, PatchedModelBase):
354
+ pass
355
+
356
+
357
+ class WorkerConfig(models.WorkerConfig, PatchedModelBase):
358
+ pass
359
+
360
+
361
+ class SQSInputConfig(models.SQSInputConfig, PatchedModelBase):
362
+ type: Literal["sqs"] = "sqs"
363
+
364
+
365
+ class SQSOutputConfig(models.SQSOutputConfig, PatchedModelBase):
366
+ type: Literal["sqs"] = "sqs"
367
+
368
+
369
+ class SQSQueueMetricConfig(models.SQSQueueMetricConfig, PatchedModelBase):
370
+ type: Literal["sqs"] = "sqs"
371
+
372
+
373
+ class AWSAccessKeyAuth(models.AWSAccessKeyAuth, PatchedModelBase):
374
+ pass
375
+
376
+
377
+ class NATSInputConfig(models.NATSInputConfig, PatchedModelBase):
378
+ type: Literal["nats"] = "nats"
379
+
380
+
381
+ class CoreNATSOutputConfig(models.CoreNATSOutputConfig, PatchedModelBase):
382
+ type: Literal["core-nats"] = "core-nats"
383
+
384
+
385
+ class NATSUserPasswordAuth(models.NATSUserPasswordAuth, PatchedModelBase):
386
+ pass
387
+
388
+
389
+ class NATSOutputConfig(models.NATSOutputConfig, PatchedModelBase):
390
+ type: Literal["nats"] = "nats"
391
+
392
+
393
+ class NATSMetricConfig(models.NATSMetricConfig, PatchedModelBase):
394
+ type: Literal["nats"] = "nats"
395
+
396
+
397
+ class KafkaInputConfig(models.KafkaInputConfig, PatchedModelBase):
398
+ type: Literal["kafka"] = "kafka"
399
+
400
+
401
+ class KafkaOutputConfig(models.KafkaOutputConfig, PatchedModelBase):
402
+ type: Literal["kafka"] = "kafka"
403
+
404
+
405
+ class KafkaMetricConfig(models.KafkaMetricConfig, PatchedModelBase):
406
+ type: Literal["kafka"] = "kafka"
407
+
408
+
409
+ class KafkaSASLAuth(models.KafkaSASLAuth, PatchedModelBase):
410
+ pass
411
+
412
+
413
+ class AMQPInputConfig(models.AMQPInputConfig, PatchedModelBase):
414
+ type: Literal["amqp"] = "amqp"
415
+
416
+
417
+ class AMQPOutputConfig(models.AMQPOutputConfig, PatchedModelBase):
418
+ type: Literal["amqp"] = "amqp"
419
+
420
+
421
+ class AMQPMetricConfig(models.AMQPMetricConfig, PatchedModelBase):
422
+ type: Literal["amqp"] = "amqp"
423
+
424
+
425
+ class AsyncProcessorSidecar(models.AsyncProcessorSidecar, PatchedModelBase):
426
+ pass
427
+
428
+
429
+ class ArtifactsCacheVolume(models.ArtifactsCacheVolume, PatchedModelBase):
430
+ pass
431
+
432
+
433
+ class HuggingfaceArtifactSource(models.HuggingfaceArtifactSource, PatchedModelBase):
434
+ type: Literal["huggingface-hub"] = "huggingface-hub"
435
+
436
+
437
+ class TruefoundryArtifactSource(models.TruefoundryArtifactSource, PatchedModelBase):
438
+ type: Literal["truefoundry-artifact"] = "truefoundry-artifact"
439
+
440
+
441
+ class ArtifactsDownload(models.ArtifactsDownload, PatchedModelBase):
442
+ pass
443
+
444
+
445
+ class CustomNotebookImage(models.CustomNotebookImage, PatchedModelBase):
446
+ type: Literal["customnotebook"] = "customnotebook"
447
+
448
+
449
+ class NvidiaGPU(models.NvidiaGPU, PatchedModelBase):
450
+ type: Literal["nvidia_gpu"] = "nvidia_gpu"
451
+ name: Optional[Union[GPUType, constr(regex=r"^tpu-[a-z\d\-]+$")]] = None
452
+
453
+
454
+ class NvidiaMIGGPU(models.NvidiaMIGGPU, PatchedModelBase):
455
+ type: Literal["nvidia_mig_gpu"] = "nvidia_mig_gpu"
456
+
457
+
458
+ class NvidiaTimeslicingGPU(models.NvidiaTimeslicingGPU, PatchedModelBase):
459
+ type: Literal["nvidia_timeslicing_gpu"] = "nvidia_timeslicing_gpu"
460
+
461
+
462
+ class AWSInferentia(models.AWSInferentia, PatchedModelBase):
463
+ type: Literal["aws_inferentia"] = "aws_inferentia"
464
+ name: Optional[Union[AWSInferentiaAccelerator, str]] = None
465
+
466
+
467
+ class GcpTPU(models.GcpTPU, PatchedModelBase):
468
+ type: Literal["gcp_tpu"] = "gcp_tpu"
469
+ name: Union[TPUType, Literal[r"tpu-[a-z\d\-]+"]]
470
+
471
+
472
+ class CustomCodeserverImage(models.CustomCodeserverImage, PatchedModelBase):
473
+ type: Literal["customcodeserver"] = "customcodeserver"
474
+
475
+
476
+ class CustomSSHServerImage(models.CustomSSHServerImage, PatchedModelBase):
477
+ type: Literal["custom-ssh-server"] = "custom-ssh-server"
478
+
479
+
480
+ class SSHServerImage(models.SSHServerImage, PatchedModelBase):
481
+ type: Literal["ssh-server"] = "ssh-server"
482
+
483
+
484
+ class TruefoundryImageCuda1180(models.TruefoundryImageCuda1180, PatchedModelBase):
485
+ type: Literal["truefoundrycuda1180"] = "truefoundrycuda1180"
486
+
487
+
488
+ class TruefoundryImageCuda1211(models.TruefoundryImageCuda1211, PatchedModelBase):
489
+ type: Literal["truefoundrycuda1211"] = "truefoundrycuda1211"
490
+
491
+
492
+ class DynamicVolumeConfig(models.DynamicVolumeConfig, PatchedModelBase):
493
+ type: Literal["dynamic"] = "dynamic"
494
+
495
+
496
+ class StaticVolumeConfig(models.StaticVolumeConfig, PatchedModelBase):
497
+ type: Literal["static"] = "static"
498
+
499
+
500
+ class PythonTaskConfig(models.PythonTaskConfig, PatchedModelBase):
501
+ type: Literal["python-task-config"] = "python-task-config"
502
+ resources: Optional[Resources] = Resources()
503
+
504
+
505
+ class ContainerTaskConfig(models.ContainerTaskConfig, PatchedModelBase):
506
+ type: Literal["container-task-config"] = "container-task-config"
507
+ resources: Optional[Resources] = Resources()
508
+
509
+
510
+ class TaskDockerFileBuild(models.TaskDockerFileBuild, PatchedModelBase):
511
+ type: Literal["task-dockerfile-build"] = "task-dockerfile-build"
512
+
513
+
514
+ class TaskPythonBuild(models.TaskPythonBuild, PatchedModelBase):
515
+ type: Literal["task-python-build"] = "task-python-build"