Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add JDK17 compatible groovy dependency for frontend log4j ScriptFilter #3235

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

lanxih
Copy link
Contributor

@lanxih lanxih commented Jul 9, 2024

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

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

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.

  • Ran frontend server with changes: ../gradlew startServer without previous build failure.
    before:
> Task :server:startServer FAILED

FAILURE: Build failed with an exception.

* Where:
Script '/home/lhuang/development/torchserve_fork/serve/frontend/tools/gradle/launcher.gradle' line: 19

* What went wrong:
Execution failed for task ':server:startServer'.
> Could not get unknown property 'runtime' for configuration container of type org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.

after:

BUILD SUCCESSFUL in 14s
9 actionable tasks: 4 executed, 5 up-to-date
  • Built torchserve image 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:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

@lanxih lanxih marked this pull request as ready for review July 9, 2024 23:44
@agunapal agunapal enabled auto-merge July 19, 2024 17:33
@agunapal agunapal added this pull request to the merge queue Jul 19, 2024
Merged via the queue into pytorch:master with commit b985beb Jul 19, 2024
9 of 12 checks passed
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.

3 participants