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

'bin/server' shellscript execution instead of 'bin/tools/ws-server.jar' #42

Merged

Conversation

HasseNasse
Copy link

@HasseNasse HasseNasse commented Feb 8, 2019

Short description of what this resolves:

Summary of discussion #40:

  • bin/server shellscript already handles jvm.options + server.env pre-processing before server start-up, we would want liberty-managed to re-use this script rather than programmatically tailoring its own.
  • Future liberty version 19.0.0.1? will support passing generic JVM arguments to the bin/server

Changes proposed in this pull request:

  • bin/server run <servername> used to start server with ConsoleConsumer.
    Comment: Tests passing.
  • Support passing of JVM flags e.g. (from code): -Dcom.ibm.ws.logging.console.log.level=INFO
    Comment: 19.0.0.2 would have allowed the passing of JVM args directly to the shell script. However, this would cause issues with older versions of liberty. The proposed solution (@aguibert ) is to use JAVA_TOOL_OPTIONS on ProcessBuilder which should work for all JDKs.
  • Gracefully close server using bin/server stop

List will be updated as work goes on..

Fixes: #40

Hassan Nazar added 7 commits February 1, 2019 16:46
- Mapping server.env file to liberty-maven-plugin
…h server.bat)

- Changed runnable to bin/tools/ws-server.jar (in accordance with server.bat)
- Attempt to set ProcessBuilder environment before server-start
   - Parsing server.env files from both runtime-level (.../etc/server.env) and server-level (.../<server-name>/server.env)
   - Populating ProcessBuilder environment with the fetched values
…injections (might as well be a DBConnection) and System.getenv...

- Adding jndi-1.0 feature to server.xml, for obvious reasons
- Defining <jndiEntry .../> for reasons defined above
- Adding Runtime.getRuntime().exec() runnable for os specific shell script execution
- Server is being run
@HasseNasse HasseNasse changed the title WIP 'bin/server' shellscript execution instead of 'bin/toolsws-server.jar' WIP 'bin/server' shellscript execution instead of 'bin/tools/ws-server.jar' Feb 8, 2019
Copy link
Contributor

@aguibert aguibert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HasseNasse! Looks like a great start, just a few review comments.

Hassan Nazar added 7 commits February 9, 2019 00:54
- Refactor method name to suit test-case with expected turn-out
- Implement os specific shell-script execution behaviour
- Add some trace-logging
- Merge errorstream with stdout
- create (initial setup) for JAVA_TOOL_OPTIONS environment variable.
…ssible

- Created functionality to parse and add JAVA_TOOL_OPTIONS env-var as a white space seperated list of arguments.
- Trace logging added
- Setting default '-Dcom.ibm.ws.logging.console.log.level=INFO' argument.
- Mapping server.env file to liberty-maven-plugin

- Changed -javaagent to bin/tools/ws-javaagent.jar (in accordance with server.bat)
- Changed runnable to bin/tools/ws-server.jar (in accordance with server.bat)
- Attempt to set ProcessBuilder environment before server-start
   - Parsing server.env files from both runtime-level (.../etc/server.env) and server-level (.../<server-name>/server.env)
   - Populating ProcessBuilder environment with the fetched values

- ResourceInjection test created, testing to fetch both through JNDI injections (might as well be a DBConnection) and System.getenv...
- Adding jndi-1.0 feature to server.xml, for obvious reasons
- Defining <jndiEntry .../> for reasons defined above

- Small javadoc changes

- Commenting out old ProcessBuilder
- Adding Runtime.getRuntime().exec() runnable for os specific shell script execution
- Server is being run

- Use /bin/server shell script to initiate managed server connection

- code being re-added for future reference

- Amend test to check resource injection value rather than nullity
- Refactor method name to suit test-case with expected turn-out

- Remove uncommented code
- Implement os specific shell-script execution behaviour
- Add some trace-logging
- Merge errorstream with stdout
- create (initial setup) for JAVA_TOOL_OPTIONS environment variable.

- Add wlp and ol 19.0.0.1 server versions to travis build

- Add missing jvm-arguments documentation to liberty-managed

- Removed some uneeded type specifications where type-inference is possible
- Created functionality to parse and add JAVA_TOOL_OPTIONS env-var as a white space seperated list of arguments.
- Trace logging added
- Setting default '-Dcom.ibm.ws.logging.console.log.level=INFO' argument.
@HasseNasse HasseNasse changed the title WIP 'bin/server' shellscript execution instead of 'bin/tools/ws-server.jar' 'bin/server' shellscript execution instead of 'bin/tools/ws-server.jar' Feb 9, 2019
@HasseNasse
Copy link
Author

#42 can be reviewed again for possible issues now. Change requests have been implemented. In addition, squash-commit 24365be can be viewed to see all changes + messages.

Copy link
Contributor

@chyt chyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking that it's most likely preferable to call bin/server stop in stop() rather than just killing the server process? Other than that the changes look good to me. Also I would just point out that we should probably refactor to use the Liberty Ant Plugin at some point in the future.

Copy link
Contributor

@aguibert aguibert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks @HasseNasse!

I'll defer the actual merge to @chyt though

@HasseNasse
Copy link
Author

I'm thinking that it's most likely preferable to call bin/server stop in stop() rather than just killing the server process? Other than that the changes look good to me. Also I would just point out that we should probably refactor to use the Liberty Ant Plugin at some point in the future.

I`ll give the gracefull shutdown comment a look whenever possible.

@HasseNasse
Copy link
Author

The shut down hook has now been updated, would be nice to merge this PR as we are wanting to run Integration Tests on our application using the liberty-managed adapter with the added functionalities.

@chyt chyt merged commit e157689 into OpenLiberty:master Feb 20, 2019
@HasseNasse HasseNasse deleted the feature/server-shellscript-conformity branch February 20, 2019 16:22
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.

None yet

3 participants