|
20 | 20 | from sagemaker import Session
|
21 | 21 | from sagemaker.fw_registry import default_framework_uri
|
22 | 22 |
|
23 |
| -from sagemaker.processing import ProcessingInput, ProcessingOutput, ScriptProcessor, Processor |
| 23 | +from sagemaker.processing import ( |
| 24 | + ProcessingInput, |
| 25 | + ProcessingOutput, |
| 26 | + ScriptProcessor, |
| 27 | + Processor, |
| 28 | + ProcessingJob, |
| 29 | +) |
24 | 30 | from sagemaker.sklearn.processing import SKLearnProcessor
|
25 | 31 | from sagemaker.utils import sts_regional_endpoint
|
26 | 32 | from tests.integ import DATA_DIR
|
@@ -475,6 +481,37 @@ def test_script_processor_with_no_inputs_or_outputs(
|
475 | 481 |
|
476 | 482 | assert job_description["StoppingCondition"] == {"MaxRuntimeInSeconds": 3600}
|
477 | 483 |
|
| 484 | + job_from_name = ProcessingJob.from_processing_name( |
| 485 | + sagemaker_session=sagemaker_session, |
| 486 | + processing_job_name=job_description["ProcessingJobName"], |
| 487 | + ) |
| 488 | + job_description = job_from_name.describe() |
| 489 | + |
| 490 | + assert job_description["ProcessingInputs"][0]["InputName"] == "code" |
| 491 | + |
| 492 | + assert job_description["ProcessingJobName"].startswith("test-script-processor-with-no-inputs") |
| 493 | + |
| 494 | + assert job_description["ProcessingJobStatus"] == "Completed" |
| 495 | + |
| 496 | + assert job_description["ProcessingResources"]["ClusterConfig"]["InstanceCount"] == 1 |
| 497 | + assert ( |
| 498 | + job_description["ProcessingResources"]["ClusterConfig"]["InstanceType"] == cpu_instance_type |
| 499 | + ) |
| 500 | + assert job_description["ProcessingResources"]["ClusterConfig"]["VolumeSizeInGB"] == 100 |
| 501 | + |
| 502 | + assert job_description["AppSpecification"]["ContainerArguments"] == ["-v"] |
| 503 | + assert job_description["AppSpecification"]["ContainerEntrypoint"] == [ |
| 504 | + "python3", |
| 505 | + "/opt/ml/processing/input/code/dummy_script.py", |
| 506 | + ] |
| 507 | + assert job_description["AppSpecification"]["ImageUri"] == image_uri |
| 508 | + |
| 509 | + assert job_description["Environment"] == {"DUMMY_ENVIRONMENT_VARIABLE": "dummy-value"} |
| 510 | + |
| 511 | + assert ROLE in job_description["RoleArn"] |
| 512 | + |
| 513 | + assert job_description["StoppingCondition"] == {"MaxRuntimeInSeconds": 3600} |
| 514 | + |
478 | 515 |
|
479 | 516 | @pytest.mark.canary_quick
|
480 | 517 | def test_processor(sagemaker_session, image_uri, cpu_instance_type, output_kms_key):
|
|
0 commit comments