Kubernetes
zenml.integrations.kubernetes
Kubernetes integration for Kubernetes-native orchestration.
The Kubernetes integration sub-module powers an alternative to the local orchestrator. You can enable it by registering the Kubernetes orchestrator with the CLI tool.
Attributes
KUBERNETES = 'kubernetes'
module-attribute
KUBERNETES_ORCHESTRATOR_FLAVOR = 'kubernetes'
module-attribute
KUBERNETES_STEP_OPERATOR_FLAVOR = 'kubernetes'
module-attribute
Classes
Flavor
Class for ZenML Flavors.
Attributes
config_class: Type[StackComponentConfig]
abstractmethod
property
Returns StackComponentConfig
config class.
Returns:
Type | Description |
---|---|
Type[StackComponentConfig]
|
The config class. |
config_schema: Dict[str, Any]
property
The config schema for a flavor.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The config schema. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[StackComponent]
abstractmethod
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[StackComponent]
|
The implementation class for this flavor. |
logo_url: Optional[str]
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
Optional[str]
|
The flavor logo. |
name: str
abstractmethod
property
The flavor name.
Returns:
Type | Description |
---|---|
str
|
The flavor name. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
type: StackComponentType
abstractmethod
property
Functions
from_model(flavor_model: FlavorResponse) -> Flavor
classmethod
Loads a flavor from a model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flavor_model
|
FlavorResponse
|
The model to load from. |
required |
Raises:
Type | Description |
---|---|
CustomFlavorImportError
|
If the custom flavor can't be imported. |
ImportError
|
If the flavor can't be imported. |
Returns:
Type | Description |
---|---|
Flavor
|
The loaded flavor. |
Source code in src/zenml/stack/flavor.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
generate_default_docs_url() -> str
Generate the doc urls for all inbuilt and integration flavors.
Note that this method is not going to be useful for custom flavors, which do not have any docs in the main zenml docs.
Returns:
Type | Description |
---|---|
str
|
The complete url to the zenml documentation |
Source code in src/zenml/stack/flavor.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
generate_default_sdk_docs_url() -> str
Generate SDK docs url for a flavor.
Returns:
Type | Description |
---|---|
str
|
The complete url to the zenml SDK docs |
Source code in src/zenml/stack/flavor.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
|
to_model(integration: Optional[str] = None, is_custom: bool = True) -> FlavorRequest
Converts a flavor to a model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
integration
|
Optional[str]
|
The integration to use for the model. |
None
|
is_custom
|
bool
|
Whether the flavor is a custom flavor. |
True
|
Returns:
Type | Description |
---|---|
FlavorRequest
|
The model. |
Source code in src/zenml/stack/flavor.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
Integration
Base class for integration in ZenML.
Functions
activate() -> None
classmethod
Abstract method to activate the integration.
Source code in src/zenml/integrations/integration.py
140 141 142 |
|
check_installation() -> bool
classmethod
Method to check whether the required packages are installed.
Returns:
Type | Description |
---|---|
bool
|
True if all required packages are installed, False otherwise. |
Source code in src/zenml/integrations/integration.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
flavors() -> List[Type[Flavor]]
classmethod
Abstract method to declare new stack component flavors.
Returns:
Type | Description |
---|---|
List[Type[Flavor]]
|
A list of new stack component flavors. |
Source code in src/zenml/integrations/integration.py
144 145 146 147 148 149 150 151 |
|
get_requirements(target_os: Optional[str] = None, python_version: Optional[str] = None) -> List[str]
classmethod
Method to get the requirements for the integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
python_version
|
Optional[str]
|
The Python version to use for the requirements. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/integration.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
get_uninstall_requirements(target_os: Optional[str] = None) -> List[str]
classmethod
Method to get the uninstall requirements for the integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/integration.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
plugin_flavors() -> List[Type[BasePluginFlavor]]
classmethod
Abstract method to declare new plugin flavors.
Returns:
Type | Description |
---|---|
List[Type[BasePluginFlavor]]
|
A list of new plugin flavors. |
Source code in src/zenml/integrations/integration.py
153 154 155 156 157 158 159 160 |
|
KubernetesIntegration
Bases: Integration
Definition of Kubernetes integration for ZenML.
Functions
flavors() -> List[Type[Flavor]]
classmethod
Declare the stack component flavors for the Kubernetes integration.
Returns:
Type | Description |
---|---|
List[Type[Flavor]]
|
List of new stack component flavors. |
Source code in src/zenml/integrations/kubernetes/__init__.py
38 39 40 41 42 43 44 45 46 47 48 49 |
|
Modules
constants
Kubernetes orchestrator constants.
flavors
Kubernetes integration flavors.
Classes
KubernetesOrchestratorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseOrchestratorConfig
, KubernetesOrchestratorSettings
Configuration for the Kubernetes orchestrator.
Source code in src/zenml/stack/stack_component.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
handles_step_retries: bool
property
Whether the orchestrator handles step retries.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator handles step retries. |
is_local: bool
property
Checks if this stack component is running locally.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a local component, False otherwise. |
is_remote: bool
property
Checks if this stack component is running remotely.
This designation is used to determine if the stack component can be used with a local ZenML database or if it requires a remote ZenML server.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a remote component, False otherwise. |
is_schedulable: bool
property
Whether the orchestrator is schedulable or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator is schedulable or not. |
is_synchronous: bool
property
Whether the orchestrator runs synchronous or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator runs synchronous or not. |
supports_client_side_caching: bool
property
Whether the orchestrator supports client side caching.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator supports client side caching. |
KubernetesOrchestratorFlavor
Bases: BaseOrchestratorFlavor
Kubernetes orchestrator flavor.
config_class: Type[KubernetesOrchestratorConfig]
property
Returns KubernetesOrchestratorConfig
config class.
Returns:
Type | Description |
---|---|
Type[KubernetesOrchestratorConfig]
|
The config class. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[KubernetesOrchestrator]
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[KubernetesOrchestrator]
|
The implementation class. |
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
Type | Description |
---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
KubernetesOrchestratorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Settings for the Kubernetes orchestrator.
Configuration options for how pipelines are executed on Kubernetes clusters. Field descriptions are defined inline using Field() descriptors.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
KubernetesStepOperatorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseStepOperatorConfig
, KubernetesStepOperatorSettings
Configuration for the Kubernetes step operator.
Source code in src/zenml/stack/stack_component.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
is_local: bool
property
Checks if this stack component is running locally.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a local component, False otherwise. |
is_remote: bool
property
Checks if this stack component is running remotely.
This designation is used to determine if the stack component can be used with a local ZenML database or if it requires a remote ZenML server.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a remote component, False otherwise. |
KubernetesStepOperatorFlavor
Bases: BaseStepOperatorFlavor
Kubernetes step operator flavor.
config_class: Type[KubernetesStepOperatorConfig]
property
Returns KubernetesStepOperatorConfig
config class.
Returns:
Type | Description |
---|---|
Type[KubernetesStepOperatorConfig]
|
The config class. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[KubernetesStepOperator]
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[KubernetesStepOperator]
|
The implementation class. |
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
Type | Description |
---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
KubernetesStepOperatorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Settings for the Kubernetes step operator.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
Modules
kubernetes_orchestrator_flavor
Kubernetes orchestrator flavor.
KubernetesOrchestratorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseOrchestratorConfig
, KubernetesOrchestratorSettings
Configuration for the Kubernetes orchestrator.
Source code in src/zenml/stack/stack_component.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
handles_step_retries: bool
property
Whether the orchestrator handles step retries.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator handles step retries. |
is_local: bool
property
Checks if this stack component is running locally.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a local component, False otherwise. |
is_remote: bool
property
Checks if this stack component is running remotely.
This designation is used to determine if the stack component can be used with a local ZenML database or if it requires a remote ZenML server.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a remote component, False otherwise. |
is_schedulable: bool
property
Whether the orchestrator is schedulable or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator is schedulable or not. |
is_synchronous: bool
property
Whether the orchestrator runs synchronous or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator runs synchronous or not. |
supports_client_side_caching: bool
property
Whether the orchestrator supports client side caching.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator supports client side caching. |
KubernetesOrchestratorFlavor
Bases: BaseOrchestratorFlavor
Kubernetes orchestrator flavor.
config_class: Type[KubernetesOrchestratorConfig]
property
Returns KubernetesOrchestratorConfig
config class.
Returns:
Type | Description |
---|---|
Type[KubernetesOrchestratorConfig]
|
The config class. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[KubernetesOrchestrator]
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[KubernetesOrchestrator]
|
The implementation class. |
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
Type | Description |
---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
KubernetesOrchestratorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Settings for the Kubernetes orchestrator.
Configuration options for how pipelines are executed on Kubernetes clusters. Field descriptions are defined inline using Field() descriptors.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
kubernetes_step_operator_flavor
Kubernetes step operator flavor.
KubernetesStepOperatorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseStepOperatorConfig
, KubernetesStepOperatorSettings
Configuration for the Kubernetes step operator.
Source code in src/zenml/stack/stack_component.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
is_local: bool
property
Checks if this stack component is running locally.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a local component, False otherwise. |
is_remote: bool
property
Checks if this stack component is running remotely.
This designation is used to determine if the stack component can be used with a local ZenML database or if it requires a remote ZenML server.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a remote component, False otherwise. |
KubernetesStepOperatorFlavor
Bases: BaseStepOperatorFlavor
Kubernetes step operator flavor.
config_class: Type[KubernetesStepOperatorConfig]
property
Returns KubernetesStepOperatorConfig
config class.
Returns:
Type | Description |
---|---|
Type[KubernetesStepOperatorConfig]
|
The config class. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[KubernetesStepOperator]
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[KubernetesStepOperator]
|
The implementation class. |
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
Type | Description |
---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
KubernetesStepOperatorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Settings for the Kubernetes step operator.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
orchestrators
Kubernetes-native orchestration.
Classes
KubernetesOrchestrator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: ContainerizedOrchestrator
Orchestrator for running ZenML pipelines using native Kubernetes.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: KubernetesOrchestratorConfig
property
Returns the KubernetesOrchestratorConfig
config.
Returns:
Type | Description |
---|---|
KubernetesOrchestratorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the Kubernetes orchestrator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Defines the validator that checks whether the stack is valid.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
Stack validator. |
delete_schedule(schedule: ScheduleResponse) -> None
Deletes a schedule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule
|
ScheduleResponse
|
The schedule to delete. |
required |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the cron job name is not found. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 |
|
fetch_status(run: PipelineRunResponse, include_steps: bool = False) -> Tuple[Optional[ExecutionStatus], Optional[Dict[str, ExecutionStatus]]]
Refreshes the status of a specific pipeline run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run
|
PipelineRunResponse
|
The run that was executed by this orchestrator. |
required |
include_steps
|
bool
|
If True, also fetch the status of individual steps. |
False
|
Returns:
Type | Description |
---|---|
Optional[ExecutionStatus]
|
A tuple of (pipeline_status, step_statuses). |
Optional[Dict[str, ExecutionStatus]]
|
If include_steps is False, step_statuses will be None. |
Tuple[Optional[ExecutionStatus], Optional[Dict[str, ExecutionStatus]]]
|
If include_steps is True, step_statuses will be a dict (possibly empty). |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 |
|
get_kube_client(incluster: Optional[bool] = None) -> k8s_client.ApiClient
Getter for the Kubernetes API client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
incluster
|
Optional[bool]
|
Whether to use the in-cluster config or not. Overrides
the |
None
|
Returns:
Type | Description |
---|---|
ApiClient
|
The Kubernetes API client. |
Raises:
Type | Description |
---|---|
RuntimeError
|
if the Kubernetes connector behaves unexpectedly. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
|
get_kubernetes_contexts() -> Tuple[List[str], str]
Get list of configured Kubernetes contexts and the active context.
Raises:
Type | Description |
---|---|
RuntimeError
|
if the Kubernetes configuration cannot be loaded. |
Returns:
Name | Type | Description |
---|---|---|
context_name |
List[str]
|
List of configured Kubernetes contexts |
active_context_name |
str
|
Name of the active Kubernetes context. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|
get_orchestrator_run_id() -> str
Returns the active orchestrator run id.
Raises:
Type | Description |
---|---|
RuntimeError
|
If the environment variable specifying the run id is not set. |
Returns:
Type | Description |
---|---|
str
|
The orchestrator run id. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 |
|
get_pipeline_run_metadata(run_id: UUID) -> Dict[str, MetadataType]
Get general component-specific metadata for a pipeline run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run_id
|
UUID
|
The ID of the pipeline run. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
876 877 878 879 880 881 882 883 884 885 886 887 888 889 |
|
get_token_secret_name(deployment_id: UUID) -> str
Returns the name of the secret that contains the ZenML token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment_id
|
UUID
|
The ID of the deployment. |
required |
Returns:
Type | Description |
---|---|
str
|
The name of the secret that contains the ZenML token. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
372 373 374 375 376 377 378 379 380 381 |
|
should_build_pipeline_image(deployment: PipelineDeploymentBase) -> bool
Whether to always build the pipeline image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentBase
|
The pipeline deployment. |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether to always build the pipeline image. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
submit_pipeline(deployment: PipelineDeploymentResponse, stack: Stack, environment: Dict[str, str], placeholder_run: Optional[PipelineRunResponse] = None) -> Optional[SubmissionResult]
Submits a pipeline to the orchestrator.
This method should only submit the pipeline and not wait for it to complete. If the orchestrator is configured to wait for the pipeline run to complete, a function that waits for the pipeline run to complete can be passed as part of the submission result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentResponse
|
The pipeline deployment to submit. |
required |
stack
|
Stack
|
The stack the pipeline will run on. |
required |
environment
|
Dict[str, str]
|
Environment variables to set in the orchestration environment. These don't need to be set if running locally. |
required |
placeholder_run
|
Optional[PipelineRunResponse]
|
An optional placeholder run for the deployment. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If a schedule without cron expression is given. |
Exception
|
If the orchestrator pod fails to start. |
Returns:
Type | Description |
---|---|
Optional[SubmissionResult]
|
Optional submission result. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 |
|
update_schedule(schedule: ScheduleResponse, update: ScheduleUpdate) -> None
Updates a schedule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule
|
ScheduleResponse
|
The schedule to update. |
required |
update
|
ScheduleUpdate
|
The update to apply to the schedule. |
required |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the cron job name is not found. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 |
|
Modules
dag_runner
DAG runner.
DagRunner(nodes: List[Node], node_startup_function: Callable[[Node], NodeStatus], node_monitoring_function: Callable[[Node], NodeStatus], node_stop_function: Optional[Callable[[Node], None]] = None, interrupt_function: Optional[Callable[[], Optional[InterruptMode]]] = None, monitoring_interval: float = 1.0, monitoring_delay: float = 0.0, interrupt_check_interval: float = 1.0, max_parallelism: Optional[int] = None)
DAG runner.
This class does the orchestration of running the nodes of a DAG. It is running two loops in separate threads: The main thread - checks if any nodes should be skipped or are ready to run, in which case the node will be added to the startup queue - creates a worker thread to start the node and executes it in a thread pool if there are nodes in the startup queue and the maximum parallelism is not reached - periodically checks if the DAG should be interrupted The monitoring thread - monitors the running nodes and updates their status
Initialize the DAG runner.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nodes
|
List[Node]
|
The nodes of the DAG. |
required |
node_startup_function
|
Callable[[Node], NodeStatus]
|
The function to start a node. |
required |
node_monitoring_function
|
Callable[[Node], NodeStatus]
|
The function to monitor a node. |
required |
node_stop_function
|
Optional[Callable[[Node], None]]
|
The function to stop a node. |
None
|
interrupt_function
|
Optional[Callable[[], Optional[InterruptMode]]]
|
Will be periodically called to check if the DAG should be interrupted. |
None
|
monitoring_interval
|
float
|
The interval in which the nodes are monitored. |
1.0
|
monitoring_delay
|
float
|
The delay in seconds to wait between monitoring different nodes. |
0.0
|
interrupt_check_interval
|
float
|
The interval in which the interrupt function is called. |
1.0
|
max_parallelism
|
Optional[int]
|
The maximum number of nodes to run in parallel. |
None
|
Source code in src/zenml/integrations/kubernetes/orchestrators/dag_runner.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
active_nodes: List[Node]
property
Active nodes.
Active nodes are nodes that are either running or starting.
Returns:
Type | Description |
---|---|
List[Node]
|
Active nodes. |
running_nodes: List[Node]
property
run() -> Dict[str, NodeStatus]
Run the DAG.
Returns:
Type | Description |
---|---|
Dict[str, NodeStatus]
|
The final node states. |
Source code in src/zenml/integrations/kubernetes/orchestrators/dag_runner.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
|
InterruptMode
Node
Bases: BaseModel
DAG node.
is_finished: bool
property
Whether the node is finished.
Returns:
Type | Description |
---|---|
bool
|
Whether the node is finished. |
NodeStatus
kube_utils
Utilities for Kubernetes related functions.
Internal interface: no backwards compatibility guarantees. Adjusted from https://github.com/tensorflow/tfx/blob/master/tfx/utils/kube_utils.py.
JobStatus
Bases: Enum
Status of a Kubernetes job.
PatchedFailurePolicyRule
Bases: V1PodFailurePolicyRule
Patched failure policy rule.
on_pod_conditions
property
writable
On pod conditions.
Returns:
Type | Description |
---|---|
On pod conditions. |
PodPhase
Bases: Enum
Phase of the Kubernetes pod.
Pod phases are defined in https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase.
apply_default_resource_requests(memory: str, cpu: Optional[str] = None, pod_settings: Optional[KubernetesPodSettings] = None) -> KubernetesPodSettings
Applies default resource requests to a pod settings object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
memory
|
str
|
The memory resource request. |
required |
cpu
|
Optional[str]
|
The CPU resource request. |
None
|
pod_settings
|
Optional[KubernetesPodSettings]
|
The pod settings to update. A new one will be created if not provided. |
None
|
Returns:
Type | Description |
---|---|
KubernetesPodSettings
|
The new or updated pod settings. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 |
|
check_job_status(batch_api: k8s_client.BatchV1Api, core_api: k8s_client.CoreV1Api, namespace: str, job_name: str, fail_on_container_waiting_reasons: Optional[List[str]] = None, container_name: Optional[str] = None) -> Tuple[JobStatus, Optional[str]]
Check the status of a job.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch_api
|
BatchV1Api
|
Kubernetes BatchV1Api client. |
required |
core_api
|
CoreV1Api
|
Kubernetes CoreV1Api client. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
job_name
|
str
|
Name of the job for which to wait. |
required |
fail_on_container_waiting_reasons
|
Optional[List[str]]
|
List of container waiting reasons that will cause the job to fail. |
None
|
container_name
|
Optional[str]
|
Name of the container to check for failure. |
None
|
Returns:
Type | Description |
---|---|
Tuple[JobStatus, Optional[str]]
|
The status of the job and an error message if the job failed. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 |
|
create_and_wait_for_pod_to_start(core_api: k8s_client.CoreV1Api, pod_display_name: str, pod_name: str, pod_manifest: k8s_client.V1Pod, namespace: str, startup_max_retries: int, startup_failure_delay: float, startup_failure_backoff: float, startup_timeout: float) -> None
Create a pod and wait for it to reach a desired state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Client of Core V1 API of Kubernetes API. |
required |
pod_display_name
|
str
|
The display name of the pod to use in logs. |
required |
pod_name
|
str
|
The name of the pod to create. |
required |
pod_manifest
|
V1Pod
|
The manifest of the pod to create. |
required |
namespace
|
str
|
The namespace in which to create the pod. |
required |
startup_max_retries
|
int
|
The maximum number of retries for the pod startup. |
required |
startup_failure_delay
|
float
|
The delay between retries for the pod startup. |
required |
startup_failure_backoff
|
float
|
The backoff factor for the pod startup. |
required |
startup_timeout
|
float
|
The maximum time to wait for the pod to start. |
required |
Raises:
Type | Description |
---|---|
TimeoutError
|
If the pod is still in a pending state after the maximum wait time has elapsed. |
Exception
|
If the pod fails to start after the maximum number of retries. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 |
|
create_config_map(core_api: k8s_client.CoreV1Api, namespace: str, name: str, data: Dict[str, str]) -> None
Create a Kubernetes config map.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Kubernetes CoreV1Api client. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
name
|
str
|
Name of the config map to create. |
required |
data
|
Dict[str, str]
|
Data to store in the config map. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 |
|
create_edit_service_account(core_api: k8s_client.CoreV1Api, rbac_api: k8s_client.RbacAuthorizationV1Api, service_account_name: str, namespace: str, role_binding_name: str = 'zenml-edit') -> None
Create a new Kubernetes service account with "edit" rights.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Client of Core V1 API of Kubernetes API. |
required |
rbac_api
|
RbacAuthorizationV1Api
|
Client of Rbac Authorization V1 API of Kubernetes API. |
required |
service_account_name
|
str
|
Name of the service account. |
required |
namespace
|
str
|
Kubernetes namespace. Defaults to "default". |
required |
role_binding_name
|
str
|
Name of the role binding. Defaults to "zenml-edit". |
'zenml-edit'
|
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
|
create_job(batch_api: k8s_client.BatchV1Api, namespace: str, job_manifest: k8s_client.V1Job) -> None
Create a Kubernetes job.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch_api
|
BatchV1Api
|
Kubernetes batch api. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
job_manifest
|
V1Job
|
The manifest of the job to create. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
create_namespace(core_api: k8s_client.CoreV1Api, namespace: str) -> None
Create a Kubernetes namespace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Client of Core V1 API of Kubernetes API. |
required |
namespace
|
str
|
Kubernetes namespace. Defaults to "default". |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
384 385 386 387 388 389 390 391 392 |
|
create_or_update_secret(core_api: k8s_client.CoreV1Api, namespace: str, secret_name: str, data: Dict[str, Optional[str]]) -> None
Create a Kubernetes secret if it doesn't exist, or update it if it does.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Client of Core V1 API of Kubernetes API. |
required |
namespace
|
str
|
The namespace in which to create or update the secret. |
required |
secret_name
|
str
|
The name of the secret to create or update. |
required |
data
|
Dict[str, Optional[str]]
|
The secret data. If the value is None, the key will be removed from the secret. |
required |
Raises:
Type | Description |
---|---|
ApiException
|
If the secret creation failed for any reason other than the secret already existing. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
|
create_secret(core_api: k8s_client.CoreV1Api, namespace: str, secret_name: str, data: Dict[str, Optional[str]]) -> None
Create a Kubernetes secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Client of Core V1 API of Kubernetes API. |
required |
namespace
|
str
|
The namespace in which to create the secret. |
required |
secret_name
|
str
|
The name of the secret to create. |
required |
data
|
Dict[str, Optional[str]]
|
The secret data. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
|
delete_config_map(core_api: k8s_client.CoreV1Api, namespace: str, name: str) -> None
Delete a Kubernetes config map.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Kubernetes CoreV1Api client. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
name
|
str
|
Name of the config map to delete. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 |
|
delete_secret(core_api: k8s_client.CoreV1Api, namespace: str, secret_name: str) -> None
Delete a Kubernetes secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Client of Core V1 API of Kubernetes API. |
required |
namespace
|
str
|
The namespace in which to delete the secret. |
required |
secret_name
|
str
|
The name of the secret to delete. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
|
get_config_map(core_api: k8s_client.CoreV1Api, namespace: str, name: str) -> k8s_client.V1ConfigMap
Get a Kubernetes config map.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Kubernetes CoreV1Api client. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
name
|
str
|
Name of the config map to get. |
required |
Returns:
Type | Description |
---|---|
V1ConfigMap
|
The config map. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 |
|
get_container_status(pod: k8s_client.V1Pod, container_name: str) -> Optional[k8s_client.V1ContainerState]
Get the status of a container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod
|
V1Pod
|
The pod to get the container status for. |
required |
container_name
|
str
|
The container name. |
required |
Returns:
Type | Description |
---|---|
Optional[V1ContainerState]
|
The container status. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 |
|
get_container_termination_reason(pod: k8s_client.V1Pod, container_name: str) -> Optional[Tuple[int, str]]
Get the termination reason for a container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod
|
V1Pod
|
The pod to get the termination reason for. |
required |
container_name
|
str
|
The container name. |
required |
Returns:
Type | Description |
---|---|
Optional[Tuple[int, str]]
|
The exit code and termination reason for the container. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 |
|
get_job(batch_api: k8s_client.BatchV1Api, namespace: str, job_name: str) -> k8s_client.V1Job
Get a job by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch_api
|
BatchV1Api
|
Kubernetes batch api. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
job_name
|
str
|
The name of the job to get. |
required |
Returns:
Type | Description |
---|---|
V1Job
|
The job. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 |
|
get_parent_job_name(core_api: k8s_client.CoreV1Api, pod_name: str, namespace: str) -> Optional[str]
Get the name of the job that created a pod.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Kubernetes CoreV1Api client. |
required |
pod_name
|
str
|
Name of the pod. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
Returns:
Type | Description |
---|---|
Optional[str]
|
The name of the job that created the pod, or None if the pod is not |
Optional[str]
|
associated with a job. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 |
|
get_pod(core_api: k8s_client.CoreV1Api, pod_name: str, namespace: str) -> Optional[k8s_client.V1Pod]
Get a pod from Kubernetes metadata API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Client of |
required |
pod_name
|
str
|
The name of the pod. |
required |
namespace
|
str
|
The namespace of the pod. |
required |
Raises:
Type | Description |
---|---|
RuntimeError
|
When it sees unexpected errors from Kubernetes API. |
Returns:
Type | Description |
---|---|
Optional[V1Pod]
|
The found pod object. None if it's not found. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
|
get_pod_owner_references(core_api: k8s_client.CoreV1Api, pod_name: str, namespace: str) -> List[k8s_client.V1OwnerReference]
Get owner references for a pod.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Kubernetes CoreV1Api client. |
required |
pod_name
|
str
|
Name of the pod. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
Returns:
Type | Description |
---|---|
List[V1OwnerReference]
|
List of owner references. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 |
|
is_inside_kubernetes() -> bool
Check whether we are inside a Kubernetes cluster or on a remote host.
Returns:
Type | Description |
---|---|
bool
|
True if inside a Kubernetes cluster, else False. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
115 116 117 118 119 120 121 122 123 124 125 |
|
is_step_job(job: k8s_client.V1Job) -> bool
Check if a job is a step job.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job
|
V1Job
|
The job to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether the job is a step job. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
736 737 738 739 740 741 742 743 744 745 746 747 748 |
|
list_jobs(batch_api: k8s_client.BatchV1Api, namespace: str, label_selector: Optional[str] = None) -> k8s_client.V1JobList
List jobs in a namespace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch_api
|
BatchV1Api
|
Kubernetes batch api. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
label_selector
|
Optional[str]
|
The label selector to use. |
None
|
Returns:
Type | Description |
---|---|
V1JobList
|
The job list. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 |
|
load_kube_config(incluster: bool = False, context: Optional[str] = None) -> None
Load the Kubernetes client config.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
incluster
|
bool
|
Whether to load the in-cluster config. |
False
|
context
|
Optional[str]
|
Name of the Kubernetes context. If not provided, uses the
currently active context. Will be ignored if |
None
|
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
pod_failed(pod: k8s_client.V1Pod) -> bool
Check if pod status is 'Failed'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod
|
V1Pod
|
Kubernetes pod. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if pod status is 'Failed' else False. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
177 178 179 180 181 182 183 184 185 186 |
|
pod_is_done(pod: k8s_client.V1Pod) -> bool
Check if pod status is 'Succeeded'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod
|
V1Pod
|
Kubernetes pod. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if pod status is 'Succeeded' else False. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
189 190 191 192 193 194 195 196 197 198 |
|
pod_is_not_pending(pod: k8s_client.V1Pod) -> bool
Check if pod status is not 'Pending'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod
|
V1Pod
|
Kubernetes pod. |
required |
Returns:
Type | Description |
---|---|
bool
|
False if the pod status is 'Pending' else True. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
165 166 167 168 169 170 171 172 173 174 |
|
retry_on_api_exception(func: Callable[..., R], max_retries: int = 3, delay: float = 1, backoff: float = 1, fail_on_status_codes: Tuple[int, ...] = (404,)) -> Callable[..., R]
Retry a function on API exceptions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func
|
Callable[..., R]
|
The function to retry. |
required |
max_retries
|
int
|
The maximum number of retries. |
3
|
delay
|
float
|
The delay between retries. |
1
|
backoff
|
float
|
The backoff factor. |
1
|
fail_on_status_codes
|
Tuple[int, ...]
|
The status codes to fail on immediately. |
(404,)
|
Returns:
Type | Description |
---|---|
Callable[..., R]
|
The wrapped function with retry logic. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 |
|
sanitize_label(label: str) -> str
Sanitize a label for a Kubernetes resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
label
|
str
|
The label to sanitize. |
required |
Returns:
Type | Description |
---|---|
str
|
The sanitized label. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
update_config_map(core_api: k8s_client.CoreV1Api, namespace: str, name: str, data: Dict[str, str]) -> None
Update a Kubernetes config map.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Kubernetes CoreV1Api client. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
name
|
str
|
Name of the config map to update. |
required |
data
|
Dict[str, str]
|
Data to store in the config map. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 |
|
update_job(batch_api: k8s_client.BatchV1Api, namespace: str, job_name: str, annotations: Dict[str, str]) -> k8s_client.V1Job
Update a job.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch_api
|
BatchV1Api
|
Kubernetes batch api. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
job_name
|
str
|
The name of the job to update. |
required |
annotations
|
Dict[str, str]
|
The annotations to update. |
required |
Returns:
Type | Description |
---|---|
V1Job
|
The updated job. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 |
|
update_secret(core_api: k8s_client.CoreV1Api, namespace: str, secret_name: str, data: Dict[str, Optional[str]]) -> None
Update a Kubernetes secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
core_api
|
CoreV1Api
|
Client of Core V1 API of Kubernetes API. |
required |
namespace
|
str
|
The namespace in which to update the secret. |
required |
secret_name
|
str
|
The name of the secret to update. |
required |
data
|
Dict[str, Optional[str]]
|
The secret data. If the value is None, the key will be removed from the secret. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
|
wait_for_job_to_finish(batch_api: k8s_client.BatchV1Api, core_api: k8s_client.CoreV1Api, namespace: str, job_name: str, backoff_interval: float = 1, maximum_backoff: float = 32, exponential_backoff: bool = False, fail_on_container_waiting_reasons: Optional[List[str]] = None, stream_logs: bool = True, container_name: Optional[str] = None) -> None
Wait for a job to finish.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch_api
|
BatchV1Api
|
Kubernetes BatchV1Api client. |
required |
core_api
|
CoreV1Api
|
Kubernetes CoreV1Api client. |
required |
namespace
|
str
|
Kubernetes namespace. |
required |
job_name
|
str
|
Name of the job for which to wait. |
required |
backoff_interval
|
float
|
The interval to wait between polling the job status. |
1
|
maximum_backoff
|
float
|
The maximum interval to wait between polling the job status. |
32
|
exponential_backoff
|
bool
|
Whether to use exponential backoff. |
False
|
fail_on_container_waiting_reasons
|
Optional[List[str]]
|
List of container waiting reasons that will cause the job to fail. |
None
|
stream_logs
|
bool
|
Whether to stream the job logs. |
True
|
container_name
|
Optional[str]
|
Name of the container to stream logs from. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If the job failed or timed out. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 |
|
wait_pod(kube_client_fn: Callable[[], k8s_client.ApiClient], pod_name: str, namespace: str, exit_condition_lambda: Callable[[k8s_client.V1Pod], bool], timeout_sec: int = 0, exponential_backoff: bool = False, stream_logs: bool = False) -> k8s_client.V1Pod
Wait for a pod to meet an exit condition.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kube_client_fn
|
Callable[[], ApiClient]
|
the kube client fn is a function that is called
periodically and is used to get a |
required |
pod_name
|
str
|
The name of the pod. |
required |
namespace
|
str
|
The namespace of the pod. |
required |
exit_condition_lambda
|
Callable[[V1Pod], bool]
|
A lambda which will be called periodically to wait for a pod to exit. The function returns True to exit. |
required |
timeout_sec
|
int
|
Timeout in seconds to wait for pod to reach exit condition, or 0 to wait for an unlimited duration. Defaults to unlimited. |
0
|
exponential_backoff
|
bool
|
Whether to use exponential back off for polling. Defaults to False. |
False
|
stream_logs
|
bool
|
Whether to stream the pod logs to
|
False
|
Raises:
Type | Description |
---|---|
RuntimeError
|
when the function times out. |
Returns:
Type | Description |
---|---|
V1Pod
|
The pod object which meets the exit condition. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kube_utils.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
|
kubernetes_orchestrator
Kubernetes-native orchestrator.
KubernetesOrchestrator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: ContainerizedOrchestrator
Orchestrator for running ZenML pipelines using native Kubernetes.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: KubernetesOrchestratorConfig
property
Returns the KubernetesOrchestratorConfig
config.
Returns:
Type | Description |
---|---|
KubernetesOrchestratorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the Kubernetes orchestrator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Defines the validator that checks whether the stack is valid.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
Stack validator. |
delete_schedule(schedule: ScheduleResponse) -> None
Deletes a schedule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule
|
ScheduleResponse
|
The schedule to delete. |
required |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the cron job name is not found. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 |
|
fetch_status(run: PipelineRunResponse, include_steps: bool = False) -> Tuple[Optional[ExecutionStatus], Optional[Dict[str, ExecutionStatus]]]
Refreshes the status of a specific pipeline run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run
|
PipelineRunResponse
|
The run that was executed by this orchestrator. |
required |
include_steps
|
bool
|
If True, also fetch the status of individual steps. |
False
|
Returns:
Type | Description |
---|---|
Optional[ExecutionStatus]
|
A tuple of (pipeline_status, step_statuses). |
Optional[Dict[str, ExecutionStatus]]
|
If include_steps is False, step_statuses will be None. |
Tuple[Optional[ExecutionStatus], Optional[Dict[str, ExecutionStatus]]]
|
If include_steps is True, step_statuses will be a dict (possibly empty). |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 |
|
get_kube_client(incluster: Optional[bool] = None) -> k8s_client.ApiClient
Getter for the Kubernetes API client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
incluster
|
Optional[bool]
|
Whether to use the in-cluster config or not. Overrides
the |
None
|
Returns:
Type | Description |
---|---|
ApiClient
|
The Kubernetes API client. |
Raises:
Type | Description |
---|---|
RuntimeError
|
if the Kubernetes connector behaves unexpectedly. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
|
get_kubernetes_contexts() -> Tuple[List[str], str]
Get list of configured Kubernetes contexts and the active context.
Raises:
Type | Description |
---|---|
RuntimeError
|
if the Kubernetes configuration cannot be loaded. |
Returns:
Name | Type | Description |
---|---|---|
context_name |
List[str]
|
List of configured Kubernetes contexts |
active_context_name |
str
|
Name of the active Kubernetes context. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|
get_orchestrator_run_id() -> str
Returns the active orchestrator run id.
Raises:
Type | Description |
---|---|
RuntimeError
|
If the environment variable specifying the run id is not set. |
Returns:
Type | Description |
---|---|
str
|
The orchestrator run id. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 |
|
get_pipeline_run_metadata(run_id: UUID) -> Dict[str, MetadataType]
Get general component-specific metadata for a pipeline run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run_id
|
UUID
|
The ID of the pipeline run. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
876 877 878 879 880 881 882 883 884 885 886 887 888 889 |
|
get_token_secret_name(deployment_id: UUID) -> str
Returns the name of the secret that contains the ZenML token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment_id
|
UUID
|
The ID of the deployment. |
required |
Returns:
Type | Description |
---|---|
str
|
The name of the secret that contains the ZenML token. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
372 373 374 375 376 377 378 379 380 381 |
|
should_build_pipeline_image(deployment: PipelineDeploymentBase) -> bool
Whether to always build the pipeline image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentBase
|
The pipeline deployment. |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether to always build the pipeline image. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
submit_pipeline(deployment: PipelineDeploymentResponse, stack: Stack, environment: Dict[str, str], placeholder_run: Optional[PipelineRunResponse] = None) -> Optional[SubmissionResult]
Submits a pipeline to the orchestrator.
This method should only submit the pipeline and not wait for it to complete. If the orchestrator is configured to wait for the pipeline run to complete, a function that waits for the pipeline run to complete can be passed as part of the submission result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentResponse
|
The pipeline deployment to submit. |
required |
stack
|
Stack
|
The stack the pipeline will run on. |
required |
environment
|
Dict[str, str]
|
Environment variables to set in the orchestration environment. These don't need to be set if running locally. |
required |
placeholder_run
|
Optional[PipelineRunResponse]
|
An optional placeholder run for the deployment. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If a schedule without cron expression is given. |
Exception
|
If the orchestrator pod fails to start. |
Returns:
Type | Description |
---|---|
Optional[SubmissionResult]
|
Optional submission result. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 |
|
update_schedule(schedule: ScheduleResponse, update: ScheduleUpdate) -> None
Updates a schedule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule
|
ScheduleResponse
|
The schedule to update. |
required |
update
|
ScheduleUpdate
|
The update to apply to the schedule. |
required |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the cron job name is not found. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 |
|
kubernetes_orchestrator_entrypoint
Entrypoint of the Kubernetes master/orchestrator pod.
main() -> None
Entrypoint of the k8s master/orchestrator pod.
Raises:
Type | Description |
---|---|
RuntimeError
|
If the orchestrator pod is not associated with a job. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 |
|
parse_args() -> argparse.Namespace
Parse entrypoint arguments.
Returns:
Type | Description |
---|---|
Namespace
|
Parsed args. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py
75 76 77 78 79 80 81 82 83 84 |
|
kubernetes_orchestrator_entrypoint_configuration
Entrypoint configuration for the Kubernetes master/orchestrator pod.
KubernetesOrchestratorEntrypointConfiguration
Entrypoint configuration for the k8s master/orchestrator pod.
get_entrypoint_arguments(deployment_id: UUID, run_id: Optional[UUID] = None) -> List[str]
classmethod
Gets all arguments that the entrypoint command should be called with.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment_id
|
UUID
|
ID of the deployment. |
required |
run_id
|
Optional[UUID]
|
Optional ID of the pipeline run. Not set for scheduled runs. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
List of entrypoint arguments. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint_configuration.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
get_entrypoint_command() -> List[str]
classmethod
Returns a command that runs the entrypoint module.
Returns:
Type | Description |
---|---|
List[str]
|
Entrypoint command. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint_configuration.py
40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
get_entrypoint_options() -> Set[str]
classmethod
Gets all the options required for running this entrypoint.
Returns:
Type | Description |
---|---|
Set[str]
|
Entrypoint options. |
Source code in src/zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint_configuration.py
28 29 30 31 32 33 34 35 36 37 38 |
|
manifest_utils
Utility functions for building manifests for k8s pods.
add_local_stores_mount(pod_spec: k8s_client.V1PodSpec) -> None
Makes changes in place to the configuration of the pod spec.
Configures mounted volumes for stack components that write to a local path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod_spec
|
V1PodSpec
|
The pod spec to update. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
add_pod_settings(pod_spec: k8s_client.V1PodSpec, settings: KubernetesPodSettings) -> None
Updates pod spec
fields in place if passed in orchestrator settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod_spec
|
V1PodSpec
|
Pod spec to update. |
required |
settings
|
KubernetesPodSettings
|
Pod settings to apply. |
required |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
build_cron_job_manifest(job_template: k8s_client.V1JobTemplateSpec, cron_expression: str, successful_jobs_history_limit: Optional[int] = None, failed_jobs_history_limit: Optional[int] = None) -> k8s_client.V1CronJob
Build a Kubernetes cron job manifest.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_template
|
V1JobTemplateSpec
|
The job template to use for the cron job. |
required |
cron_expression
|
str
|
The cron expression to use for the cron job. |
required |
successful_jobs_history_limit
|
Optional[int]
|
The number of successful jobs to keep. |
None
|
failed_jobs_history_limit
|
Optional[int]
|
The number of failed jobs to keep. |
None
|
Returns:
Type | Description |
---|---|
V1CronJob
|
The Kubernetes cron job manifest. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
|
build_job_manifest(job_name: str, pod_template: k8s_client.V1PodTemplateSpec, backoff_limit: Optional[int] = None, ttl_seconds_after_finished: Optional[int] = None, labels: Optional[Dict[str, str]] = None, annotations: Optional[Dict[str, str]] = None, active_deadline_seconds: Optional[int] = None, pod_failure_policy: Optional[Dict[str, Any]] = None, owner_references: Optional[List[k8s_client.V1OwnerReference]] = None) -> k8s_client.V1Job
Build a Kubernetes job manifest.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_name
|
str
|
Name of the job. |
required |
pod_template
|
V1PodTemplateSpec
|
The pod template to use for the job. |
required |
backoff_limit
|
Optional[int]
|
The backoff limit for the job. |
None
|
ttl_seconds_after_finished
|
Optional[int]
|
The TTL seconds after finished for the job. |
None
|
labels
|
Optional[Dict[str, str]]
|
The labels to use for the job. |
None
|
annotations
|
Optional[Dict[str, str]]
|
The annotations to use for the job. |
None
|
active_deadline_seconds
|
Optional[int]
|
The active deadline seconds for the job. |
None
|
pod_failure_policy
|
Optional[Dict[str, Any]]
|
The pod failure policy for the job. |
None
|
owner_references
|
Optional[List[V1OwnerReference]]
|
The owner references for the job. |
None
|
Returns:
Type | Description |
---|---|
V1Job
|
The Kubernetes job manifest. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
|
build_namespace_manifest(namespace: str) -> Dict[str, Any]
Build the manifest for a new namespace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
namespace
|
str
|
Kubernetes namespace. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Manifest of the new namespace. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
|
build_pod_manifest(pod_name: Optional[str], image_name: str, command: List[str], args: List[str], privileged: bool, pod_settings: Optional[KubernetesPodSettings] = None, service_account_name: Optional[str] = None, env: Optional[Dict[str, str]] = None, labels: Optional[Dict[str, str]] = None, mount_local_stores: bool = False, owner_references: Optional[List[k8s_client.V1OwnerReference]] = None, termination_grace_period_seconds: Optional[int] = 30) -> k8s_client.V1Pod
Build a Kubernetes pod manifest for a ZenML run or step.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod_name
|
Optional[str]
|
Name of the pod. |
required |
image_name
|
str
|
Name of the Docker image. |
required |
command
|
List[str]
|
Command to execute the entrypoint in the pod. |
required |
args
|
List[str]
|
Arguments provided to the entrypoint command. |
required |
privileged
|
bool
|
Whether to run the container in privileged mode. |
required |
pod_settings
|
Optional[KubernetesPodSettings]
|
Optional settings for the pod. |
None
|
service_account_name
|
Optional[str]
|
Optional name of a service account. Can be used to assign certain roles to a pod, e.g., to allow it to run Kubernetes commands from within the cluster. |
None
|
env
|
Optional[Dict[str, str]]
|
Environment variables to set. |
None
|
labels
|
Optional[Dict[str, str]]
|
Labels to add to the pod. |
None
|
mount_local_stores
|
bool
|
Whether to mount the local stores path inside the pod. |
False
|
owner_references
|
Optional[List[V1OwnerReference]]
|
List of owner references for the pod. |
None
|
termination_grace_period_seconds
|
Optional[int]
|
The amount of seconds to wait for a pod to shutdown gracefully. |
30
|
Returns:
Type | Description |
---|---|
V1Pod
|
Pod manifest. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
build_role_binding_manifest_for_service_account(name: str, role_name: str, service_account_name: str, namespace: str = 'default') -> Dict[str, Any]
Build a manifest for a role binding of a service account.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the cluster role binding. |
required |
role_name
|
str
|
Name of the role. |
required |
service_account_name
|
str
|
Name of the service account. |
required |
namespace
|
str
|
Kubernetes namespace. Defaults to "default". |
'default'
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Manifest for a cluster role binding of a service account. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
|
build_secret_manifest(name: str, data: Mapping[str, Optional[str]], secret_type: str = 'Opaque') -> Dict[str, Any]
Builds a Kubernetes secret manifest.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the secret. |
required |
data
|
Mapping[str, Optional[str]]
|
The secret data. |
required |
secret_type
|
str
|
The secret type. |
'Opaque'
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The secret manifest. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|
build_service_account_manifest(name: str, namespace: str = 'default') -> Dict[str, Any]
Build the manifest for a service account.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the service account. |
required |
namespace
|
str
|
Kubernetes namespace. Defaults to "default". |
'default'
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Manifest for a service account. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
|
job_template_manifest_from_job(job: k8s_client.V1Job) -> k8s_client.V1JobTemplateSpec
Build a Kubernetes job template manifest from a job.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job
|
V1Job
|
The job manifest to build the template from. |
required |
Returns:
Type | Description |
---|---|
V1JobTemplateSpec
|
The job template manifest. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
|
pod_template_manifest_from_pod(pod: k8s_client.V1Pod) -> k8s_client.V1PodTemplateSpec
Build a Kubernetes pod template manifest from a pod.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod
|
V1Pod
|
The pod manifest to build the template from. |
required |
Returns:
Type | Description |
---|---|
V1PodTemplateSpec
|
The pod template manifest. |
Source code in src/zenml/integrations/kubernetes/orchestrators/manifest_utils.py
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
pod_settings
Kubernetes pod settings.
Classes
KubernetesPodSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Kubernetes Pod settings.
Attributes:
Name | Type | Description |
---|---|---|
node_selectors |
Dict[str, str]
|
Node selectors to apply to the pod. |
affinity |
Dict[str, Any]
|
Affinity to apply to the pod. |
tolerations |
List[Dict[str, Any]]
|
Tolerations to apply to the pod. |
resources |
Dict[str, Dict[str, str]]
|
Resource requests and limits for the pod. |
annotations |
Dict[str, str]
|
Annotations to apply to the pod metadata. |
volumes |
List[Dict[str, Any]]
|
Volumes to mount in the pod. |
volume_mounts |
List[Dict[str, Any]]
|
Volume mounts to apply to the pod containers. |
host_ipc |
bool
|
Whether to enable host IPC for the pod. |
scheduler_name |
Optional[str]
|
The name of the scheduler to use for the pod. |
image_pull_secrets |
List[str]
|
Image pull secrets to use for the pod. |
labels |
Dict[str, str]
|
Labels to apply to the pod. |
env |
List[Dict[str, Any]]
|
Environment variables to apply to the container. |
env_from |
List[Dict[str, Any]]
|
Environment variables to apply to the container. |
additional_pod_spec_args |
Dict[str, Any]
|
Additional arguments to pass to the pod. These will be applied to the pod spec. |
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
Functions
warn_if_invalid_model_data(data: Any, class_name: str) -> None
Validates the data of a Kubernetes model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Any
|
The data to validate. |
required |
class_name
|
str
|
Name of the class of the model. |
required |
Source code in src/zenml/integrations/kubernetes/pod_settings.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
Modules
serialization_utils
Kubernetes serialization utils.
Functions
deserialize_kubernetes_model(data: Dict[str, Any], class_name: str) -> Any
Deserializes a Kubernetes model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Dict[str, Any]
|
The model data. |
required |
class_name
|
str
|
Name of the Kubernetes model class. |
required |
Raises:
Type | Description |
---|---|
KeyError
|
If the data contains values for an invalid attribute. |
Returns:
Type | Description |
---|---|
Any
|
The deserialized model. |
Source code in src/zenml/integrations/kubernetes/serialization_utils.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
get_model_class(class_name: str) -> Type[Any]
Gets a Kubernetes model class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
class_name
|
str
|
Name of the class to get. |
required |
Raises:
Type | Description |
---|---|
TypeError
|
If no Kubernetes model class exists for this name. |
Returns:
Type | Description |
---|---|
Type[Any]
|
The model class. |
Source code in src/zenml/integrations/kubernetes/serialization_utils.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
is_model_class(class_name: str) -> bool
Checks whether the given class name is a Kubernetes model class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
class_name
|
str
|
Name of the class to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
If the given class name is a Kubernetes model class. |
Source code in src/zenml/integrations/kubernetes/serialization_utils.py
153 154 155 156 157 158 159 160 161 162 163 164 |
|
serialize_kubernetes_model(model: Any) -> Dict[str, Any]
Serializes a Kubernetes model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Any
|
The model to serialize. |
required |
Raises:
Type | Description |
---|---|
TypeError
|
If the model is not a Kubernetes model. |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The serialized model. |
Source code in src/zenml/integrations/kubernetes/serialization_utils.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
service_connectors
Kubernetes Service Connector.
Classes
KubernetesServiceConnector(**kwargs: Any)
Bases: ServiceConnector
Kubernetes service connector.
Source code in src/zenml/service_connectors/service_connector.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
Modules
kubernetes_service_connector
Kubernetes Service Connector.
The Kubernetes Service Connector implements various authentication methods for Kubernetes clusters.
KubernetesAuthenticationMethods
KubernetesBaseConfig
KubernetesServerConfig
KubernetesServerCredentials
KubernetesServiceConnector(**kwargs: Any)
Bases: ServiceConnector
Kubernetes service connector.
Source code in src/zenml/service_connectors/service_connector.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
KubernetesTokenConfig
KubernetesTokenCredentials
KubernetesUserPasswordConfig
KubernetesUserPasswordCredentials
step_operators
Kubernetes step operator.
Classes
KubernetesStepOperator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: BaseStepOperator
Step operator to run on Kubernetes.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: KubernetesStepOperatorConfig
property
Returns the KubernetesStepOperatorConfig
config.
Returns:
Type | Description |
---|---|
KubernetesStepOperatorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the Kubernetes step operator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Validates the stack.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
A validator that checks that the stack contains a remote container |
Optional[StackValidator]
|
registry and a remote artifact store. |
get_docker_builds(deployment: PipelineDeploymentBase) -> List[BuildConfiguration]
Gets the Docker builds required for the component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentBase
|
The pipeline deployment for which to get the builds. |
required |
Returns:
Type | Description |
---|---|
List[BuildConfiguration]
|
The required Docker builds. |
Source code in src/zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
get_kube_client() -> k8s_client.ApiClient
Get the Kubernetes API client.
Returns:
Type | Description |
---|---|
ApiClient
|
The Kubernetes API client. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the service connector returns an unexpected client. |
Source code in src/zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
launch(info: StepRunInfo, entrypoint_command: List[str], environment: Dict[str, str]) -> None
Launches a step on Kubernetes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
info
|
StepRunInfo
|
Information about the step run. |
required |
entrypoint_command
|
List[str]
|
Command that executes the step. |
required |
environment
|
Dict[str, str]
|
Environment variables to set in the step operator environment. |
required |
Source code in src/zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
Modules
kubernetes_step_operator
Kubernetes step operator implementation.
KubernetesStepOperator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: BaseStepOperator
Step operator to run on Kubernetes.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: KubernetesStepOperatorConfig
property
Returns the KubernetesStepOperatorConfig
config.
Returns:
Type | Description |
---|---|
KubernetesStepOperatorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the Kubernetes step operator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Validates the stack.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
A validator that checks that the stack contains a remote container |
Optional[StackValidator]
|
registry and a remote artifact store. |
get_docker_builds(deployment: PipelineDeploymentBase) -> List[BuildConfiguration]
Gets the Docker builds required for the component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentBase
|
The pipeline deployment for which to get the builds. |
required |
Returns:
Type | Description |
---|---|
List[BuildConfiguration]
|
The required Docker builds. |
Source code in src/zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
get_kube_client() -> k8s_client.ApiClient
Get the Kubernetes API client.
Returns:
Type | Description |
---|---|
ApiClient
|
The Kubernetes API client. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the service connector returns an unexpected client. |
Source code in src/zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
launch(info: StepRunInfo, entrypoint_command: List[str], environment: Dict[str, str]) -> None
Launches a step on Kubernetes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
info
|
StepRunInfo
|
Information about the step run. |
required |
entrypoint_command
|
List[str]
|
Command that executes the step. |
required |
environment
|
Dict[str, str]
|
Environment variables to set in the step operator environment. |
required |
Source code in src/zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|