quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

Standardized config property for devservices participating in container reuse #25474

Open knutwannheden opened 2 years ago

knutwannheden commented 2 years ago

Description

As of #25367 Quarkus datasource devservices will get reused when Testcontainers has been configured correspondingly (testcontainers.reuse.enable=true in ~/.testcontainers.properties).

I think it would make sense to also allow other slow-starting devservices to "participate" in this. I would thus like to propose that the standard devservices config group, which already has a few standard config properties (enabled, image-name, port, shared, service-name) is extended with a new property for container reuse. Something like reuse-enabled with a default of true. This "standard" config property would of course have to be explicitly added to all extensions providing a devservice, where it conceivably makes sense with container reuse and ultimately this would allow the developer to selectively exclude certain devservices from being reused.

Some devservices should probably either not declare this config property or possibly even set the default to false.

Implementation ideas

No response

quarkus-bot[bot] commented 2 years ago

/cc @stuartwdouglas

knutwannheden commented 2 years ago

/cc @Sanne

Sanne commented 2 years ago

It's a great idea - no objections, but bear in mind that in several cases we're using the container definition from Testcontainers, which don't consistently allow for container reuse. And even when they do, we'd need to override each container definition to control the flag. Might be worth the work though, we can then most likely tune other aspects more easily as well.