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

Support for java 17 in generated projects - Codestarts #20849

Merged

Conversation

netodevel
Copy link
Contributor

@netodevel netodevel commented Oct 18, 2021

Fixes #20752

@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform labels Oct 18, 2021
@netodevel netodevel changed the title WIP: Netodevel/fixs codestart target java WIP: Fixs codestart target java Oct 18, 2021
@ia3andy
Copy link
Contributor

ia3andy commented Oct 19, 2021

It looks pretty good, don't forget to squash it to 1 commit

@netodevel
Copy link
Contributor Author

@ia3andy,

Thanks for the quick review, but it's still on WIP. I will do some more testing as soon as i finish i notice for a second review

@ia3andy ia3andy changed the title WIP: Fixs codestart target java Support for java 17 in generated projects - Codestarts (WIP) Oct 26, 2021
@maxandersen maxandersen mentioned this pull request Nov 16, 2021
11 tasks
@ia3andy
Copy link
Contributor

ia3andy commented Nov 19, 2021

@netodevel the JDK 17 is now available. Instead of installing the package, we are going to use a different base image (as suggested by @cescoffier on zulip):

####
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
#
# Before building the container image run:
#
# ./mvnw package
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/getting-started-jvm .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/getting-started-jvm
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005) like this :  EXPOSE 8080 5050
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/getting-started-jvm
#
###
FROM registry.redhat.io/ubi8/openjdk-17-runtime:1.10-5

ARG RUN_JAVA_VERSION=1.3.8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
# We make four distinct layers so if there are application changes the library layers can be re-used
COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=185 target/quarkus-app/*.jar /deployments/
COPY --chown=185 target/quarkus-app/app/ /deployments/app/
COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/

EXPOSE 8080
USER 185

ENTRYPOINT [ "java", "-jar", "/deployments/quarkus-run.jar" ]

We should also use a openjdk runtime base image for previous versions.

As this is a priority, if you are not available, I will continue the dev for this later today on this PR (but you'll keep the credit for your work of course), let me know..

@ia3andy
Copy link
Contributor

ia3andy commented Nov 19, 2021

I prepared a commit with the changes: ia3andy@fdf6124

But it seems that jdk 17 is on a different repository registry.redhat.io which has an extra layer of security:
https://catalog.redhat.com/software/containers/ubi8/openjdk-17-runtime/618bdc5f843af1624c4e4ba8?container-tabs=gti&gti-tabs=registry-tokens

IMO having to login or use a token to pull the image is a blocker.

cc @maxandersen @cescoffier

@ia3andy
Copy link
Contributor

ia3andy commented Nov 22, 2021

I pushed my commit, this PR needs to be squashed and rebased from main.

Java 17 Runtime is in the process of being pushed to the unauthenticated repository:
https://issues.redhat.com/browse/CLOUDDST-10475

This PR will have to wait for this registry.access.redhat.com/ubi8/openjdk-17-runtime to be available.

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 22, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 8c32b9a

Status Name Step Failures Logs Raw logs
JVM Tests - JDK 11 Build Failures Logs Raw logs
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
JVM Tests - JDK 17 Build Failures Logs Raw logs
MicroProfile TCKs Tests Verify ⚠️ Check → Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 11 #

- Failing: independent-projects/tools/devtools-testing 
! Skipped: devtools/cli devtools/gradle/gradle-application-plugin devtools/gradle/gradle-model and 5 more

📦 independent-projects/tools/devtools-testing

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyJavaCustom(TestInfo) line 75 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyScalaCustom(TestInfo) line 157 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenDefaultJava(TestInfo) line 185 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenConfigYamlJava(TestInfo) line 223 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenResteasyJava(TestInfo) line 204 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyKotlinCustom(TestInfo) line 124 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

⚙️ JVM Tests - JDK 11 Windows #

- Failing: independent-projects/tools/devtools-testing 
! Skipped: devtools/cli devtools/gradle/gradle-application-plugin devtools/gradle/gradle-model and 5 more

📦 independent-projects/tools/devtools-testing

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyJavaCustom(TestInfo) line 75 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyScalaCustom(TestInfo) line 157 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenDefaultJava(TestInfo) line 185 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenConfigYamlJava(TestInfo) line 223 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenResteasyJava(TestInfo) line 204 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyKotlinCustom(TestInfo) line 124 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

⚙️ JVM Tests - JDK 17 #

- Failing: independent-projects/tools/devtools-testing 
! Skipped: devtools/cli devtools/gradle/gradle-application-plugin devtools/gradle/gradle-model and 5 more

📦 independent-projects/tools/devtools-testing

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyJavaCustom(TestInfo) line 75 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyScalaCustom(TestInfo) line 157 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenDefaultJava(TestInfo) line 185 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenConfigYamlJava(TestInfo) line 223 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenResteasyJava(TestInfo) line 204 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyKotlinCustom(TestInfo) line 124 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

@netodevel netodevel force-pushed the netodevel/fixs-codestart-target-java branch from e17db85 to 1865ac8 Compare November 22, 2021 23:11
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 22, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 1865ac8

Status Name Step Failures Logs Raw logs
Initial JDK 11 Build Build Failures Logs Raw logs

Failures

⚙️ Initial JDK 11 Build #

- Failing: independent-projects/tools/devtools-common 
! Skipped: core/deployment core/test-extension/deployment core/test-extension/runtime and 640 more

📦 independent-projects/tools/devtools-common

Failed to execute goal net.revelc.code:impsort-maven-plugin:1.6.2:check (check-imports) on project quarkus-devtools-common: Imports are not sorted in /home/runner/work/quarkus/quarkus/independent-projects/tools/devtools-common/src/test/java/io/quarkus/devtools/project/codegen/CreateProjectHelperTest.java

@ia3andy
Copy link
Contributor

ia3andy commented Nov 23, 2021

@netodevel you need to run mvn process-sources to format the files and fix the build.

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 23, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building c338e50

Status Name Step Failures Logs Raw logs
JVM Tests - JDK 11 Build Failures Logs Raw logs
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
JVM Tests - JDK 17 Build ⚠️ Check → Logs Raw logs

Full information is available in the Build summary check run.

⚠️ Errors occurred while downloading the build reports. This report is incomplete.

Failures

⚙️ JVM Tests - JDK 11 #

- Failing: independent-projects/tools/devtools-testing 
! Skipped: devtools/cli devtools/gradle/gradle-application-plugin devtools/gradle/gradle-model and 5 more

📦 independent-projects/tools/devtools-testing

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyJavaCustom(TestInfo) line 75 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyScalaCustom(TestInfo) line 157 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenDefaultJava(TestInfo) line 185 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenConfigYamlJava(TestInfo) line 223 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenResteasyJava(TestInfo) line 204 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyKotlinCustom(TestInfo) line 124 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

⚙️ JVM Tests - JDK 11 Windows #

- Failing: independent-projects/tools/devtools-testing 
! Skipped: devtools/cli devtools/gradle/gradle-application-plugin devtools/gradle/gradle-model and 5 more

📦 independent-projects/tools/devtools-testing

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyJavaCustom(TestInfo) line 75 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyScalaCustom(TestInfo) line 157 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenDefaultJava(TestInfo) line 185 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenConfigYamlJava(TestInfo) line 223 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateMavenResteasyJava(TestInfo) line 204 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartGenerationTest.generateRESTEasyKotlinCustom(TestInfo) line 124 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting actual:

@ia3andy
Copy link
Contributor

ia3andy commented Nov 23, 2021

It seems you need to fix the tests snapshot files (by running them with -Dsnap)

@netodevel netodevel force-pushed the netodevel/fixs-codestart-target-java branch from 02ec0e9 to 86030b3 Compare November 24, 2021 00:32
Adding support to java versions lts
Updated template of builds for support java 17
Fixs imports
Remove sysout
Change codestart dockerfiles to use openjdk-xx-runtime
Remove no longer needed RUN_JAVA_VERSION
Fixs code formatting
Fixs of code review
Remove the conversion to integer from the java_version
Remove java 8 and set java 11 to default
Fixs tests of codestarts generation
@netodevel netodevel force-pushed the netodevel/fixs-codestart-target-java branch from 345b2a5 to c24179a Compare November 24, 2021 19:38
Copy link
Contributor

@gastaldi gastaldi 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 to me! Great job!

@netodevel netodevel changed the title Support for java 17 in generated projects - Codestarts (WIP) Support for java 17 in generated projects - Codestarts Nov 24, 2021
Copy link
Contributor

@ia3andy ia3andy left a comment

Choose a reason for hiding this comment

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

I think we are good to go.

Thanks a lot @netodevel!!! This was not an easy one to take to completion 🍾🥳

@ia3andy
Copy link
Contributor

ia3andy commented Nov 25, 2021

If we have problems we can always iterate from this..

@ia3andy ia3andy merged commit fbdcec8 into quarkusio:main Nov 25, 2021
@quarkus-bot quarkus-bot bot added this to the 2.6 - main milestone Nov 25, 2021
@netodevel
Copy link
Contributor Author

@ia3andy, Thanks a lot for all the help you gave me :)

@geoand
Copy link
Contributor

geoand commented Dec 10, 2021

IIUC, the base image has been changed, correct? If so, this is a breaking change and we should label it as such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform release/noteworthy-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java 17 is not reflected as source/target of generated project
8 participants