airflow.providers.amazon.aws.triggers.sagemaker¶
Classes¶
SageMakerTrigger is fired as deferred class with params to run the task in triggerer. |
|
Trigger to wait for a sagemaker pipeline execution to finish. |
Module Contents¶
- class airflow.providers.amazon.aws.triggers.sagemaker.SageMakerTrigger(job_name, job_type, waiter_delay=30, waiter_max_attempts=480, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None, poke_interval=None, max_attempts=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerSageMakerTrigger is fired as deferred class with params to run the task in triggerer.
- Parameters:
job_name (str) – name of the job to check status
job_type (str) – Type of the sagemaker job whether it is Transform or Training
waiter_delay (int) – polling period in seconds to check for the status
waiter_max_attempts (int) – The maximum number of attempts to be made.
aws_conn_id (str | None) – AWS connection ID for sagemaker
region_name (str | None) – The AWS region where the job is running. Used to build the hook.
verify (bool | str | None) – Whether or not to verify SSL certificates. Used to build the hook.
botocore_config (dict | None) – Configuration dictionary for the botocore client. Used to build the hook.
poke_interval (int | None) – (deprecated) use
waiter_delayinstead.max_attempts (int | None) – (deprecated) use
waiter_max_attemptsinstead.
- class airflow.providers.amazon.aws.triggers.sagemaker.SageMakerPipelineTrigger(waiter_type, pipeline_execution_arn, waiter_delay, waiter_max_attempts, aws_conn_id, region_name=None, verify=None, botocore_config=None)[source]¶
Bases:
airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTriggerTrigger to wait for a sagemaker pipeline execution to finish.
- Parameters:
waiter_type (Type | int) – Type of waiter to use, see
Typeenum.pipeline_execution_arn (str) – ARN of the pipeline execution to wait for.
waiter_delay (int) – The amount of time in seconds to wait between attempts.
waiter_max_attempts (int) – The maximum number of attempts to be made.
aws_conn_id (str | None) – The Airflow connection used for AWS credentials.
region_name (str | None) – The AWS region where the pipeline runs. Used to build the hook.
verify (bool | str | None) – Whether or not to verify SSL certificates. Used to build the hook.
botocore_config (dict | None) – Configuration dictionary for the botocore client. Used to build the hook.
- class Type[source]¶
Bases:
enum.IntEnumType of waiter to use.
- 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.