Fix source_dir in FrameworkProcessor#6047
Conversation
…ight validation Split ecr_policy statements in training, serving, and hyperpod role types so that only ecr:GetAuthorizationToken (account-level) remains under Resource: "*". The repository-level actions (BatchGetImage, GetDownloadUrlForLayer, BatchCheckLayerAvailability) are now scoped to arn:aws:ecr:*:*:repository/*, which excludes them from _get_smoke_test_actions. This prevents SimulatePrincipalPolicy from returning implicitDeny for roles that correctly scope ECR permissions to specific repo ARNs (least privilege), fixing the regression that blocked deploys/training/pipelines for those customers.
|
Tested with real use case |
…helpers
_package_code and _pack_and_upload_code declared dependencies as a
required positional arg, but the unit tests (and any direct callers)
invoke them without it, causing:
TypeError: _package_code() missing 1 required positional argument: 'dependencies'
Move dependencies to the end of both signatures with a None default so
it is optional, matching the public run() signature. Also apply black
formatting and remove unused imports/vars in test_processing.py.
|
Claude finished @mohamedzeidan2021's task in 5m 1s —— View job PR Review: Fix source_dir in FrameworkProcessor
I reviewed the S3 🔴 High —
|
When source_dir is an S3 URI, /opt/ml/processing/input/code maps to the
user's (possibly read-only) S3 location, which does not contain the
managed install_requirements.py helper. The helper was uploaded to a
separate managed prefix that was never mounted into the container, yet
the generated runproc script hardcoded
python3 /opt/ml/processing/input/code/install_requirements.py
so any S3 source_dir bundle containing a requirements.txt failed at
runtime with a missing-file error.
Mount the managed helper via a dedicated 'aux' ProcessingInput at
/opt/ml/processing/input/aux (never writing into the user's bucket) and
parameterize the generated scripts to reference install_requirements.py
from the correct directory: /input/code for a local source_dir
(unchanged) and /input/aux for an S3 source_dir.
Update test_pack_and_upload_code_with_s3_source_dir_creates_code_input to
assert the aux mount is created (it previously locked in the broken
layout) and add regression tests verifying the generated scripts point at
the mounted helper path.
Also use a context manager for the helper file read.
|
Claude finished @mohamedzeidan2021's task in 8m 49s —— View job PR Review: Fix source_dir in FrameworkProcessor
I re-reviewed the S3 ✅ Previously-flagged
|
fix(processing): Support S3 URIs for FrameworkProcessor source_dir
Restore v2 behavior where source_dir accepts S3 URIs pointing to
tar.gz archives or S3 prefixes. The v3 rewrite only handled local
directories, causing ValueError when customers passed S3 paths.
Add _is_s3_uri, _resolve_s3_source_dir, and _resolve_helper_scripts_prefix
helpers to cleanly route S3 vs local source_dir through _package_code and
_pack_and_upload_code. Update _generate_custom_framework_script to handle
the case where entry_point cannot be read locally.