Conversation
|
Claude finished @jam-jee's task in 3m 9s —— View job PR Review: fix(processing): Fix V3 shape regressions in processors
Thanks for the fixes — the V3 shape migrations are correct and well-targeted. I verified the new 1.
|
7921169 to
e19dd8d
Compare
|
Claude finished @jam-jee's task in 1m 48s —— View job PR Review: fix(processing): Fix V3 shape regressions in processors
I verified the V3 shape migrations against
1.
|
PySparkProcessor still built ProcessingInput/ProcessingOutput with the V2 source/destination keyword signature, so spark_event_logs_s3_uri and the configuration channel failed on V3. Build them with the V3 shapes (ProcessingS3Input/ProcessingS3Output) instead. Validate that submit_py_files, submit_jars and submit_files are lists and raise a clear ValueError otherwise. FrameworkProcessor.run(requirements=...) now threads the file name into the generated runproc.sh instead of hardcoding requirements.txt. Processor.run defaults kms_key to the configured output_kms_key so uploaded code is encrypted with the same key as job outputs. The requirements file is also honored on the custom entry_point (S3 source_dir) path, and a relative path such as reqs/cpu.txt is kept as-is because the source bundle preserves the source_dir layout. Integration tests (real jobs, submit-then-stop where the fix is in the request path) cover the code-upload KMS fallback, the FrameworkProcessor requirements file, and a V3 PySparkProcessor job ported from V2 that asserts the event-log output and the conf/py-files input shape; V3 had no Spark integ coverage before. Fixes aws#3809 Fixes aws#6253 Fixes aws#6252 Fixes aws#5805 Fixes aws#4874 --- X-AI-Prompt: Fix S-effort PySDK V3 bugs, processing-spark theme X-AI-Tool: Kiro
e19dd8d to
d1dfbbb
Compare
|
Addressing the review on 1. 2. Minor: third KMS site at Integration tests run locally against the CI account (us-west-2): |
|
Claude finished @jam-jee's task in 1m 53s —— View job PR Review: fix(processing): Fix V3 shape regressions in processors
This push resolves the two findings from the earlier reviews. I verified the changes against Previously-flagged issues — now resolved ✅
Verified correct
Minor (non-blocking)
No security or prompt-injection concerns in the diff. Tests are behavior-focused and each maps to a fixed path. LGTM. |
Summary
Several processor code paths still used V2 shapes or hardcoded values after the V3 split, and failed at runtime:
PySparkProcessorV3 shapes --spark_event_logs_s3_uriand the Spark configuration channel builtProcessingInput/ProcessingOutputwith the V2source=/destination=keyword signature, which no longer exists. They now buildProcessingS3Input/ProcessingS3Output, so event logs and_stage_submit_depswork again.submit_py_files/submit_jars/submit_filesvalidation -- passing a plain string used to fail with an opaqueTypeError; these now raise a clearValueErrornaming the argument. (Change: Type checking with Pydantic #4265 by @martinRenou also addresses this as part of a wider Pydantic type-checking change; this is the narrow fix for the reported symptom.)FrameworkProcessor.run(requirements=...)-- the path (relative tosource_dir, subdirectories kept) is threaded into the generatedrunproc.shon both the default and the customentry_pointpath, instead of being ignored in favour of a hardcodedrequirements.txt.Processor.runkms_key default --kms_keyfalls back to the configuredoutput_kms_keyso uploaded code is encrypted with the same key as job outputs. The two fallback sites this PR touches use the sameis Nonecheck so an explicit value always wins.Issues fixed
Fixes #3809
Fixes #6253
Fixes #6252
Fixes #5805
Fixes #4874
Testing
New unit tests in
sagemaker-core, each verified to fail without the source change and pass with it:tests/unit/spark/test_processing.py:test_string_submit_deps_raises_clear_error,test_list_submit_deps_does_not_raise_type_error,test_extend_processing_args_builds_v3_output,test_local_dep_builds_v3_inputtests/unit/test_processing.py:test_custom_requirements_file_is_used,test_requirements_relative_subdirectory_is_preserved,test_requirements_absolute_path_uses_basename,test_custom_requirements_file_used_with_entry_point_s3_source,test_default_requirements_file_when_none,test_run_defaults_kms_key_to_output_kms_key,test_run_explicit_kms_key_winstests/unit/test_processing.py+tests/unit/spark/test_processing.py: 176 passed.black -l 100andflake8clean on changed files.Integration tests
Three new real-AWS tests in
sagemaker-core/tests/integ/(run by thesagemaker-core-integ-testsCodeBuild project, us-west-2,SageMakerRole):processing/test_processor_code_kms_fallback.py(kms_keyinsagemaker.processing.Processorshould default tooutput_kms_key#4874):ScriptProcessor(output_kms_key=...)withrun(code=..., wait=False)and nokms_key;head_objecton the uploaded code showsServerSideEncryption=aws:kmswith that key. Submit-then-stop, since the fix is in the upload path.processing/test_framework_processor_requirements.py(FrameworkProcessor.run(requirements=...) ignores custom requirements file in PySDK V3 #5805,serial):FrameworkProcessor.run(requirements=...)with a package the sklearn image lacks; asserts the generatedrunproc.shnames the requirements file, then that the job reachesCompleted(the import worked).spark/test_spark_processing.py(Cannot use spark_event_logs_s3_uri in PySparkProcessor job #6253, Cannot upload local file for submit_py_files in V3 #6252,serial): a V3PySparkProcessorjob ported from V2'stest_spark_processing.py(test data undertests/data/spark/), asserting the conf/py-files inputs carryS3Input.LocalPathunder/opt/ml/processing/input/and that the event-log S3 prefix is non-empty after the run. V3 had no Spark integ coverage before, which is how Cannot use spark_event_logs_s3_uri in PySparkProcessor job #6253 shipped.Judged not worth an integ test: #3809 (
submit_py_filestype guard fires before any API call; unit-tested).All three were run locally against the CI account (us-west-2) and pass; the Spark job completes in about 8 minutes.
X-AI-Prompt: Fix S-effort PySDK V3 bugs, processing-spark theme
X-AI-Tool: Kiro