Skip to content

feature: add custom entry_point support to FrameworkProcessor.run()#5742

Open
rauldiaz wants to merge 1 commit intoaws:masterfrom
rauldiaz:framework-processor-custom-entrypoint
Open

feature: add custom entry_point support to FrameworkProcessor.run()#5742
rauldiaz wants to merge 1 commit intoaws:masterfrom
rauldiaz:framework-processor-custom-entrypoint

Conversation

@rauldiaz
Copy link
Copy Markdown
Contributor

Description:

This change adds an optional entry_point parameter to FrameworkProcessor.run(), allowing users to provide a custom runproc.sh script that replaces the default auto-generated one. The custom script content is embedded into the entrypoint, with the python command to execute the user script appended automatically.

Motivation:

The default runproc.sh generated by FrameworkProcessor installs dependencies via pip install -r requirements.txt using the public PyPI index. In enterprise environments where internet access is restricted and Python packages are hosted on internal repositories (e.g., JFrog Artifactory, AWS CodeArtifact), users need to customize the entrypoint to configure pip with the appropriate index URL, certificates, or authentication before installing dependencies. This change enables that without requiring users to do complex workarounds or modifying the SDK.

Changes:

  • Added entry_point parameter to FrameworkProcessor.run() and threaded it through _pack_and_upload_code, _create_and_upload_runproc, and _generate_framework_script.
  • Added _generate_custom_framework_script() method that reads the custom script file and embeds its content
  • When entry_point is relative and source_dir is provided, they are combined; absolute paths are used as-is
  • When entry_point is not provided, behavior is unchanged

Testing:

  • Added 3 unit tests covering: custom entry_point, custom entry_point with source_dir, and regression for default behavior
  • Manual validation via notebook (custom_framework_processor.ipynb) running both default and custom entry_point processing jobs on SageMaker.

custom_framework_processor.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant