-
Notifications
You must be signed in to change notification settings - Fork 72
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
Draft for Spring Boot 3 WAR post #3655
Conversation
Maybe I should add into the blog post, for completeness, that if you choose a JAR packaging type your only option is to use the optimized deployment with |
I did get one internal comment suggesting showing more of the Java and server.xml. IMO, this sort of would amount to having a new or updated guide. CC'ing @gkwan-ibm as feedback/input. |
hi @scottkurz would you explain more what need to be updated in the existing/new guide? Or even better if you can open an issue on the guide-spring-boot or guides-common repo. Thanks |
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
:url-about: / | ||
//Blank line here is necessary before starting the body of the post. | ||
|
||
As of Liberty version 23.0.0.9 there are now two ways to deploy Spring Boot WAR files on Liberty. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this hasn't been addressed in any of our other blog posts/guide about SB support yet either, but I think this sentence should be followed by answering the question of "why would I do that [deploy a Spring Boot WAR on Liberty]?". Without it, yes, the post is providing some helpful documentation for people who need it, but a blog post should provide more than that and it would be good to also convince readers that it's a valuable thing to do for relevant use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eg to benefit from InstantOn for a faster startup whilst maintaining throughput and not having to modify the app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer to "why" might depend on your baseline alternative
- not going to get into why choose WAR but assume they know. I even feel like "..to take advantage of the Spring and Spring Boot libraries " is too obvious to mention but leaving it for now as a compromise
- follow-up.. this good to reference:
That answers why SB on Liberty.
As far as why "optimized deployment"? That's addressed with:
This deployment adds some additional configuration options, and provides advantages for efficiently building Docker container images
OTOH, InstantOn is supposed to work with both deployments.
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
|
||
As of Liberty version 23.0.0.9 there are now two ways to deploy Spring Boot WAR files on Liberty. | ||
|
||
While a Spring Boot WAR can be deployed like any standard Jakarta EE WAR, it can also be deployed using an optimized deployment for Spring Boot applications. This deployment adds some additional configuration options, and provides advantages for efficiently building Docker container images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While a Spring Boot WAR can be deployed like any standard Jakarta EE WAR, it can also be deployed using an optimized deployment for Spring Boot applications. This deployment adds some additional configuration options, and provides advantages for efficiently building Docker container images. | |
While a Spring Boot WAR can be deployed like any standard Jakarta EE WAR, the WAR can be optimized deployment for Spring Boot applications. The optimization adds some additional configuration options, and provides advantages for efficiently building Docker container images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why would you ever use a non-optimized approach? It sounds, um, sub-optimal...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This part "..the WAR can be optimized deployment .." read a bit awkward so I took your suggestion and tweaked a bit
"Also, why would you ever use a non-optimized approach? It sounds, um, sub-optimal..."
Because:
- you need extra pom.xml config
- you need special server.xml config
- you can't use dev mode
and because you might want to deploy like any WAR.
I added:
"using some extra pom.xml and server.xml configuration."
to maybe thread the needle here or feel free to suggest another wording.
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
|
||
While a Spring Boot WAR can be deployed like any standard Jakarta EE WAR, it can also be deployed using an optimized deployment for Spring Boot applications. This deployment adds some additional configuration options, and provides advantages for efficiently building Docker container images. | ||
|
||
In this blog post we will step through a simple flow starting from the Spring Initializr. We will deploy this to Liberty via a standard WAR deployment without any Liberty modifications to the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this blog post we will step through a simple flow starting from the Spring Initializr. We will deploy this to Liberty via a standard WAR deployment without any Liberty modifications to the app. | |
In this blog post, we create a simple app by using the Spring Initializr, and then deploy the app as a WAR to Liberty without any modifications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to emphasize the "typical deployment" contrasted with the later optimized, so added to your wording"
"..., using the same deployment as for any WAR"
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
|
||
In this blog post we will step through a simple flow starting from the Spring Initializr. We will deploy this to Liberty via a standard WAR deployment without any Liberty modifications to the app. | ||
|
||
From there we'll show how to deploy using the optimized Spring Boot deployment by adding the liberty-maven-plugin and some minimal config to the pom.xml, and simple server.xml configuration using the `springBoot-3.0` feature. We will then be able to build an efficiently-layered Docker image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From there we'll show how to deploy using the optimized Spring Boot deployment by adding the liberty-maven-plugin and some minimal config to the pom.xml, and simple server.xml configuration using the `springBoot-3.0` feature. We will then be able to build an efficiently-layered Docker image. | |
We then show how to optimize the Spring Boot deployment by adding the Liberty Maven Plugin (`liberty-maven-plugin`) and some minimal config to the `pom.xml`, and add a simple `server.xml` configuration with the `springBoot-3.0` feature. We can then build an efficiently-layered Docker image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly took your change ..but left the words "the optimized deployment". This deployment is a direction that drags in several ramifications. When you go this route, you have to have special pom.xml, server.xml config..
It even affects a bit of the programming model.
It's not just something you do in the final step of deployment. It's a choice you have to make.
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
== Prerequisites | ||
- Java 21 (sample could be easily reworked with Java 17) | ||
|
||
== Deploy as standard WAR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is an initial draft, but just so we don't forget: expand the sentences into full sentences throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
|
||
We're going to reuse the app from the previous example. | ||
|
||
1. Add liberty-maven-plugin with Spring Boot deployment config to pom.xml: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but what does this do for the app?
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
</plugin> | ||
---- | ||
+ | ||
2. Create your Liberty server.xml by copying from the Spring Boot template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what does this do for the app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did my extra sentence address your concern?
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
cp target/liberty/wlp/usr/servers/defaultServer/server.xml src/main/liberty/config/server.xml | ||
---- | ||
+ | ||
3. Add application arguments to your Spring Boot application configuration in Liberty server.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do these do for the app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did my extra sentence address your concern?
posts/2024-xx-xx-spring-boot-3.adoc
Outdated
./mvnw package liberty:run | ||
---- | ||
+ | ||
6. Observe the output: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the reader/user doesn't see that output? What's most likely gone wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I don't have an answer though. If I think of one I'll add it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd need to @yeekangc to take a look when he's back regarding the overall post and what should/shouldn't be included, I've made some comments about needing more explanation/context (mainly). I know Chuck's post is quite sparse but I think similar comments should apply there too really.
If you can run a build on the draft server (see slack or this repo's readme), we can see how it looks for length but it doesn't seem too long. My feeling is that the level of detail for the instructions is about right, there just needs to be more explanation (why) of what the user is being asked to do.
I don't feel strongly enough to push this forward for now, so I'll just stop with this previous comment. It's not that I think there's one clear next step so it would depend what we wanted to show. |
@lauracowen, thanks for the review. One overall comment: as far as the word choice "optimized". I'm open to other suggestions. I'm far from a Spring Boot expert. It seemed a decent mix of vague and helpful to at least use in the blog post. What I really don't know is if it's good enough to promote to the doc. I think it's better than "..using the Spring Boot feature" which would beg the question of what the feature provides. Opened OpenLiberty/docs#7296 for this... and had opened OpenLiberty/docs#7284 for tracking the major.minor version support. (edited) Pushed a commit and addressed your comments 1-at-a-time. Now that I'm done. I think if I'd addressed them holistically I'd have done better, but I'm just going to push that out there for further review |
Looks good to me. Do we want a Reference in that last section to point to the Spring Boot OL guide: https://openliberty.io/guides/spring-boot.html? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ID review
a21c370
to
b3bfe59
Compare
Signed-off-by: Scott Kurz <[email protected]>
Signed-off-by: Scott Kurz <[email protected]>
Signed-off-by: Scott Kurz <[email protected]>
Signed-off-by: Scott Kurz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated ID review
Co-authored-by: David Mueller <[email protected]>
Signed-off-by: Scott Kurz <[email protected]>
@dmuelle Thanks. To summarize my response...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated my suggestions so it doesn't read like an either-or scenario
Signed-off-by: Scott Kurz <[email protected]>
Signed-off-by: Scott Kurz <[email protected]>
Co-authored-by: David Mueller <[email protected]>
Co-authored-by: David Mueller <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM- thanks!
Fixes #3539.
I realize there are quite a few things not polished yet.
But I was hoping to start getting a review with the general outline of the content. (This is more than an outline, it's the content itself... but what I'm saying is that the question of what we include could still be up for debate.)
So I'll just cc:
@tjwatson @cbridgha @yeekangc @lauracowen @hlhoots
and wait for a PR review until it's more polished.
Also we didn't pin down the key question of does this replace the earlier article more "inline" or do we do more of delete the old and create the new?
Also, I'm not sure how much detail is needed for the minor/micro release support... e.g. 3.1.x vs 3.2.x , vs 3.2.3 vs 3.2.4 etc. I'm confused about that.
E.g. in 24.0.0.1 (OpenLiberty/open-liberty#27276) we say we have support for 3.2 thinning
Maybe this needs a doc update too? Opened doc issue: OpenLiberty/docs#7284