:py:mod:`astronomer.providers.amazon.aws.triggers.sagemaker` ============================================================ .. py:module:: astronomer.providers.amazon.aws.triggers.sagemaker Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.amazon.aws.triggers.sagemaker.SagemakerProcessingTrigger astronomer.providers.amazon.aws.triggers.sagemaker.SagemakerTrigger astronomer.providers.amazon.aws.triggers.sagemaker.SagemakerTrainingWithLogTrigger .. py:class:: SagemakerProcessingTrigger(job_name, poll_interval, end_time, aws_conn_id = 'aws_default') Bases: :py:obj:`airflow.triggers.base.BaseTrigger` SagemakerProcessingTrigger is fired as deferred class with params to run the task in triggerer. :param job_name: name of the job to check status :param poll_interval: polling period in seconds to check for the status :param aws_conn_id: AWS connection ID for sagemaker :param end_time: the end time in seconds. Any SageMaker jobs that run longer than this will fail. .. py:attribute:: NON_TERMINAL_STATES :annotation: = ['InProgress', 'Stopping'] .. py:attribute:: TERMINAL_STATE :annotation: = ['Failed'] .. py:method:: serialize() Serializes SagemakerProcessingTrigger arguments and classpath. .. py:method:: run() :async: Makes async connection to sagemaker async hook and gets job status for a job submitted by the operator. Trigger returns a failure event if any error and success in state return the success event. .. py:class:: SagemakerTrigger(job_name, job_type, response_key, poke_interval, end_time = None, aws_conn_id = 'aws_default') Bases: :py:obj:`airflow.triggers.base.BaseTrigger` SagemakerTrigger is common trigger for both transform and training sagemaker job and it is fired as deferred class with params to run the task in triggerer. :param job_name: name of the job to check status :param job_type: Type of the sagemaker job whether it is Transform or Training :param response_key: The key which needs to be look in the response. :param poke_interval: polling period in seconds to check for the status :param end_time: Time in seconds to wait for a job run to reach a terminal status. :param aws_conn_id: AWS connection ID for sagemaker .. py:attribute:: NON_TERMINAL_STATES :annotation: = ['InProgress', 'Stopping', 'Stopped'] .. py:attribute:: TERMINAL_STATE :annotation: = ['Failed'] .. py:method:: serialize() Serializes SagemakerTrigger arguments and classpath. .. py:method:: run() :async: Makes async connection to sagemaker async hook and gets job status for a job submitted by the operator. Trigger returns a failure event if any error and success in state return the success event. .. py:method:: get_job_status(hook, job_name, job_type) :staticmethod: :async: Based on the job type the SageMakerHookAsync connect to sagemaker related function and get the response of the job and return it .. py:class:: SagemakerTrainingWithLogTrigger(job_name, instance_count, status, poke_interval, end_time = None, aws_conn_id = 'aws_default') Bases: :py:obj:`airflow.triggers.base.BaseTrigger` SagemakerTrainingWithLogTrigger is fired as deferred class with params to run the task in triggerer. :param job_name: name of the job to check status :param instance_count: count of the instance created for running the training job :param status: The status of the training job created. :param poke_interval: polling period in seconds to check for the status :param end_time: Time in seconds to wait for a job run to reach a terminal status. :param aws_conn_id: AWS connection ID for sagemaker .. py:attribute:: NON_TERMINAL_STATES :annotation: = ['InProgress', 'Stopping', 'Stopped'] .. py:attribute:: TERMINAL_STATE :annotation: = ['Failed'] .. py:method:: serialize() Serializes SagemakerTrainingWithLogTrigger arguments and classpath. .. py:method:: run() :async: Makes async connection to sagemaker async hook and gets job status for a job submitted by the operator. Trigger returns a failure event if any error and success in state return the success event.