airflow.providers.google.cloud.triggers.vertex_ai

Module Contents

Classes

BaseVertexAIJobTrigger

Base class for Vertex AI job triggers.

CreateHyperparameterTuningJobTrigger

CreateHyperparameterTuningJobTrigger run on the trigger worker to perform create operation.

CreateBatchPredictionJobTrigger

CreateBatchPredictionJobTrigger run on the trigger worker to perform create operation.

RunPipelineJobTrigger

Make async calls to Vertex AI to check the state of a Pipeline Job.

CustomTrainingJobTrigger

Make async calls to Vertex AI to check the state of a running custom training job.

CustomContainerTrainingJobTrigger

Make async calls to Vertex AI to check the state of a running custom container training job.

CustomPythonPackageTrainingJobTrigger

Make async calls to Vertex AI to check the state of a running custom python package training job.

class airflow.providers.google.cloud.triggers.vertex_ai.BaseVertexAIJobTrigger(conn_id, project_id, location, job_id, poll_interval, impersonation_chain=None)[source]

Bases: airflow.triggers.base.BaseTrigger

Base class for Vertex AI job triggers.

This trigger polls the Vertex AI job and checks its status.

In order to use it properly, you must: - implement the following methods _wait_job(). - override required job_type_verbose_name attribute to provide meaningful message describing your job type. - override required job_serializer_class attribute to provide proto.Message class that will be used to serialize your job with to_dict() class method.

job_type_verbose_name: str = 'Vertex AI Job'[source]
job_serializer_class: proto.Message[source]
statuses_success[source]
serialize()[source]

Return the information needed to reconstruct this Trigger.

Returns

Tuple of (class path, keyword arguments needed to re-instantiate).

Return type

tuple[str, dict[str, Any]]

async run()[source]

Run the trigger in an asynchronous context.

The trigger should yield an Event whenever it wants to fire off an event, and return None if it is finished. Single-event triggers should thus yield and then immediately return.

If it yields, it is likely that it will be resumed very quickly, but it may not be (e.g. if the workload is being moved to another triggerer process, or a multi-event trigger was being used for a single-event task defer).

In either case, Trigger classes should assume they will be persisted, and then rely on cleanup() being called when they are no longer needed.

class airflow.providers.google.cloud.triggers.vertex_ai.CreateHyperparameterTuningJobTrigger(conn_id, project_id, location, job_id, poll_interval, impersonation_chain=None)[source]

Bases: BaseVertexAIJobTrigger

CreateHyperparameterTuningJobTrigger run on the trigger worker to perform create operation.

job_type_verbose_name = 'Hyperparameter Tuning Job'[source]
job_serializer_class[source]
async_hook()[source]
class airflow.providers.google.cloud.triggers.vertex_ai.CreateBatchPredictionJobTrigger(conn_id, project_id, location, job_id, poll_interval, impersonation_chain=None)[source]

Bases: BaseVertexAIJobTrigger

CreateBatchPredictionJobTrigger run on the trigger worker to perform create operation.

job_type_verbose_name = 'Batch Prediction Job'[source]
job_serializer_class[source]
async_hook()[source]
class airflow.providers.google.cloud.triggers.vertex_ai.RunPipelineJobTrigger(conn_id, project_id, location, job_id, poll_interval, impersonation_chain=None)[source]

Bases: BaseVertexAIJobTrigger

Make async calls to Vertex AI to check the state of a Pipeline Job.

job_type_verbose_name = 'Pipeline Job'[source]
job_serializer_class[source]
statuses_success[source]
async_hook()[source]
class airflow.providers.google.cloud.triggers.vertex_ai.CustomTrainingJobTrigger(conn_id, project_id, location, job_id, poll_interval, impersonation_chain=None)[source]

Bases: BaseVertexAIJobTrigger

Make async calls to Vertex AI to check the state of a running custom training job.

Return the job when it enters a completed state.

job_type_verbose_name = 'Custom Training Job'[source]
job_serializer_class[source]
statuses_success[source]
async_hook()[source]
class airflow.providers.google.cloud.triggers.vertex_ai.CustomContainerTrainingJobTrigger(conn_id, project_id, location, job_id, poll_interval, impersonation_chain=None)[source]

Bases: BaseVertexAIJobTrigger

Make async calls to Vertex AI to check the state of a running custom container training job.

Return the job when it enters a completed state.

job_type_verbose_name = 'Custom Container Training Job'[source]
job_serializer_class[source]
statuses_success[source]
async_hook()[source]
class airflow.providers.google.cloud.triggers.vertex_ai.CustomPythonPackageTrainingJobTrigger(conn_id, project_id, location, job_id, poll_interval, impersonation_chain=None)[source]

Bases: BaseVertexAIJobTrigger

Make async calls to Vertex AI to check the state of a running custom python package training job.

Return the job when it enters a completed state.

job_type_verbose_name = 'Custom Python Package Training Job'[source]
job_serializer_class[source]
statuses_success[source]
async_hook()[source]

Was this entry helpful?