truefoundry 0.11.12__py3-none-any.whl → 0.12.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.

@@ -74,7 +74,8 @@ class TrueFoundrySdkEnv(BaseSettings):
74
74
  TFY_CLI_LOCAL_DEV_MODE: bool = False
75
75
 
76
76
  TFY_PYTHON_BUILD_PACKAGE_MANAGER: PythonPackageManager = PythonPackageManager.UV
77
- TFY_PYTHON_BUILD_UV_IMAGE_URI: str = "ghcr.io/astral-sh/uv:latest"
77
+ TFY_PYTHON_BUILD_UV_IMAGE_REPO: str = "ghcr.io/astral-sh/uv"
78
+ TFY_PYTHON_BUILD_UV_IMAGE_TAG: str = "latest"
78
79
 
79
80
  # Global Constants for OpenAI Integration
80
81
  OPENAI_API_KEY: Optional[str] = Field(default=None, env=OPENAI_API_KEY_KEY)
@@ -93,6 +94,12 @@ class TrueFoundrySdkEnv(BaseSettings):
93
94
  )
94
95
  TFY_ASK_SYSTEM_PROMPT_NAME: str = Field(default="tfy-ask-k8s-prompt")
95
96
  TFY_INTERNAL_ASK_CONFIG_OVERRIDE_FILE: Optional[str] = Field(default=None)
97
+ TFY_PYTHON_BUILD_POETRY_VERSION: str = Field(
98
+ default="2.0", env="TFY_PYTHON_BUILD_POETRY_VERSION"
99
+ )
100
+ TFY_PYTHON_BUILD_LATEST_POETRY_MAJOR_VERSION: int = Field(
101
+ default=2, env="TFY_PYTHON_BUILD_LATEST_POETRY_MAJOR_VERSION"
102
+ )
96
103
 
97
104
  # This is a hack to fresh read the env vars because people can end up importing this file
98
105
  # before setting the correct env vars. E.g. in notebook environments.
@@ -210,3 +210,7 @@ def get_user_agent() -> str:
210
210
  return f"truefoundry/{__version__} Python/{platform.python_version()} OS/{platform.system()}-{platform.release()} ({platform.architecture()[0]})"
211
211
  except Exception:
212
212
  return f"truefoundry/{__version__}"
213
+
214
+
215
+ def get_expanded_and_absolute_path(path: str):
216
+ return os.path.abspath(os.path.expanduser(path))
@@ -52,6 +52,7 @@ from truefoundry.deploy.v2.lib.deployable_patched_models import (
52
52
  Workflow,
53
53
  )
54
54
  from truefoundry.deploy.v2.lib.patched_models import (
55
+ UV,
55
56
  AMQPInputConfig,
56
57
  AMQPMetricConfig,
57
58
  AMQPOutputConfig,
@@ -102,6 +103,8 @@ from truefoundry.deploy.v2.lib.patched_models import (
102
103
  NvidiaTimeslicingGPU,
103
104
  OCIRepo,
104
105
  Param,
106
+ Pip,
107
+ Poetry,
105
108
  Port,
106
109
  PythonBuild,
107
110
  RemoteSource,
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: application.json
3
- # timestamp: 2025-09-09T12:09:08+00:00
3
+ # timestamp: 2025-09-10T19:32:14+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -603,6 +603,37 @@ class Param(BaseModel):
603
603
  param_type: ParamType = "string"
604
604
 
605
605
 
606
+ class Pip(BaseModel):
607
+ """
608
+ Use pip to install requirements files and packages
609
+ """
610
+
611
+ type: Literal["pip"] = Field(..., description="")
612
+ requirements_path: Optional[str] = Field(
613
+ None,
614
+ description="Path to `requirements.txt` relative to `Path to build context`",
615
+ )
616
+ pip_packages: Optional[List[str]] = Field(
617
+ None,
618
+ description='Define pip package requirements.\nIn Python/YAML E.g. ["fastapi>=0.90,<1.0", "uvicorn"]',
619
+ )
620
+
621
+
622
+ class Poetry(BaseModel):
623
+ """
624
+ Use `poetry` to setup env
625
+ Your build context root must contain `pyproject.toml` and `poetry.lock
626
+ """
627
+
628
+ type: Literal["poetry"] = Field(..., description="")
629
+ poetry_version: Union[
630
+ Literal["latest"], constr(regex=r"^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$")
631
+ ] = Field("latest", description="Poetry version to use")
632
+ install_options: Optional[str] = Field(
633
+ None, description="install options to pass to poetry command"
634
+ )
635
+
636
+
606
637
  class Protocol(str, Enum):
607
638
  """
608
639
  Protocol for the port.
@@ -625,47 +656,6 @@ class AppProtocol(str, Enum):
625
656
  tcp = "tcp"
626
657
 
627
658
 
628
- class PythonBuild(BaseModel):
629
- """
630
- Describes that we are using python to build a container image with a specific python version and pip packages installed.
631
- """
632
-
633
- type: Literal["tfy-python-buildpack"] = Field(..., description="")
634
- python_version: Optional[constr(regex=r"^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$")] = (
635
- Field(
636
- None,
637
- description="Python version to run your application. Should be one of the tags listed on [Official Python Docker Page](https://hub.docker.com/_/python)",
638
- )
639
- )
640
- build_context_path: str = Field(
641
- "./", description="Build path relative to project root path."
642
- )
643
- requirements_path: Optional[str] = Field(
644
- None,
645
- description="Path to `requirements.txt` relative to\n`Path to build context`",
646
- )
647
- pip_packages: Optional[List[str]] = Field(
648
- None,
649
- description='Define pip package requirements.\nIn Python/YAML E.g. ["fastapi>=0.90,<1.0", "uvicorn"]',
650
- )
651
- apt_packages: Optional[List[str]] = Field(
652
- None,
653
- description='Debian packages to install via `apt get`.\nIn Python/YAML E.g. ["git", "ffmpeg", "htop"]',
654
- )
655
- command: Union[str, List[str]] = Field(
656
- ...,
657
- description="Command to run when the container starts.\nCommand will be set as the Entrypoint of the generated image.\nWhen deploying a Job, the command can be templatized by defining `params` and referencing them in command\nE.g. `python main.py --learning_rate {{learning_rate}}`",
658
- )
659
- cuda_version: Optional[
660
- constr(
661
- regex=r"^((\d+\.\d+(\.\d+)?-cudnn\d+-(runtime|devel)-ubuntu\d+\.\d+)|11\.0-cudnn8|11\.1-cudnn8|11\.2-cudnn8|11\.3-cudnn8|11\.4-cudnn8|11\.5-cudnn8|11\.6-cudnn8|11\.7-cudnn8|11\.8-cudnn8|12\.0-cudnn8|12\.1-cudnn8|12\.2-cudnn8|12\.3-cudnn9|12\.4-cudnn9|12\.5-cudnn9|12\.6-cudnn9)$"
662
- )
663
- ] = Field(
664
- None,
665
- description="Version of CUDA Toolkit and CUDNN to install in the image\nThese combinations are based off of publically available docker images on docker hub\nYou can also specify a valid tag of the form {cuda_version_number}-cudnn{cudnn_version_number}-{runtime|devel}-ubuntu{ubuntu_version}\nRefer https://hub.docker.com/r/nvidia/cuda/tags for valid set of values\nNote: We use deadsnakes ubuntu ppa to add Python that currently supports only Ubuntu 18.04, 20.04 and 22.04",
666
- )
667
-
668
-
669
659
  class RPSMetric(BaseModel):
670
660
  type: Literal["rps"] = Field(..., description="")
671
661
  value: PositiveFloat = Field(
@@ -1070,7 +1060,7 @@ class TaskPythonBuild(BaseModel):
1070
1060
  )
1071
1061
  cuda_version: Optional[
1072
1062
  constr(
1073
- regex=r"^((\d+\.\d+(\.\d+)?-cudnn\d+-(runtime|devel)-ubuntu\d+\.\d+)|11\.0-cudnn8|11\.1-cudnn8|11\.2-cudnn8|11\.3-cudnn8|11\.4-cudnn8|11\.5-cudnn8|11\.6-cudnn8|11\.7-cudnn8|11\.8-cudnn8|12\.0-cudnn8|12\.1-cudnn8|12\.2-cudnn8|12\.3-cudnn9|12\.4-cudnn9|12\.5-cudnn9|12\.6-cudnn9)$"
1063
+ regex=r"^((\d+\.\d+(\.\d+)?-cudnn\d+-(runtime|devel)-ubuntu\d+\.\d+)|11\.0-cudnn8|11\.1-cudnn8|11\.2-cudnn8|11\.3-cudnn8|11\.4-cudnn8|11\.5-cudnn8|11\.6-cudnn8|11\.7-cudnn8|11\.8-cudnn8|12\.0-cudnn8|12\.1-cudnn8|12\.2-cudnn8|12\.3-cudnn9|12\.4-cudnn9|12\.5-cudnn9|12\.6-cudnn9|12\.8-cudnn9|12\.9-cudnn9)$"
1074
1064
  )
1075
1065
  ] = Field(
1076
1066
  None,
@@ -1102,6 +1092,19 @@ class TrueFoundryInteractiveLogin(BaseModel):
1102
1092
  )
1103
1093
 
1104
1094
 
1095
+ class UV(BaseModel):
1096
+ """
1097
+ Use `uv` to setup env.
1098
+ Your build context root must contain `pyproject.toml` and `uv.lock
1099
+ """
1100
+
1101
+ type: Literal["uv"] = Field(..., description="")
1102
+ uv_version: str = Field("latest", description="UV version to use")
1103
+ sync_options: Optional[str] = Field(
1104
+ None, description="Sync options to pass to uv command"
1105
+ )
1106
+
1107
+
1105
1108
  class VolumeBrowser(BaseModel):
1106
1109
  username: Optional[constr(regex=r"^[a-z][a-z0-9]{1,8}[a-z0-9]$")] = Field(
1107
1110
  None, description="Username for logging in the volume browser."
@@ -1199,25 +1202,6 @@ class BaseWorkbenchInput(BaseModel):
1199
1202
  )
1200
1203
 
1201
1204
 
1202
- class Build(BaseModel):
1203
- """
1204
- Describes how we build our code into a Docker image.
1205
- """
1206
-
1207
- type: Literal["build"] = Field(..., description="")
1208
- docker_registry: Optional[constr(regex=r"^\S+$")] = Field(
1209
- None,
1210
- description="FQN of the container registry. If you can't find your registry here,\nadd it through the [Integrations](/integrations?tab=docker-registry) page",
1211
- )
1212
- build_source: Union[RemoteSource, GitSource, LocalSource] = Field(
1213
- ..., description="Source code location."
1214
- )
1215
- build_spec: Union[DockerFileBuild, PythonBuild] = Field(
1216
- ...,
1217
- description="Instructions to build a container image out of the build source",
1218
- )
1219
-
1220
-
1221
1205
  class Canary(BaseModel):
1222
1206
  """
1223
1207
  This strategy brings up the new release without bringing the older release down. Traffic is shifted from the older release to the newer release in a staged manner.
@@ -1240,23 +1224,6 @@ class Codeserver(BaseWorkbenchInput):
1240
1224
  image: WorkbenchImage
1241
1225
 
1242
1226
 
1243
- class ContainerTaskConfig(BaseModel):
1244
- type: Literal["container-task-config"] = Field(..., description="")
1245
- image: Union[Build, Image] = Field(
1246
- ...,
1247
- description="Specify whether you want to deploy a Docker image or build and deploy from source code",
1248
- )
1249
- env: Optional[Dict[str, str]] = Field(
1250
- None,
1251
- description="Configure environment variables to be injected in the task either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1252
- )
1253
- resources: Optional[Resources] = None
1254
- mounts: Optional[List[Union[SecretMount, StringDataMount, VolumeMount]]] = Field(
1255
- None, description="Configure data to be mounted to Workflow pod(s) as a volume."
1256
- )
1257
- service_account: Optional[str] = Field(None, description="")
1258
-
1259
-
1260
1227
  class CoreNATSOutputConfig(BaseModel):
1261
1228
  """
1262
1229
  Describes the configuration for the output Core NATS worker
@@ -1445,6 +1412,50 @@ class Port(BaseModel):
1445
1412
  ] = Field(None, description="Authentication method for inbound traffic")
1446
1413
 
1447
1414
 
1415
+ class PythonBuild(BaseModel):
1416
+ """
1417
+ Describes that we are using python to build a container image with a specific python version and pip packages installed.
1418
+ """
1419
+
1420
+ type: Literal["tfy-python-buildpack"] = Field(..., description="")
1421
+ python_version: Optional[constr(regex=r"^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$")] = (
1422
+ Field(
1423
+ None,
1424
+ description="Python version to run your application. Should be one of the tags listed on [Official Python Docker Page](https://hub.docker.com/_/python)",
1425
+ )
1426
+ )
1427
+ build_context_path: str = Field(
1428
+ "./", description="Build path relative to project root path."
1429
+ )
1430
+ requirements_path: Optional[str] = Field(
1431
+ None,
1432
+ description="Path to `requirements.txt` relative to\n`Path to build context`",
1433
+ )
1434
+ pip_packages: Optional[List[str]] = Field(
1435
+ None,
1436
+ description='Define pip package requirements.\nIn Python/YAML E.g. ["fastapi>=0.90,<1.0", "uvicorn"]',
1437
+ )
1438
+ python_dependencies: Optional[Union[Pip, UV, Poetry]] = Field(
1439
+ None, description="Python dependencies to install"
1440
+ )
1441
+ apt_packages: Optional[List[str]] = Field(
1442
+ None,
1443
+ description='Debian packages to install via `apt get`.\nIn Python/YAML E.g. ["git", "ffmpeg", "htop"]',
1444
+ )
1445
+ command: Union[str, List[str]] = Field(
1446
+ ...,
1447
+ description="Command to run when the container starts.\nCommand will be set as the Entrypoint of the generated image.\nWhen deploying a Job, the command can be templatized by defining `params` and referencing them in command\nE.g. `python main.py --learning_rate {{learning_rate}}`",
1448
+ )
1449
+ cuda_version: Optional[
1450
+ constr(
1451
+ regex=r"^((\d+\.\d+(\.\d+)?-cudnn\d+-(runtime|devel)-ubuntu\d+\.\d+)|11\.0-cudnn8|11\.1-cudnn8|11\.2-cudnn8|11\.3-cudnn8|11\.4-cudnn8|11\.5-cudnn8|11\.6-cudnn8|11\.7-cudnn8|11\.8-cudnn8|12\.0-cudnn8|12\.1-cudnn8|12\.2-cudnn8|12\.3-cudnn9|12\.4-cudnn9|12\.5-cudnn9|12\.6-cudnn9|12\.8-cudnn9|12\.9-cudnn9)$"
1452
+ )
1453
+ ] = Field(
1454
+ None,
1455
+ description="Version of CUDA Toolkit and CUDNN to install in the image\nThese combinations are based off of publically available docker images on docker hub\nYou can also specify a valid tag of the form {cuda_version_number}-cudnn{cudnn_version_number}-{runtime|devel}-ubuntu{ubuntu_version}\nRefer https://hub.docker.com/r/nvidia/cuda/tags for valid set of values\nNote: We use deadsnakes ubuntu ppa to add Python that currently supports only Ubuntu 18.04, 20.04 and 22.04",
1456
+ )
1457
+
1458
+
1448
1459
  class PythonTaskConfig(BaseModel):
1449
1460
  """
1450
1461
  Describes the configuration for the python function task
@@ -1580,38 +1591,40 @@ class WorkflowAlert(BaseModel):
1580
1591
  on_failure: bool = Field(True, description="Send an alert when the job fails")
1581
1592
 
1582
1593
 
1583
- class BaseService(BaseModel):
1584
- name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
1594
+ class Build(BaseModel):
1595
+ """
1596
+ Describes how we build our code into a Docker image.
1597
+ """
1598
+
1599
+ type: Literal["build"] = Field(..., description="")
1600
+ docker_registry: Optional[constr(regex=r"^\S+$")] = Field(
1601
+ None,
1602
+ description="FQN of the container registry. If you can't find your registry here,\nadd it through the [Integrations](/integrations?tab=docker-registry) page",
1603
+ )
1604
+ build_source: Union[RemoteSource, GitSource, LocalSource] = Field(
1605
+ ..., description="Source code location."
1606
+ )
1607
+ build_spec: Union[DockerFileBuild, PythonBuild] = Field(
1585
1608
  ...,
1586
- description="Name of the service. This uniquely identifies this service in the workspace.\n> Name can only contain alphanumeric characters and '-' and can be atmost 25 characters long",
1609
+ description="Instructions to build a container image out of the build source",
1587
1610
  )
1611
+
1612
+
1613
+ class ContainerTaskConfig(BaseModel):
1614
+ type: Literal["container-task-config"] = Field(..., description="")
1588
1615
  image: Union[Build, Image] = Field(
1589
1616
  ...,
1590
1617
  description="Specify whether you want to deploy a Docker image or build and deploy from source code",
1591
1618
  )
1592
- artifacts_download: Optional[ArtifactsDownload] = None
1593
- resources: Optional[Resources] = None
1594
1619
  env: Optional[Dict[str, str]] = Field(
1595
1620
  None,
1596
- description="Configure environment variables to be injected in the service either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1597
- )
1598
- ports: List[Port] = Field(
1599
- ...,
1600
- description="Expose the deployment to make it accessible over the internet or keep it private. Implement authentication to restrict access. [Docs](https://docs.truefoundry.com/docs/define-ports-and-domains)",
1621
+ description="Configure environment variables to be injected in the task either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1601
1622
  )
1602
- service_account: Optional[str] = None
1623
+ resources: Optional[Resources] = None
1603
1624
  mounts: Optional[List[Union[SecretMount, StringDataMount, VolumeMount]]] = Field(
1604
- None,
1605
- description="Configure data to be mounted to service pod(s) as a string, secret or volume. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-service)",
1606
- )
1607
- labels: Optional[Dict[str, str]] = Field(None, description="")
1608
- kustomize: Optional[Kustomize] = None
1609
- liveness_probe: Optional[HealthProbe] = None
1610
- readiness_probe: Optional[HealthProbe] = None
1611
- startup_probe: Optional[HealthProbe] = None
1612
- workspace_fqn: Optional[str] = Field(
1613
- None, description="Fully qualified name of the workspace"
1625
+ None, description="Configure data to be mounted to Workflow pod(s) as a volume."
1614
1626
  )
1627
+ service_account: Optional[str] = Field(None, description="")
1615
1628
 
1616
1629
 
1617
1630
  class FlyteLaunchPlan(BaseModel):
@@ -1657,40 +1670,38 @@ class PySparkTaskConfig(BaseModel):
1657
1670
  service_account: Optional[str] = Field(None, description="")
1658
1671
 
1659
1672
 
1660
- class Service(BaseService):
1661
- """
1662
- Describes the configuration for the service
1663
- """
1664
-
1665
- type: Literal["service"] = Field(..., description="")
1666
- replicas: Union[confloat(ge=0.0, le=500.0), ServiceAutoscaling] = Field(
1667
- 1,
1668
- description="Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing.",
1673
+ class BaseService(BaseModel):
1674
+ name: constr(regex=r"^[a-z](?:[a-z0-9]|-(?!-)){1,30}[a-z0-9]$") = Field(
1675
+ ...,
1676
+ description="Name of the service. This uniquely identifies this service in the workspace.\n> Name can only contain alphanumeric characters and '-' and can be atmost 25 characters long",
1669
1677
  )
1670
- auto_shutdown: Optional[Autoshutdown] = None
1671
- allow_interception: bool = Field(
1672
- False,
1673
- description="Whether to allow intercepts to be applied for this service.\nThis would inject an additional sidecar in each pod of the service. Not recommended on production",
1678
+ image: Union[Build, Image] = Field(
1679
+ ...,
1680
+ description="Specify whether you want to deploy a Docker image or build and deploy from source code",
1674
1681
  )
1675
- rollout_strategy: Optional[Union[Rolling, Canary, BlueGreen]] = Field(
1682
+ artifacts_download: Optional[ArtifactsDownload] = None
1683
+ resources: Optional[Resources] = None
1684
+ env: Optional[Dict[str, str]] = Field(
1676
1685
  None,
1677
- description="Strategy to dictate how a rollout should happen when a new release for this service is made [Docs](https://docs.truefoundry.com/docs/rollout-strategy)",
1686
+ description="Configure environment variables to be injected in the service either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables)",
1678
1687
  )
1679
-
1680
-
1681
- class AsyncService(BaseService):
1682
- """
1683
- Describes the configuration for the async-service
1684
- """
1685
-
1686
- type: Literal["async-service"] = Field(..., description="")
1687
- replicas: Union[confloat(ge=0.0, le=500.0), AsyncServiceAutoscaling] = Field(
1688
- 1,
1689
- description="Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing.",
1688
+ ports: List[Port] = Field(
1689
+ ...,
1690
+ description="Expose the deployment to make it accessible over the internet or keep it private. Implement authentication to restrict access. [Docs](https://docs.truefoundry.com/docs/define-ports-and-domains)",
1691
+ )
1692
+ service_account: Optional[str] = None
1693
+ mounts: Optional[List[Union[SecretMount, StringDataMount, VolumeMount]]] = Field(
1694
+ None,
1695
+ description="Configure data to be mounted to service pod(s) as a string, secret or volume. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-service)",
1696
+ )
1697
+ labels: Optional[Dict[str, str]] = Field(None, description="")
1698
+ kustomize: Optional[Kustomize] = None
1699
+ liveness_probe: Optional[HealthProbe] = None
1700
+ readiness_probe: Optional[HealthProbe] = None
1701
+ startup_probe: Optional[HealthProbe] = None
1702
+ workspace_fqn: Optional[str] = Field(
1703
+ None, description="Fully qualified name of the workspace"
1690
1704
  )
1691
- rollout_strategy: Optional[Rolling] = None
1692
- worker_config: WorkerConfig
1693
- sidecar: Optional[AsyncProcessorSidecar] = None
1694
1705
 
1695
1706
 
1696
1707
  class FlyteTaskCustom(BaseModel):
@@ -1755,30 +1766,40 @@ class Job(BaseModel):
1755
1766
  )
1756
1767
 
1757
1768
 
1758
- class ApplicationSet(BaseModel):
1769
+ class Service(BaseService):
1759
1770
  """
1760
- Describes the configuration for the application set
1771
+ Describes the configuration for the service
1761
1772
  """
1762
1773
 
1763
- type: Literal["application-set"] = Field(..., description="")
1764
- name: str = Field(..., description="Name of the application set.")
1765
- components: Optional[List[Union[Service, AsyncService, Job, Helm]]] = Field(
1766
- None, description="Array of components with their specifications."
1774
+ type: Literal["service"] = Field(..., description="")
1775
+ replicas: Union[confloat(ge=0.0, le=500.0), ServiceAutoscaling] = Field(
1776
+ 1,
1777
+ description="Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing.",
1767
1778
  )
1768
- template: Optional[str] = Field(
1769
- None, description="Template to be used for the application set."
1779
+ auto_shutdown: Optional[Autoshutdown] = None
1780
+ allow_interception: bool = Field(
1781
+ False,
1782
+ description="Whether to allow intercepts to be applied for this service.\nThis would inject an additional sidecar in each pod of the service. Not recommended on production",
1770
1783
  )
1771
- values: Optional[Dict[str, Any]] = Field(
1784
+ rollout_strategy: Optional[Union[Rolling, Canary, BlueGreen]] = Field(
1772
1785
  None,
1773
- description="Values to be used to render components for the application set.",
1774
- )
1775
- workspace_fqn: Optional[str] = Field(
1776
- None, description="Fully qualified name of the workspace"
1786
+ description="Strategy to dictate how a rollout should happen when a new release for this service is made [Docs](https://docs.truefoundry.com/docs/rollout-strategy)",
1777
1787
  )
1778
- convert_template_manifest: Optional[bool] = Field(
1779
- None,
1780
- description="Flag to indicate if the template manifest should be converted to TrueFoundry manifest",
1788
+
1789
+
1790
+ class AsyncService(BaseService):
1791
+ """
1792
+ Describes the configuration for the async-service
1793
+ """
1794
+
1795
+ type: Literal["async-service"] = Field(..., description="")
1796
+ replicas: Union[confloat(ge=0.0, le=500.0), AsyncServiceAutoscaling] = Field(
1797
+ 1,
1798
+ description="Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing.",
1781
1799
  )
1800
+ rollout_strategy: Optional[Rolling] = None
1801
+ worker_config: WorkerConfig
1802
+ sidecar: Optional[AsyncProcessorSidecar] = None
1782
1803
 
1783
1804
 
1784
1805
  class FlyteTask(BaseModel):
@@ -1807,6 +1828,32 @@ class Workflow(BaseModel):
1807
1828
  alerts: Optional[List[WorkflowAlert]] = Field(None, description="")
1808
1829
 
1809
1830
 
1831
+ class ApplicationSet(BaseModel):
1832
+ """
1833
+ Describes the configuration for the application set
1834
+ """
1835
+
1836
+ type: Literal["application-set"] = Field(..., description="")
1837
+ name: str = Field(..., description="Name of the application set.")
1838
+ components: Optional[List[Union[Service, AsyncService, Job, Helm]]] = Field(
1839
+ None, description="Array of components with their specifications."
1840
+ )
1841
+ template: Optional[str] = Field(
1842
+ None, description="Template to be used for the application set."
1843
+ )
1844
+ values: Optional[Dict[str, Any]] = Field(
1845
+ None,
1846
+ description="Values to be used to render components for the application set.",
1847
+ )
1848
+ workspace_fqn: Optional[str] = Field(
1849
+ None, description="Fully qualified name of the workspace"
1850
+ )
1851
+ convert_template_manifest: Optional[bool] = Field(
1852
+ None,
1853
+ description="Flag to indicate if the template manifest should be converted to TrueFoundry manifest",
1854
+ )
1855
+
1856
+
1810
1857
  class Application(BaseModel):
1811
1858
  __root__: Union[
1812
1859
  Service,
@@ -2,6 +2,7 @@ from typing import Any, Dict, List, Optional, Union
2
2
 
3
3
  from truefoundry.deploy._autogen.models import (
4
4
  DockerFileBuild,
5
+ Pip,
5
6
  PythonBuild,
6
7
  SparkBuild,
7
8
  TaskDockerFileBuild,
@@ -14,22 +14,20 @@ def _get_expanded_and_absolute_path(path: str):
14
14
 
15
15
  def _build_docker_image(
16
16
  tag: str,
17
+ dockerfile: str,
17
18
  path: str = ".",
18
- file: Optional[str] = None,
19
19
  build_args: Optional[Dict[str, str]] = None,
20
20
  extra_opts: Optional[List[str]] = None,
21
21
  ):
22
+ dockerfile = _get_expanded_and_absolute_path(dockerfile)
22
23
  path = _get_expanded_and_absolute_path(path)
23
24
 
24
- if file:
25
- file = _get_expanded_and_absolute_path(file)
26
-
27
25
  build_docker_image(
28
26
  path=path,
29
27
  tag=tag,
30
28
  # TODO: can we pick target platform(s) picked from cluster
31
29
  platform="linux/amd64",
32
- dockerfile=file,
30
+ dockerfile=dockerfile,
33
31
  build_args=build_args,
34
32
  extra_opts=extra_opts,
35
33
  )
@@ -50,8 +48,8 @@ def build(
50
48
 
51
49
  _build_docker_image(
52
50
  tag=tag,
51
+ dockerfile=build_configuration.dockerfile_path,
53
52
  path=build_configuration.build_context_path,
54
- file=build_configuration.dockerfile_path,
55
53
  build_args=build_configuration.build_args,
56
54
  extra_opts=extra_opts,
57
55
  )
@@ -15,11 +15,11 @@ __all__ = ["generate_dockerfile_content", "build"]
15
15
  def _convert_to_dockerfile_build_config(
16
16
  build_configuration: PythonBuild,
17
17
  dockerfile_path: str,
18
- mount_python_package_manager_conf_secret: bool = False,
18
+ extra_opts: Optional[List[str]] = None,
19
19
  ) -> DockerFileBuild:
20
20
  dockerfile_content = generate_dockerfile_content(
21
21
  build_configuration=build_configuration,
22
- mount_python_package_manager_conf_secret=mount_python_package_manager_conf_secret,
22
+ docker_build_extra_args=extra_opts,
23
23
  )
24
24
  with open(dockerfile_path, "w", encoding="utf8") as fp:
25
25
  fp.write(dockerfile_content)
@@ -40,14 +40,11 @@ def build(
40
40
  raise ValueError(
41
41
  "`python_version` is required for `tfy-python-buildpack` builder"
42
42
  )
43
- mount_python_package_manager_conf_secret = (
44
- has_python_package_manager_conf_secret(extra_opts) if extra_opts else False
45
- )
46
43
  with TemporaryDirectory() as local_dir:
47
44
  docker_build_configuration = _convert_to_dockerfile_build_config(
48
45
  build_configuration,
49
46
  dockerfile_path=os.path.join(local_dir, "Dockerfile"),
50
- mount_python_package_manager_conf_secret=mount_python_package_manager_conf_secret,
47
+ extra_opts=extra_opts,
51
48
  )
52
49
  dockerfile.build(
53
50
  tag=tag,