anyscale_provider.hooks package#

Submodules#

anyscale_provider.hooks.anyscale module#

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

Bases: BaseHook

This hook handles authenticating and making calls to the Anyscale SDK

Parameters:

conn_id – Optional. The connection ID to use for Anyscale. Defaults to “anyscale_default”.

property client: Anyscale#
conn_name_attr = 'conn_id'#
conn_type = 'anyscale'#
default_conn_name = 'anyscale_default'#
deploy_service(config: ServiceConfig, in_place: bool = False, canary_percent: int | None = None, max_surge_percent: int | None = None) str#

Deploy a service to Anyscale.

Parameters:
  • config – Required. Configuration dictionary for the service.

  • in_place – Optional. Whether to perform an in-place update. Defaults to False.

  • canary_percent – Optional. Canary percentage for deployment.

  • max_surge_percent – Optional. Maximum surge percentage for deployment.

get_job_logs(job_id: str, run: str | None = None) str#

Fetch the logs for a job.

Parameters:

job_id – Required. The ID of the job.

get_job_status(job_id: str) JobStatus#

Fetch the status of a job.

Parameters:

job_id – The ID of the job.

get_service_status(service_name: str) ServiceStatus#

Fetch the status of a service.

Parameters:

service_name – The name of the service.

classmethod get_ui_field_behaviour() dict[str, Any]#

Return custom field behaviour for the connection form in the UI.

hook_name = 'Anyscale'#
submit_job(config: JobConfig) str#

Submit a job to Anyscale.

Parameters:

config – Required. Configuration dictionary for the job.

terminate_job(job_id: str, time_delay: int) bool#

Terminate a running job.

Parameters:
  • job_id – The ID of the job.

  • time_delay

terminate_service(service_name: str, time_delay: int) bool#

Terminate a running service.

Parameters:
  • service_name – The name of the service.

  • time_delay

Module contents#