anyscale_provider.triggers package#

Submodules#

anyscale_provider.triggers.anyscale module#

class AnyscaleJobTrigger(*args: Any, **kwargs: Any)#

Bases: BaseTrigger

Triggers and monitors the status of a job submitted to Anyscale.

This trigger periodically checks the status of a submitted job on Anyscale and yields events based on the job’s status. It handles timeouts and errors during the polling process.

Parameters:
  • conn_id – Required. The connection ID for Anyscale.

  • job_id – Required. The ID of the job to monitor.

  • poll_interval – Optional. Interval in seconds between status checks. Defaults to 60 seconds.

hook() AnyscaleHook#

Return an instance of the AnyscaleHook.

Returns:

AnyscaleHook instance configured with the provided connection ID.

async run() AsyncIterator[airflow.triggers.base.TriggerEvent]#

Monitor the job status periodically until a terminal state is reached or an error occurs.

Yield:

TriggerEvent indicating the current status of the job.

serialize() tuple[str, dict[str, Any]]#

Serialize the trigger configuration for persistence.

Returns:

A tuple containing the path to the trigger class and a dictionary of the trigger’s parameters.

class AnyscaleServiceTrigger(*args: Any, **kwargs: Any)#

Bases: BaseTrigger

Triggers and monitors the status of a service deployment on Anyscale.

This trigger periodically checks the status of a service deployment on Anyscale and yields events based on the service’s status. It handles timeouts and errors during the monitoring process.

Parameters:
  • conn_id – Required. The connection ID for Anyscale.

  • service_name – Required. The ID of the service to monitor.

  • expected_state – Required. The expected final state of the service.

  • poll_interval – Optional. Interval in seconds between status checks. Defaults to 60 seconds.

hook() AnyscaleHook#

Return an instance of the AnyscaleHook.

Returns:

AnyscaleHook instance configured with the provided connection ID.

async run() AsyncIterator[airflow.triggers.base.TriggerEvent]#

Monitor the service status periodically until the expected state is reached or an error occurs.

Yield:

TriggerEvent indicating the current status of the service.

serialize() tuple[str, dict[str, Any]]#

Serialize the trigger configuration for persistence.

Returns:

A tuple containing the path to the trigger class and a dictionary of the trigger’s parameters.

Module contents#