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

Make mutable-jar work with jib in all cases #15480

Merged
merged 1 commit into from
Mar 5, 2021
Merged

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Mar 4, 2021

Fixes: #15477

@geoand
Copy link
Contributor Author

geoand commented Mar 4, 2021

@mswiderski mind giving it a try please?

It worked fine for me

@mswiderski
Copy link
Contributor

Sure thing @geoand will take it first thing in the morning and let you know

@geoand
Copy link
Contributor Author

geoand commented Mar 4, 2021

Thanks

@mswiderski
Copy link
Contributor

@geoand I tried it and now container is build with the required files but it does not seem to start. Kubernetes is reporting it as running but there are no logs written by the container. When logging into the container itself it shows java process running but none of the app endpoints are accessible.

No idea how to trace what is going wrong there....

@geoand
Copy link
Contributor Author

geoand commented Mar 5, 2021

What happens when you run the container locally?
Do you have any logs in that case?

@mswiderski
Copy link
Contributor

same thing, no logs ... just hangs

as soon as I set -e QUARKUS_LAUNCH_DEVMODE=true then it results in such a hang. Without that it starts without issues

@geoand
Copy link
Contributor Author

geoand commented Mar 5, 2021

I'll have a look later on today.

Thanks for checking

@mswiderski
Copy link
Contributor

it's reproducible as well without docker/kube just do following

export QUARKUS_LAUNCH_DEVMODE=true
java -jar target/quarkus-app/quarkus-run.jar

and it hangs without any log message

And here is a threads that are active in the app via jconsole
image
looks bit short list ...

@geoand
Copy link
Contributor Author

geoand commented Mar 5, 2021

I can't reproduce the problem in either regular java -jar ... or docker run ....

Do you have a reproducer you could share?

@mswiderski
Copy link
Contributor

interesting ....

about reproducer it won't be easy as it relies on quite few unreleased yet version of different libraries... working on operator. Don't want you to build up everything from sources etc so maybe you could give me a hint where to start debugging (the bootstrap code) so maybe I could gather more info?

@geoand
Copy link
Contributor Author

geoand commented Mar 5, 2021

I would start debugging in QuarkusEntryPoint, move on to DevModeTask to see if the augmentation was performed properly and then see what IsolatedDevModeMain is doing

@mswiderski
Copy link
Contributor

Alright, debugging showed this exception when starting

java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.vertx.http.deployment.devmode.console.ConfigEditorProcessor#config threw an exception: java.lang.NullPointerException
	at io.quarkus.vertx.http.deployment.devmode.console.ConfigEditorProcessor.config(ConfigEditorProcessor.java:37)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:920)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

it is thrown from io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart when calling StartupAction start = augmentAction.createInitialRuntimeApplication();

here is the list of extensions in use

cdi, kubernetes, kubernetes-client, operator-sdk, resteasy, resteasy-jackson, security, smallrye-health, smallrye-openapi, swagger-ui

@geoand
Copy link
Contributor Author

geoand commented Mar 5, 2021

I was still not able to reproduce the problem with the extensions you mentioned.

Also ConfigEditorProcessor.java:37 is rather odd as I don't see how it can cause a NPE

@mswiderski
Copy link
Contributor

ok, correction when it comes to line number as I am running on top of 1.12.0.CR1 - https://github.com/quarkusio/quarkus/blob/1.12.0.CR1/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ConfigEditorProcessor.java#L37

and the failure is because of DevConsoleManager.getHotReplacementContext() return null

@geoand
Copy link
Contributor Author

geoand commented Mar 5, 2021

OK, that part has changed significatly. Would it possible for you to try master?

@mswiderski
Copy link
Contributor

most likely won't be that simple but will do so as it seems it has changed quite a bit. Will report back when done the testing on top of master

@mswiderski
Copy link
Contributor

@geoand anyway I think we can proceed with this PR to be merged as it does fix the container image build with jib for mutable-jar

the other issue I ran into is independent of this change. I can either post back the results here or on the mailing list thread.

@geoand
Copy link
Contributor Author

geoand commented Mar 5, 2021

I was going to propose the same :).

Feel free to post the results back here and then we can discuss how to proceed

@geoand geoand marked this pull request as ready for review March 5, 2021 12:42
@geoand geoand requested a review from gastaldi March 5, 2021 12:43
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.

LGTM

@geoand geoand added area/container-image triage/waiting-for-ci Ready to merge when CI successfully finishes triage/backport? labels Mar 5, 2021
@mswiderski
Copy link
Contributor

@geoand running on top of master I get this

2021-03-05 13:47:05,497 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to create compiler, runtime compilation will be unavailable: java.lang.NullPointerException
	at java.base/java.io.File.<init>(File.java:276)
	at io.quarkus.deployment.dev.ClassLoaderCompiler.lambda$new$0(ClassLoaderCompiler.java:149)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)
	at io.quarkus.deployment.dev.ClassLoaderCompiler.<init>(ClassLoaderCompiler.java:144)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.setupRuntimeCompilation(IsolatedDevModeMain.java:222)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:372)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:56)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:127)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:84)
	at io.quarkus.deployment.mutability.DevModeTask.main(DevModeTask.java:70)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.bootstrap.runner.DevModeMediator.doStart(DevModeMediator.java:50)
	at io.quarkus.bootstrap.runner.DevModeMediator.doDevMode(DevModeMediator.java:29)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:35)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:25)

@geoand
Copy link
Contributor Author

geoand commented Mar 5, 2021 via email

@mswiderski
Copy link
Contributor

@geoand here it is #15494

@famod
Copy link
Member

famod commented Mar 5, 2021

Offtopic: Can we leave this open for a little while? By chance I picked this PR to check how the incremental build is doing and in this case here it is building too much and I'm trying to understand why.
GIB is actually detecting a BOM change, which this PR doesn't have.
PULL_REQUEST_BASE yields d7a96af and I suppose this is where you started this change @geoand?

/cc @gsmet

Edit: I'll continue here: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Incremental.20build/near/228975996

This was referenced Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/container-image triage/waiting-for-ci Ready to merge when CI successfully finishes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for mutable-jar package format for container image extensions
5 participants