Added support for Sagemaker ENV variables + custom formatter scripts#2921
Merged
Added support for Sagemaker ENV variables + custom formatter scripts#2921
Conversation
a204f8d to
7dde753
Compare
Lokiiiiii
previously requested changes
Oct 27, 2025
xyang16
reviewed
Oct 29, 2025
Lokiiiiii
reviewed
Oct 29, 2025
xyang16
reviewed
Oct 30, 2025
| for (Map.Entry<String, String> env : Utils.getenv().entrySet()) { | ||
| String key = env.getKey(); | ||
| // Apply SageMaker compatibility for server-level configurations | ||
| SageMakerCompatibility.applyServerCompatibility(prop); |
Contributor
There was a problem hiding this comment.
Do you want this to be higher priority than SERVING_XXX env? If yes, you need to move it after line 141. Otherwise SERVING_MAX_REQUEST_SIZE will override SAGEMAKER_MAX_REQUEST_SIZE.
xyang16
reviewed
Oct 30, 2025
| } | ||
|
|
||
| // Apply SageMaker compatibility for model-level configurations | ||
| SageMakerCompatibility.applyModelCompatibility(prop); |
Contributor
There was a problem hiding this comment.
Same as above. Move after line 915 if needed.
xyang16
reviewed
Oct 30, 2025
|
|
||
| String defaultAccept = System.getenv("SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT"); | ||
| if (defaultAccept != null) { | ||
| String entryPoint = properties.getProperty("option.entryPoint"); |
Contributor
There was a problem hiding this comment.
Need to move SageMakerCompatibility.applyModelCompatibility(prop) in ModelInfo.java after line 915. Because if user set entrypoint via OPTION_ENTRYPOINT env, it is not populated to properties yet.
… custom formatter handler
xyang16
approved these changes
Oct 30, 2025
Requested changes were implemented and approved by Xin. Merge is necessary in order to publish the container by the deadline (10/31)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
SAGEMAKER_MAX_REQUEST_SIZE
SAGEMAKER_NUM_MODEL_WORKERS
SAGEMAKER_DEFAULT_INVOCATIONS_ACCEPT
SAGEMAKER_MODEL_SERVER_TIMEOUT_SECONDS
SAGEMAKER_MODEL_SERVER_VMARGS
SAGEMAKER_STARTUP_TIMEOUT
SAGEMAKER_MAX_PAYLOAD_IN_MB
SKLearn handler notebook: https://github.com/deepjavalibrary/djl-demo/blob/master/djl-serving/python-mode/sklearn_handler_guide.ipynb
XGBoost handler notebook: https://github.com/deepjavalibrary/djl-demo/blob/master/djl-serving/python-mode/xgboost_handler_guide.ipynb
Type of change
Please delete options that are not relevant.
Checklist:
pytest tests.py -k "TestCorrectnessLmiDist" -m "lmi_dist"Feature/Issue validation/testing
Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.
Test A
Logs for Test A
Test B
Logs for Test B