diff --git a/components/aws/sagemaker/Changelog.md b/components/aws/sagemaker/Changelog.md index 55ac00b715..72f6800d37 100644 --- a/components/aws/sagemaker/Changelog.md +++ b/components/aws/sagemaker/Changelog.md @@ -4,6 +4,11 @@ The version of the AWS SageMaker Components is determined by the docker image ta Repository: https://hub.docker.com/repository/docker/amazon/aws-sagemaker-kfp-components --------------------------------------------- +**Change log for version 1.1.1** +- Print logs for Batch Transform and Processing jobs. + +> Pull requests : [#4879](https://github.com/kubeflow/pipelines/pull/4879) + **Change log for version 1.1.0** - Add SageMaker RLEstimator component - Add RoboMaker create/delete simulation application, cerate simulation job components diff --git a/components/aws/sagemaker/THIRD-PARTY-LICENSES.txt b/components/aws/sagemaker/THIRD-PARTY-LICENSES.txt index 6df2346b8c..732465e20e 100644 --- a/components/aws/sagemaker/THIRD-PARTY-LICENSES.txt +++ b/components/aws/sagemaker/THIRD-PARTY-LICENSES.txt @@ -1,4 +1,4 @@ -** Amazon SageMaker Components for Kubeflow Pipelines; version 1.1.0 -- +** Amazon SageMaker Components for Kubeflow Pipelines; version 1.1.1 -- https://github.com/kubeflow/pipelines/tree/master/components/aws/sagemaker Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. ** boto3; version 1.14.12 -- https://github.com/boto/boto3/ diff --git a/components/aws/sagemaker/batch_transform/component.yaml b/components/aws/sagemaker/batch_transform/component.yaml index 790292b98b..18b939ff31 100644 --- a/components/aws/sagemaker/batch_transform/component.yaml +++ b/components/aws/sagemaker/batch_transform/component.yaml @@ -56,7 +56,7 @@ outputs: - {name: output_location, description: S3 URI of the transform job results.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - batch_transform/src/sagemaker_transform_component.py diff --git a/components/aws/sagemaker/batch_transform/src/sagemaker_transform_component.py b/components/aws/sagemaker/batch_transform/src/sagemaker_transform_component.py index 7e4c487ffd..756f72a848 100644 --- a/components/aws/sagemaker/batch_transform/src/sagemaker_transform_component.py +++ b/components/aws/sagemaker/batch_transform/src/sagemaker_transform_component.py @@ -160,6 +160,11 @@ class SageMakerTransformComponent(SageMakerComponent): ) ) + def _print_logs_for_job(self): + self._print_cloudwatch_logs( + "/aws/sagemaker/TransformJobs", self._transform_job_name + ) + if __name__ == "__main__": import sys diff --git a/components/aws/sagemaker/create_simulation_app/component.yaml b/components/aws/sagemaker/create_simulation_app/component.yaml index c13025f5c6..c5089ee555 100644 --- a/components/aws/sagemaker/create_simulation_app/component.yaml +++ b/components/aws/sagemaker/create_simulation_app/component.yaml @@ -31,7 +31,7 @@ outputs: - {name: revision_id, description: The revision id of the simulation application.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - create_simulation_app/src/robomaker_create_simulation_app_component.py diff --git a/components/aws/sagemaker/delete_simulation_app/component.yaml b/components/aws/sagemaker/delete_simulation_app/component.yaml index d48012fa8e..2a63caad86 100644 --- a/components/aws/sagemaker/delete_simulation_app/component.yaml +++ b/components/aws/sagemaker/delete_simulation_app/component.yaml @@ -16,7 +16,7 @@ outputs: - {name: arn, description: The Amazon Resource Name (ARN) of the simulation application.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - delete_simulation_app/src/robomaker_delete_simulation_app_component.py diff --git a/components/aws/sagemaker/deploy/component.yaml b/components/aws/sagemaker/deploy/component.yaml index 813b9668d7..7dc83eab0f 100644 --- a/components/aws/sagemaker/deploy/component.yaml +++ b/components/aws/sagemaker/deploy/component.yaml @@ -64,7 +64,7 @@ outputs: - {name: endpoint_name, description: The created endpoint name.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - deploy/src/sagemaker_deploy_component.py diff --git a/components/aws/sagemaker/ground_truth/component.yaml b/components/aws/sagemaker/ground_truth/component.yaml index 4c9466d9fe..2e241aa36f 100644 --- a/components/aws/sagemaker/ground_truth/component.yaml +++ b/components/aws/sagemaker/ground_truth/component.yaml @@ -79,7 +79,7 @@ outputs: SageMaker model trained as part of automated data labeling.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - ground_truth/src/sagemaker_ground_truth_component.py diff --git a/components/aws/sagemaker/hyperparameter_tuning/component.yaml b/components/aws/sagemaker/hyperparameter_tuning/component.yaml index e86a29a38f..b714f4ca9f 100644 --- a/components/aws/sagemaker/hyperparameter_tuning/component.yaml +++ b/components/aws/sagemaker/hyperparameter_tuning/component.yaml @@ -98,7 +98,7 @@ outputs: the training algorithm.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - hyperparameter_tuning/src/sagemaker_tuning_component.py diff --git a/components/aws/sagemaker/model/component.yaml b/components/aws/sagemaker/model/component.yaml index c3c7c69176..ce6c4ed3c5 100644 --- a/components/aws/sagemaker/model/component.yaml +++ b/components/aws/sagemaker/model/component.yaml @@ -37,7 +37,7 @@ outputs: - {name: model_name, description: The name of the model created by SageMaker.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - model/src/sagemaker_model_component.py diff --git a/components/aws/sagemaker/process/component.yaml b/components/aws/sagemaker/process/component.yaml index 8a5e813585..2c012c2aad 100644 --- a/components/aws/sagemaker/process/component.yaml +++ b/components/aws/sagemaker/process/component.yaml @@ -57,7 +57,7 @@ outputs: - {name: output_artifacts, description: A dictionary containing the output S3 artifacts.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - process/src/sagemaker_process_component.py diff --git a/components/aws/sagemaker/process/src/sagemaker_process_component.py b/components/aws/sagemaker/process/src/sagemaker_process_component.py index 1b6c3f171b..8eacd9cd9d 100644 --- a/components/aws/sagemaker/process/src/sagemaker_process_component.py +++ b/components/aws/sagemaker/process/src/sagemaker_process_component.py @@ -180,6 +180,11 @@ class SageMakerProcessComponent(SageMakerComponent): ) ) + def _print_logs_for_job(self): + self._print_cloudwatch_logs( + "/aws/sagemaker/ProcessingJobs", self._processing_job_name + ) + def _get_job_outputs(self): """Map the S3 outputs of a processing job to a dictionary object. diff --git a/components/aws/sagemaker/rlestimator/component.yaml b/components/aws/sagemaker/rlestimator/component.yaml index 3468c7ae7c..e4aadcbeaf 100644 --- a/components/aws/sagemaker/rlestimator/component.yaml +++ b/components/aws/sagemaker/rlestimator/component.yaml @@ -76,7 +76,7 @@ outputs: the training algorithm.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - rlestimator/src/sagemaker_rlestimator_component.py diff --git a/components/aws/sagemaker/simulation_job/component.yaml b/components/aws/sagemaker/simulation_job/component.yaml index ec30508d5e..4ea7b1d009 100644 --- a/components/aws/sagemaker/simulation_job/component.yaml +++ b/components/aws/sagemaker/simulation_job/component.yaml @@ -53,7 +53,7 @@ outputs: - {name: job_id, description: The simulation job id.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - simulation_job/src/robomaker_simulation_job_component.py diff --git a/components/aws/sagemaker/simulation_job_batch/component.yaml b/components/aws/sagemaker/simulation_job_batch/component.yaml index 7f41b76b0a..d5d784fd60 100644 --- a/components/aws/sagemaker/simulation_job_batch/component.yaml +++ b/components/aws/sagemaker/simulation_job_batch/component.yaml @@ -24,7 +24,7 @@ outputs: - {name: batch_job_id, description: The simulation job batch id.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - simulation_job_batch/src/robomaker_simulation_job_batch_component.py diff --git a/components/aws/sagemaker/tests/unit_tests/tests/batch_transform/test_transform_component.py b/components/aws/sagemaker/tests/unit_tests/tests/batch_transform/test_transform_component.py index 8f62047b54..29bd66f19d 100644 --- a/components/aws/sagemaker/tests/unit_tests/tests/batch_transform/test_transform_component.py +++ b/components/aws/sagemaker/tests/unit_tests/tests/batch_transform/test_transform_component.py @@ -39,6 +39,13 @@ class TransformComponentTestCase(unittest.TestCase): "BatchTransform-generated", self.component._transform_job_name ) + @patch("common.sagemaker_component.SageMakerComponent._print_cloudwatch_logs") + def test_cw_logs(self, mocked_super_component): + self.component._print_logs_for_job() + self.component._print_cloudwatch_logs.assert_called_once_with( + "/aws/sagemaker/TransformJobs", self.component._transform_job_name + ) + def test_create_transform_job(self): spec = SageMakerTransformSpec(self.REQUIRED_ARGS) request = self.component._create_job_request(spec.inputs, spec.outputs) diff --git a/components/aws/sagemaker/tests/unit_tests/tests/process/test_process_component.py b/components/aws/sagemaker/tests/unit_tests/tests/process/test_process_component.py index 0f3ab9f0f3..cdc6b7c36e 100644 --- a/components/aws/sagemaker/tests/unit_tests/tests/process/test_process_component.py +++ b/components/aws/sagemaker/tests/unit_tests/tests/process/test_process_component.py @@ -23,7 +23,6 @@ class ProcessComponentTestCase(unittest.TestCase): self.REQUIRED_ARGS + ["--job_name", "job-name"] ) unnamed_spec = SageMakerProcessSpec(self.REQUIRED_ARGS) - self.component.Do(named_spec) self.assertEqual("job-name", self.component._processing_job_name) @@ -34,6 +33,13 @@ class ProcessComponentTestCase(unittest.TestCase): self.component.Do(unnamed_spec) self.assertEqual("unique", self.component._processing_job_name) + @patch("common.sagemaker_component.SageMakerComponent._print_cloudwatch_logs") + def test_cw_logs(self, mocked_super_component): + self.component._print_logs_for_job() + self.component._print_cloudwatch_logs.assert_called_once_with( + "/aws/sagemaker/ProcessingJobs", self.component._processing_job_name + ) + def test_create_process_job(self): spec = SageMakerProcessSpec(self.REQUIRED_ARGS) request = self.component._create_job_request(spec.inputs, spec.outputs) diff --git a/components/aws/sagemaker/tests/unit_tests/tests/train/test_train_component.py b/components/aws/sagemaker/tests/unit_tests/tests/train/test_train_component.py index 03b206d2df..33cba07df7 100644 --- a/components/aws/sagemaker/tests/unit_tests/tests/train/test_train_component.py +++ b/components/aws/sagemaker/tests/unit_tests/tests/train/test_train_component.py @@ -36,6 +36,13 @@ class TrainingComponentTestCase(unittest.TestCase): self.component.Do(unnamed_spec) self.assertEqual("unique", self.component._training_job_name) + @patch("common.sagemaker_component.SageMakerComponent._print_cloudwatch_logs") + def test_cw_logs(self, mocked_super_component): + self.component._print_logs_for_job() + self.component._print_cloudwatch_logs.assert_called_once_with( + "/aws/sagemaker/TrainingJobs", self.component._training_job_name + ) + def test_create_training_job(self): spec = SageMakerTrainingSpec(self.REQUIRED_ARGS) request = self.component._create_job_request(spec.inputs, spec.outputs) diff --git a/components/aws/sagemaker/train/component.yaml b/components/aws/sagemaker/train/component.yaml index 6d731d6a3f..76be4e757f 100644 --- a/components/aws/sagemaker/train/component.yaml +++ b/components/aws/sagemaker/train/component.yaml @@ -72,7 +72,7 @@ outputs: the training algorithm.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - train/src/sagemaker_training_component.py diff --git a/components/aws/sagemaker/workteam/component.yaml b/components/aws/sagemaker/workteam/component.yaml index 7dfc5fb7a9..646352f7a5 100644 --- a/components/aws/sagemaker/workteam/component.yaml +++ b/components/aws/sagemaker/workteam/component.yaml @@ -22,7 +22,7 @@ outputs: - {name: workteam_arn, description: The ARN of the workteam.} implementation: container: - image: amazon/aws-sagemaker-kfp-components:1.1.0 + image: amazon/aws-sagemaker-kfp-components:1.1.1 command: [python3] args: - workteam/src/sagemaker_workteam_component.py