Skypilot Gcp
zenml.integrations.skypilot_gcp
special
Initialization of the Skypilot GCP integration for ZenML.
The Skypilot integration sub-module powers an alternative to the local orchestrator for a remote orchestration of ZenML pipelines on VMs.
SkypilotGCPIntegration (Integration)
Definition of Skypilot (GCP) Integration for ZenML.
Source code in zenml/integrations/skypilot_gcp/__init__.py
class SkypilotGCPIntegration(Integration):
"""Definition of Skypilot (GCP) Integration for ZenML."""
NAME = SKYPILOT_GCP
REQUIREMENTS = ["skypilot[gcp]<=0.5.0"]
APT_PACKAGES = ["openssh-client", "rsync"]
@classmethod
def flavors(cls) -> List[Type[Flavor]]:
"""Declare the stack component flavors for the Skypilot GCP integration.
Returns:
List of stack component flavors for this integration.
"""
from zenml.integrations.skypilot_gcp.flavors import (
SkypilotGCPOrchestratorFlavor,
)
return [SkypilotGCPOrchestratorFlavor]
flavors()
classmethod
Declare the stack component flavors for the Skypilot GCP integration.
Returns:
Type | Description |
---|---|
List[Type[zenml.stack.flavor.Flavor]] |
List of stack component flavors for this integration. |
Source code in zenml/integrations/skypilot_gcp/__init__.py
@classmethod
def flavors(cls) -> List[Type[Flavor]]:
"""Declare the stack component flavors for the Skypilot GCP integration.
Returns:
List of stack component flavors for this integration.
"""
from zenml.integrations.skypilot_gcp.flavors import (
SkypilotGCPOrchestratorFlavor,
)
return [SkypilotGCPOrchestratorFlavor]
flavors
special
Skypilot integration flavor for Skypilot GCP orchestrator.
skypilot_orchestrator_gcp_vm_flavor
Skypilot orchestrator GCP flavor.
SkypilotGCPOrchestratorConfig (SkypilotBaseOrchestratorConfig, GoogleCredentialsConfigMixin, SkypilotGCPOrchestratorSettings)
Skypilot orchestrator config for GCP.
Source code in zenml/integrations/skypilot_gcp/flavors/skypilot_orchestrator_gcp_vm_flavor.py
class SkypilotGCPOrchestratorConfig(
SkypilotBaseOrchestratorConfig,
GoogleCredentialsConfigMixin,
SkypilotGCPOrchestratorSettings,
):
"""Skypilot orchestrator config for GCP."""
SkypilotGCPOrchestratorFlavor (BaseOrchestratorFlavor)
Flavor for the Skypilot orchestrator for GCP.
Source code in zenml/integrations/skypilot_gcp/flavors/skypilot_orchestrator_gcp_vm_flavor.py
class SkypilotGCPOrchestratorFlavor(BaseOrchestratorFlavor):
"""Flavor for the Skypilot orchestrator for GCP."""
@property
def name(self) -> str:
"""Name of the orchestrator flavor.
Returns:
Name of the orchestrator flavor.
"""
return SKYPILOT_GCP_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="gcp-generic",
)
@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/gcp-skypilot.png"
@property
def config_class(self) -> Type[BaseOrchestratorConfig]:
"""Config class for the base orchestrator flavor.
Returns:
The config class.
"""
return SkypilotGCPOrchestratorConfig
@property
def implementation_class(self) -> Type["SkypilotGCPOrchestrator"]:
"""Implementation class for this flavor.
Returns:
Implementation class for this flavor.
"""
from zenml.integrations.skypilot_gcp.orchestrators import (
SkypilotGCPOrchestrator,
)
return SkypilotGCPOrchestrator
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[SkypilotGCPOrchestrator]
property
readonly
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[SkypilotGCPOrchestrator] |
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. |
SkypilotGCPOrchestratorSettings (SkypilotBaseOrchestratorSettings)
Skypilot orchestrator settings for GCP.
Source code in zenml/integrations/skypilot_gcp/flavors/skypilot_orchestrator_gcp_vm_flavor.py
class SkypilotGCPOrchestratorSettings(SkypilotBaseOrchestratorSettings):
"""Skypilot orchestrator settings for GCP."""
orchestrators
special
Initialization of the Skypilot GCP ZenML orchestrator.
skypilot_gcp_vm_orchestrator
Implementation of the a Skypilot-based GCP VM orchestrator.
SkypilotGCPOrchestrator (SkypilotBaseOrchestrator, GoogleCredentialsMixin)
Orchestrator responsible for running pipelines remotely in a VM on GCP.
This orchestrator does not support running on a schedule.
Source code in zenml/integrations/skypilot_gcp/orchestrators/skypilot_gcp_vm_orchestrator.py
class SkypilotGCPOrchestrator(
SkypilotBaseOrchestrator, GoogleCredentialsMixin
):
"""Orchestrator responsible for running pipelines remotely in a VM on GCP.
This orchestrator does not support running on a schedule.
"""
DEFAULT_INSTANCE_TYPE: str = "n1-standard-4"
@property
def cloud(self) -> sky.clouds.Cloud:
"""The type of sky cloud to use.
Returns:
A `sky.clouds.Cloud` instance.
"""
return sky.clouds.GCP()
@property
def config(self) -> SkypilotGCPOrchestratorConfig:
"""Returns the `SkypilotGCPOrchestratorConfig` config.
Returns:
The configuration.
"""
return cast(SkypilotGCPOrchestratorConfig, self._config)
@property
def settings_class(self) -> Optional[Type["BaseSettings"]]:
"""Settings class for the Skypilot orchestrator.
Returns:
The settings class.
"""
return SkypilotGCPOrchestratorSettings
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: SkypilotGCPOrchestratorConfig
property
readonly
Returns the SkypilotGCPOrchestratorConfig
config.
Returns:
Type | Description |
---|---|
SkypilotGCPOrchestratorConfig |
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_gcp/orchestrators/skypilot_gcp_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