add JDK17 compatible groovy dependency for frontend log4j ScriptFilter #3235
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
Please read our CONTRIBUTING.md prior to creating your first pull request.
Please include a summary of the feature or issue being fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
For context, the Torchserve frontend Java engine was previously upgraded to JDK 17, which no longer supports the Nashorn JavaScript Engine as per https://openjdk.org/jeps/372. Consequently, creating custom log4j2 configurations with script filters using JavaScript is no longer possible. Groovy is recommended as an alternative for this purpose. To unblock, this change adds the Groovy dependency to the frontend build.
This update also includes a minor fix for a build error encountered due to the use of the parameter
configurations.runtime
to obtain program execution configurations, which has been disabled in Gradle 6.x and later versions.Type of change
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.
../gradlew startServer
without previous build failure.before:
after:
bash build_image.sh --pythonversion 3.10 --tag lhuang-test --source
and run the container locally to test out the custom log4j2.xml:docker run --rm -it -e BACKEND_LOG_LEVEL=WARN -e SERVER_LOG_LEVEL=WARN -e EXCLUDE_LOGGER=TS_METRICS lhuang-test
Checklist: