airflow.providers.amazon.aws.sensors.sagemaker

SageMakerBaseSensor

包含 SageMaker 的通用传感器行为。

SageMakerEndpointSensor

轮询端点状态直到达到最终状态;抛出 AirflowException 并附带失败原因。

SageMakerTransformSensor

轮询转换作业直到达到最终状态;抛出 AirflowException 并附带失败原因。

SageMakerTuningSensor

轮询调优状态直到达到最终状态;抛出 AirflowException 并附带失败原因。

SageMakerTrainingSensor

轮询训练作业直到达到最终状态;抛出 AirflowException 并附带失败原因。

SageMakerPipelineSensor

轮询流水线直到达到最终状态;抛出 AirflowException 并附带失败原因。

SageMakerAutoMLSensor

轮询 AutoML 作业直到达到最终状态;抛出 AirflowException 并附带失败原因。

SageMakerProcessingSensor

轮询处理作业直到达到最终状态;抛出 AirflowException 并附带失败原因。

模块内容

class airflow.providers.amazon.aws.sensors.sagemaker.SageMakerBaseSensor(*, aws_conn_id='aws_default', resource_type='job', **kwargs)[source]

基类: airflow.sensors.base.BaseSensorOperator

包含 SageMaker 的通用传感器行为。

子类应该实现 get_sagemaker_response() 和 state_from_response() 方法。子类也应该实现 non_terminal_states() 和 failed_states() 方法。

ui_color = '#ededed'[source]
aws_conn_id = 'aws_default'[source]
resource_type = 'job'[source]
property hook: airflow.providers.amazon.aws.hooks.sagemaker.SageMakerHook[source]
poke(context)[source]

派生此类时重写。

abstract non_terminal_states()[source]

返回不应终止的状态。

abstract failed_states()[source]

返回被认为是失败的状态。

abstract get_sagemaker_response()[source]

检查 SageMaker 任务的状态。

get_failed_reason_from_response(response)[source]

从 AWS 响应中提取失败原因。

abstract state_from_response(response)[source]

从 AWS 响应中提取状态。

class airflow.providers.amazon.aws.sensors.sagemaker.SageMakerEndpointSensor(*, endpoint_name, **kwargs)[source]

基类: SageMakerBaseSensor

轮询端点状态直到达到最终状态;抛出 AirflowException 并附带失败原因。

另请参阅

有关如何使用此传感器的更多信息,请参阅指南: 等待 Amazon SageMaker 端点状态

参数:

endpoint_name – 要监视的端点实例的名称。

template_fields: collections.abc.Sequence[str] = ('endpoint_name',)[source]
template_ext: collections.abc.Sequence[str] = ()[source]
endpoint_name[source]
non_terminal_states()[source]

返回不应终止的状态。

failed_states()[source]

返回被认为是失败的状态。

get_sagemaker_response()[source]

检查 SageMaker 任务的状态。

get_failed_reason_from_response(response)[source]

从 AWS 响应中提取失败原因。

state_from_response(response)[source]

从 AWS 响应中提取状态。

class airflow.providers.amazon.aws.sensors.sagemaker.SageMakerTransformSensor(*, job_name, **kwargs)[source]

基类: SageMakerBaseSensor

轮询转换作业直到达到最终状态;抛出 AirflowException 并附带失败原因。

另请参阅

有关如何使用此传感器的更多信息,请参阅指南: 等待 Amazon SageMaker 转换作业状态

参数:

job_name (str) – 要监视的转换作业的名称。

template_fields: collections.abc.Sequence[str] = ('job_name',)[source]
template_ext: collections.abc.Sequence[str] = ()[source]
job_name[source]
non_terminal_states()[source]

返回不应终止的状态。

failed_states()[source]

返回被认为是失败的状态。

get_sagemaker_response()[source]

检查 SageMaker 任务的状态。

get_failed_reason_from_response(response)[source]

从 AWS 响应中提取失败原因。

state_from_response(response)[source]

从 AWS 响应中提取状态。

class airflow.providers.amazon.aws.sensors.sagemaker.SageMakerTuningSensor(*, job_name, **kwargs)[source]

基类: SageMakerBaseSensor

轮询调优状态直到达到最终状态;抛出 AirflowException 并附带失败原因。

另请参阅

有关如何使用此传感器的更多信息,请参阅指南: 等待 Amazon SageMaker 调优作业状态

参数:

job_name (str) – 要监视的调优实例的名称。

template_fields: collections.abc.Sequence[str] = ('job_name',)[source]
template_ext: collections.abc.Sequence[str] =()[source]
job_name[source]
non_terminal_states()[source]

返回不应终止的状态。

failed_states()[source]

返回被认为是失败的状态。

get_sagemaker_response()[source]

检查 SageMaker 任务的状态。

get_failed_reason_from_response(response)[source]

从 AWS 响应中提取失败原因。

state_from_response(response)[source]

从 AWS 响应中提取状态。

class airflow.providers.amazon.aws.sensors.sagemaker.SageMakerTrainingSensor(*, job_name, print_log=True, **kwargs)[source]

基类: SageMakerBaseSensor

轮询训练作业直到达到最终状态;抛出 AirflowException 并附带失败原因。

另请参阅

有关如何使用此传感器的更多信息,请参阅指南: 等待 Amazon SageMaker 训练作业状态

参数:
  • job_name – 要监视的训练作业的名称。

  • print_log – 如果为 True 则打印 CloudWatch 日志;默认为 True。

template_fields: collections.abc.Sequence[str] = ('job_name',)[source]
template_ext: collections.abc.Sequence[str] =()[source]
job_name[source]
print_log = True[source]
positions[source]
stream_names = [][source]
instance_count: int | None = None[source]
state: int | None = None[source]
last_description = None[source]
last_describe_job_call = None[source]
log_resource_inited = False[source]
init_log_resource(hook)[源码]

设置相关训练作业的尾随日志状态。

non_terminal_states()[源码]

返回不应终止的状态。

failed_states()[源码]

返回被认为是失败的状态。

get_sagemaker_response()[源码]

检查 SageMaker 任务的状态。

get_failed_reason_from_response(response)[源码]

从 AWS 响应中提取失败原因。

state_from_response(response)[源码]

从 AWS 响应中提取状态。

class airflow.providers.amazon.aws.sensors.sagemaker.SageMakerPipelineSensor(*, pipeline_exec_arn, verbose=True, **kwargs)[源码]

基类: SageMakerBaseSensor

轮询流水线直到达到最终状态;抛出 AirflowException 并附带失败原因。

另请参阅

有关如何使用此传感器的更多信息,请参阅指南: 等待 Amazon SageMaker 流水线执行状态

参数:
  • pipeline_exec_arn (str) – 要观察的流水线的 ARN。

  • verbose (bool) – 等待完成时是否打印步骤详细信息。默认为 true,对于包含数千个步骤的流水线,请考虑关闭此选项。

template_fields: collections.abc.Sequence[str] = ('pipeline_exec_arn',)[源码]
pipeline_exec_arn[源码]
verbose = True[源码]
non_terminal_states()[源码]

返回不应终止的状态。

failed_states()[源码]

返回被认为是失败的状态。

get_sagemaker_response()[源码]

检查 SageMaker 任务的状态。

state_from_response(response)[源码]

从 AWS 响应中提取状态。

class airflow.providers.amazon.aws.sensors.sagemaker.SageMakerAutoMLSensor(*, job_name, **kwargs)[源码]

基类: SageMakerBaseSensor

轮询 AutoML 作业直到达到最终状态;抛出 AirflowException 并附带失败原因。

另请参阅

有关如何使用此传感器的更多信息,请参阅指南: 等待 Amazon SageMaker AutoML 实验状态

参数:

job_name (str) – 要观察的 AutoML 作业的唯一名称。

template_fields: collections.abc.Sequence[str] = ('job_name',)[源码]
job_name[源码]
non_terminal_states()[源码]

返回不应终止的状态。

failed_states()[源码]

返回被认为是失败的状态。

get_sagemaker_response()[源码]

检查 SageMaker 任务的状态。

state_from_response(response)[源码]

从 AWS 响应中提取状态。

class airflow.providers.amazon.aws.sensors.sagemaker.SageMakerProcessingSensor(*, job_name, **kwargs)[源码]

基类: SageMakerBaseSensor

轮询处理作业直到达到最终状态;抛出 AirflowException 并附带失败原因。

另请参阅

有关如何使用此传感器的更多信息,请参阅指南: 等待 Amazon SageMaker 处理作业状态

参数:

job_name (str) – 要观察的处理作业的名称。

template_fields: collections.abc.Sequence[str] = ('job_name',)[源码]
template_ext: collections.abc.Sequence[str] = ()[源码]
job_name[源码]
non_terminal_states()[源码]

返回不应终止的状态。

failed_states()[源码]

返回被认为是失败的状态。

get_sagemaker_response()[源码]

检查 SageMaker 任务的状态。

state_from_response(response)[源码]

从 AWS 响应中提取状态。

此条目是否有帮助?