Skypilot Kubernetes
zenml.integrations.skypilot_kubernetes
special
Initialization of the Skypilot Kubernetes integration for ZenML.
The Skypilot integration sub-module powers an alternative to the local orchestrator for a remote orchestration of ZenML pipelines on VMs.
SkypilotKubernetesIntegration (Integration)
Definition of Skypilot Kubernetes Integration for ZenML.
Source code in zenml/integrations/skypilot_kubernetes/__init__.py
class SkypilotKubernetesIntegration(Integration):
"""Definition of Skypilot Kubernetes Integration for ZenML."""
NAME = SKYPILOT_KUBERNETES
# all 0.6.x versions of skypilot[kubernetes] are compatible
REQUIREMENTS = ["skypilot[kubernetes]~=0.6.1"]
APT_PACKAGES = ["openssh-client", "rsync"]
@classmethod
def flavors(cls) -> List[Type[Flavor]]:
"""Declare the stack component flavors for the Skypilot Kubernetes integration.
Returns:
List of stack component flavors for this integration.
"""
from zenml.integrations.skypilot_kubernetes.flavors import (
SkypilotKubernetesOrchestratorFlavor,
)
return [SkypilotKubernetesOrchestratorFlavor]
flavors()
classmethod
Declare the stack component flavors for the Skypilot Kubernetes integration.
Returns:
Type | Description |
---|---|
List[Type[zenml.stack.flavor.Flavor]] |
List of stack component flavors for this integration. |
Source code in zenml/integrations/skypilot_kubernetes/__init__.py
@classmethod
def flavors(cls) -> List[Type[Flavor]]:
"""Declare the stack component flavors for the Skypilot Kubernetes integration.
Returns:
List of stack component flavors for this integration.
"""
from zenml.integrations.skypilot_kubernetes.flavors import (
SkypilotKubernetesOrchestratorFlavor,
)
return [SkypilotKubernetesOrchestratorFlavor]
flavors
special
Skypilot integration flavor for Skypilot Kubernetes orchestrator.
skypilot_orchestrator_kubernetes_vm_flavor
Skypilot orchestrator Kubernetes flavor.
SkypilotKubernetesOrchestratorConfig (SkypilotBaseOrchestratorConfig, SkypilotKubernetesOrchestratorSettings)
Skypilot orchestrator config.
Source code in zenml/integrations/skypilot_kubernetes/flavors/skypilot_orchestrator_kubernetes_vm_flavor.py
class SkypilotKubernetesOrchestratorConfig(
SkypilotBaseOrchestratorConfig, SkypilotKubernetesOrchestratorSettings
):
"""Skypilot orchestrator config."""
SkypilotKubernetesOrchestratorFlavor (BaseOrchestratorFlavor)
Flavor for the Skypilot Kubernetes orchestrator.
Source code in zenml/integrations/skypilot_kubernetes/flavors/skypilot_orchestrator_kubernetes_vm_flavor.py
class SkypilotKubernetesOrchestratorFlavor(BaseOrchestratorFlavor):
"""Flavor for the Skypilot Kubernetes orchestrator."""
@property
def name(self) -> str:
"""Name of the orchestrator flavor.
Returns:
Name of the orchestrator flavor.
"""
return SKYPILOT_KUBERNETES_ORCHESTRATOR_FLAVOR
@property
def service_connector_requirements(
self,
) -> Optional[ServiceConnectorRequirements]:
"""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:
Requirements for compatible service connectors, if a service
connector is required for this flavor.
"""
return ServiceConnectorRequirements(
resource_type=KUBERNETES_CLUSTER_RESOURCE_TYPE,
)
@property
def docs_url(self) -> Optional[str]:
"""A url to point at docs explaining this flavor.
Returns:
A flavor docs url.
"""
return self.generate_default_docs_url()
@property
def sdk_docs_url(self) -> Optional[str]:
"""A url to point at SDK docs explaining this flavor.
Returns:
A flavor SDK docs url.
"""
return self.generate_default_sdk_docs_url()
@property
def logo_url(self) -> str:
"""A url to represent the flavor in the dashboard.
Returns:
The flavor logo.
"""
return "https://public-flavor-logos.s3.eu-central-1.amazonaws.com/orchestrator/kubernetes-skypilot.png"
@property
def config_class(self) -> Type[BaseOrchestratorConfig]:
"""Config class for the base orchestrator flavor.
Returns:
The config class.
"""
return SkypilotKubernetesOrchestratorConfig
@property
def implementation_class(self) -> Type["SkypilotKubernetesOrchestrator"]:
"""Implementation class for this flavor.
Returns:
Implementation class for this flavor.
"""
from zenml.integrations.skypilot_kubernetes.orchestrators import (
SkypilotKubernetesOrchestrator,
)
return SkypilotKubernetesOrchestrator
config_class: Type[zenml.orchestrators.base_orchestrator.BaseOrchestratorConfig]
property
readonly
Config class for the base orchestrator flavor.
Returns:
Type | Description |
---|---|
Type[zenml.orchestrators.base_orchestrator.BaseOrchestratorConfig] |
The config class. |
docs_url: Optional[str]
property
readonly
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str] |
A flavor docs url. |
implementation_class: Type[SkypilotKubernetesOrchestrator]
property
readonly
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[SkypilotKubernetesOrchestrator] |
Implementation class for this flavor. |
logo_url: str
property
readonly
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str |
The flavor logo. |
name: str
property
readonly
Name of the orchestrator flavor.
Returns:
Type | Description |
---|---|
str |
Name of the orchestrator flavor. |
sdk_docs_url: Optional[str]
property
readonly
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str] |
A flavor SDK docs url. |
service_connector_requirements: Optional[zenml.models.v2.misc.service_connector_type.ServiceConnectorRequirements]
property
readonly
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[zenml.models.v2.misc.service_connector_type.ServiceConnectorRequirements] |
Requirements for compatible service connectors, if a service connector is required for this flavor. |
SkypilotKubernetesOrchestratorSettings (SkypilotBaseOrchestratorSettings)
Skypilot orchestrator settings.
Source code in zenml/integrations/skypilot_kubernetes/flavors/skypilot_orchestrator_kubernetes_vm_flavor.py
class SkypilotKubernetesOrchestratorSettings(SkypilotBaseOrchestratorSettings):
"""Skypilot orchestrator settings."""
orchestrators
special
Initialization of the Skypilot Kubernetes ZenML orchestrator.
skypilot_kubernetes_vm_orchestrator
Implementation of the a Skypilot based Kubernetes VM orchestrator.
SkypilotKubernetesOrchestrator (SkypilotBaseOrchestrator)
Orchestrator responsible for running pipelines remotely in a VM on Kubernetes.
This orchestrator does not support running on a schedule.
Source code in zenml/integrations/skypilot_kubernetes/orchestrators/skypilot_kubernetes_vm_orchestrator.py
class SkypilotKubernetesOrchestrator(SkypilotBaseOrchestrator):
"""Orchestrator responsible for running pipelines remotely in a VM on Kubernetes.
This orchestrator does not support running on a schedule.
"""
@property
def cloud(self) -> sky.clouds.Cloud:
"""The type of sky cloud to use.
Returns:
A `sky.clouds.Cloud` instance.
"""
return sky.clouds.Kubernetes()
@property
def config(self) -> SkypilotKubernetesOrchestratorConfig:
"""Returns the `SkypilotKubernetesOrchestratorConfig` config.
Returns:
The configuration.
"""
return cast(SkypilotKubernetesOrchestratorConfig, self._config)
@property
def settings_class(self) -> Optional[Type["BaseSettings"]]:
"""Settings class for the Skypilot orchestrator.
Returns:
The settings class.
"""
return SkypilotKubernetesOrchestratorSettings
def prepare_environment_variable(self, set: bool = True) -> None:
"""Set up Environment variables that are required for the orchestrator.
Args:
set: Whether to set the environment variables or not.
"""
pass
cloud: sky.clouds.Cloud
property
readonly
The type of sky cloud to use.
Returns:
Type | Description |
---|---|
sky.clouds.Cloud |
A |
config: SkypilotKubernetesOrchestratorConfig
property
readonly
Returns the SkypilotKubernetesOrchestratorConfig
config.
Returns:
Type | Description |
---|---|
SkypilotKubernetesOrchestratorConfig |
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
readonly
Settings class for the Skypilot orchestrator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]] |
The settings class. |
prepare_environment_variable(self, set=True)
Set up Environment variables that are required for the orchestrator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
set |
bool |
Whether to set the environment variables or not. |
True |
Source code in zenml/integrations/skypilot_kubernetes/orchestrators/skypilot_kubernetes_vm_orchestrator.py
def prepare_environment_variable(self, set: bool = True) -> None:
"""Set up Environment variables that are required for the orchestrator.
Args:
set: Whether to set the environment variables or not.
"""
pass