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

Introduce DevServices in quarkus:run Maven goal #40270

Closed
geoand opened this issue Apr 25, 2024 · 18 comments · Fixed by #40273
Closed

Introduce DevServices in quarkus:run Maven goal #40270

geoand opened this issue Apr 25, 2024 · 18 comments · Fixed by #40273
Labels
area/devservices area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven kind/enhancement New feature or request
Milestone

Comments

@geoand
Copy link
Contributor

geoand commented Apr 25, 2024

Description

Currently mvn quarkus:run simply runs the built artifact, but it would be very handy if it also setup DevServices in a similar manner as @QuarkusIntegrationTest does.

Implementation ideas

No response

@geoand geoand added kind/enhancement New feature or request area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins labels Apr 25, 2024
Copy link

quarkus-bot bot commented Apr 25, 2024

/cc @quarkusio/devtools (maven), @stuartwdouglas (devservices)

geoand added a commit to geoand/quarkus that referenced this issue Apr 25, 2024
geoand added a commit to geoand/quarkus that referenced this issue Apr 25, 2024
@geoand
Copy link
Contributor Author

geoand commented Apr 25, 2024

@aloubyansky I opened #40273 as a draft. It's pretty hacky, but I don't see really see a better way around it given how quarkus:run is meant to work

geoand added a commit to geoand/quarkus that referenced this issue Apr 25, 2024
geoand added a commit to geoand/quarkus that referenced this issue Apr 25, 2024
aloubyansky added a commit that referenced this issue Apr 25, 2024
Allow quarkus:run to launch DevServices
@quarkus-bot quarkus-bot bot added this to the 3.11 - main milestone Apr 25, 2024
@maxandersen
Copy link
Member

How do I as user turn this on/off ?

The main idea of quarkus:run is to have something closer to prod meaning hooking up docker functionality is not (always) wanted.

@geoand
Copy link
Contributor Author

geoand commented Apr 26, 2024

How do I as user turn this on/off ?

The same way you would for regular dev services, i.e. you provide the appropriate configuration option.

@aloubyansky
Copy link
Member

We should have some doc about it

@geoand
Copy link
Contributor Author

geoand commented Apr 26, 2024

Seems like it it's only documented in Azure Functions, so we should probably document it in the Maven and Gradle guides

@maxandersen
Copy link
Member

How do I as user turn this on/off ?

The same way you would for regular dev services, i.e. you provide the appropriate configuration option.

But that then impliess to me that when I use Quarkus:run there is "stuff" added to the classpath and startup that would not be present when I do jar run?

This should imo be a deliberate choice or at least be possible to completely turn off as I wouldn't otherwise be able to test how the Quarkus run behaves in prod like setup.

@maxandersen
Copy link
Member

Ie. Quarkus run should fail fast rather than spend time hooking up to docker (which can be quite slow!).

It could then show command option to run to enable those services ? WDYT?

@maxandersen
Copy link
Member

Alternative - make a devrun action.

@geoand
Copy link
Contributor Author

geoand commented Apr 26, 2024

But that then impliess to me that when I use Quarkus:run there is "stuff" added to the classpath and startup that would not be present when I do jar run?

Not true

@geoand
Copy link
Contributor Author

geoand commented Apr 26, 2024

The mechanism is the same as used in @QuarkusIntegrationTest where DevServices are started and then their configuration is used to set system properties for the production jar.

@maxandersen
Copy link
Member

So the wiring up start of services is done outside the actually run Quarkus process ?

@geoand
Copy link
Contributor Author

geoand commented Apr 26, 2024

Yes

@maxandersen
Copy link
Member

okey, but still should have a way to turn this explicit off IMO. I would even suggest it is something that should be turned on.

quarkus:run is supposed to fail/start fast and get as close to same behavior as a jar run.

@geoand
Copy link
Contributor Author

geoand commented Apr 26, 2024

I don't really agree, as it makes quarkus:run pretty unusable, but I don't care enough about it to fight this too much

@gsmet
Copy link
Member

gsmet commented Apr 26, 2024

I'm also not convinced it's a good idea. Dev Services were specifically designed for dev mode and I wouldn't expect them to run for quarkus:run. If you want Dev Services, just run in dev mode.

@geoand
Copy link
Contributor Author

geoand commented Apr 26, 2024

Dev Services were specifically designed for dev mode

That same argument could have been used against their use in @QuarkusIntegrationTest yet they work remarkably well in that case too.

@geoand
Copy link
Contributor Author

geoand commented Apr 26, 2024

We can always make this opt-in

poldinik pushed a commit to poldinik/quarkus that referenced this issue Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devservices area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants