AWS sagemaker documentation change
Summary
Removed all legacy SageMaker Python SDK v2 code examples and some v3 headings from ProcessingStep, TrainingStep, ModelStep, TransformStep, ConditionStep, CallbackStep, LambdaStep, ClarifyCheckStep, and QualityCheckStep documentation sections.
Security assessment
The changes exclusively remove outdated SDK v2 examples and some v3 section headers. There are no security vulnerability mentions, security feature additions, or security-related context in the removed content. This appears to be routine documentation cleanup of deprecated code samples.
Diff
diff --git a/sagemaker/latest/dg/build-and-manage-steps-types.md b/sagemaker/latest/dg/build-and-manage-steps-types.md index 48483e7b1..c04d3d0a3 100644 --- a//sagemaker/latest/dg/build-and-manage-steps-types.md +++ b//sagemaker/latest/dg/build-and-manage-steps-types.md @@ -132,2 +131,0 @@ A processing step requires a processor, a Python script that defines the process -**SageMaker Python SDK v3:** - @@ -194,67 +191,0 @@ The following example shows how to pass runtime parameters from a PySpark proces - step_process = ProcessingStep( - name="AbaloneProcess", - step_args=step_args, - ) - -**SageMaker Python SDK v2 (Legacy):** - - - from sagemaker.sklearn.processing import SKLearnProcessor - - sklearn_processor = SKLearnProcessor(framework_version='1.0-1', - role=<role>, - instance_type='ml.m5.xlarge', - instance_count=1) - - - from sagemaker.processing import ProcessingInput, ProcessingOutput - from sagemaker.workflow.steps import ProcessingStep - - inputs = [ - ProcessingInput(source=<input_data>, destination="/opt/ml/processing/input"), - ] - - outputs = [ - ProcessingOutput(output_name="train", source="/opt/ml/processing/train"), - ProcessingOutput(output_name="validation", source="/opt/ml/processing/validation"), - ProcessingOutput(output_name="test", source="/opt/ml/processing/test") - ] - - step_process = ProcessingStep( - name="AbaloneProcess", - step_args = sklearn_processor.run(inputs=inputs, outputs=outputs, - code="abalone/preprocessing.py") - ) - -**Pass runtime parameters** - -The following example shows how to pass runtime parameters from a PySpark processor to a `ProcessingStep`. - - - from sagemaker.workflow.pipeline_context import PipelineSession - from sagemaker.spark.processing import PySparkProcessor - from sagemaker.processing import ProcessingInput, ProcessingOutput - from sagemaker.workflow.steps import ProcessingStep - - pipeline_session = PipelineSession() - - pyspark_processor = PySparkProcessor( - framework_version='2.4', - role=<role>, - instance_type='ml.m5.xlarge', - instance_count=1, - sagemaker_session=pipeline_session, - ) - - step_args = pyspark_processor.run( - inputs=[ProcessingInput(source=<input_data>, destination="/opt/ml/processing/input"),], - outputs=[ - ProcessingOutput(output_name="train", source="/opt/ml/processing/train"), - ProcessingOutput(output_name="validation", source="/opt/ml/processing/validation"), - ProcessingOutput(output_name="test", source="/opt/ml/processing/test") - ], - code="preprocess.py", - arguments=None, - ) - - @@ -303,2 +233,0 @@ The following example shows how to create a `TrainingStep` definition. For more -**SageMaker Python SDK v3:** - @@ -345,36 +273,0 @@ The following example shows how to create a `TrainingStep` definition. For more -**SageMaker Python SDK v2 (Legacy):** - - - from sagemaker.workflow.pipeline_context import PipelineSession - - from sagemaker.inputs import TrainingInput - from sagemaker.workflow.steps import TrainingStep - - from sagemaker.xgboost.estimator import XGBoost - - pipeline_session = PipelineSession() - - xgb_estimator = XGBoost(..., sagemaker_session=pipeline_session) - - step_args = xgb_estimator.fit( - inputs={ - "train": TrainingInput( - s3_data=step_process.properties.ProcessingOutputConfig.Outputs[ - "train" - ].S3Output.S3Uri, - content_type="text/csv" - ), - "validation": TrainingInput( - s3_data=step_process.properties.ProcessingOutputConfig.Outputs[ - "validation" - ].S3Output.S3Uri, - content_type="text/csv" - ) - } - ) - - step_train = TrainingStep( - name="TrainAbaloneModel", - step_args=step_args, - ) - @@ -509,3 +401,0 @@ The following example shows how to create a `ModelStep` definition. -SageMaker Python SDK v3 - - @@ -530,21 +419,0 @@ SageMaker Python SDK v3 -SageMaker Python SDK v2 (Legacy) - - - - from sagemaker.workflow.pipeline_context import PipelineSession - from sagemaker.model import Model - from sagemaker.workflow.model_step import ModelStep - - step_train = TrainingStep(...) - model = Model( - image_uri=pytorch_estimator.training_image_uri(), - model_data=step_train.properties.ModelArtifacts.S3ModelArtifacts, - sagemaker_session=PipelineSession(), - role=role, - ) - - step_model_create = ModelStep( - name="MyModelCreationStep", - step_args=model.create(instance_type="ml.m5.xlarge"), - ) - @@ -557,3 +425,0 @@ The following example shows how to create a `ModelStep` that registers a `Pipeli -SageMaker Python SDK v3 - - @@ -614,57 +479,0 @@ SageMaker Python SDK v3 -SageMaker Python SDK v2 (Legacy) - - - - import time - - from sagemaker.workflow.pipeline_context import PipelineSession - from sagemaker.sklearn import SKLearnModel - from sagemaker.xgboost import XGBoostModel - - pipeline_session = PipelineSession() - - code_location = 's3://{0}/{1}/code'.format(bucket_name, prefix) - - sklearn_model = SKLearnModel( - model_data=processing_step.properties.ProcessingOutputConfig.Outputs['model'].S3Output.S3Uri, - entry_point='inference.py', - source_dir='sklearn_source_dir/', - code_location=code_location, - framework_version='1.0-1', - role=role, - sagemaker_session=pipeline_session, - py_version='py3' - ) - - xgboost_model = XGBoostModel( - model_data=training_step.properties.ModelArtifacts.S3ModelArtifacts, - entry_point='inference.py', - source_dir='xgboost_source_dir/', - code_location=code_location, - framework_version='0.90-2', - py_version='py3', - sagemaker_session=pipeline_session, - role=role - ) - - from sagemaker.workflow.model_step import ModelStep - from sagemaker import PipelineModel - - pipeline_model = PipelineModel( - models=[sklearn_model, xgboost_model], - role=role,sagemaker_session=pipeline_session, - ) - - register_model_step_args = pipeline_model.register( - content_types=["application/json"], - response_types=["application/json"], - inference_instances=["ml.t2.medium", "ml.m5.xlarge"], - transform_instances=["ml.m5.xlarge"], - model_package_group_name='sipgroup', - ) - - step_model_registration = ModelStep( - name="AbaloneRegisterModel",