quarkusio / quarkus

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

quarkus-neo4j requires docker even if devservices are disabled #22167

Closed rsvoboda closed 2 years ago

rsvoboda commented 2 years ago

Describe the bug

quarkus-neo4j requires docker even if devservices are disabled

mvn quarkus:dev -Dquarkus.devservices.enabled=false
...
2021-12-13 21:07:55,423 INFO  [com.git.doc.zer.sha.org.apa.hc.cli.htt.imp.cla.HttpRequestRetryExec] (ducttape-0) Recoverable I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:2375
2021-12-13 21:07:55,508 INFO  [org.tes.doc.DockerMachineClientProviderStrategy] (main) docker-machine executable was not found on PATH ([/Users/rsvoboda/.jbang/bin, /Users/rsvoboda/.sdkman/candidates/mvnd/current/bin, /Users/rsvoboda/.sdkman/candidates/maven/current/bin, /Users/rsvoboda/.sdkman/candidates/jbang/current/bin, /Users/rsvoboda/.sdkman/candidates/java/current/bin, /Users/rsvoboda/bin, /Users/rsvoboda/go/bin, /usr/local/opt/llvm/bin, /Applications/Visual Studio Code.app/Contents/Resources/app/bin, /usr/local/bin, /usr/bin, /bin, /usr/sbin, /sbin, /usr/local/munki, /Library/Apple/usr/bin])

2021-12-13 21:07:55,509 ERROR [org.tes.doc.DockerClientProviderStrategy] (main) Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
2021-12-13 21:07:55,509 ERROR [org.tes.doc.DockerClientProviderStrategy] (main)     UnixSocketClientProviderStrategy: failed with exception TimeoutException (Timeout waiting for result with exception). Root cause LastErrorException ([61] Connection refused)
2021-12-13 21:07:55,509 ERROR [org.tes.doc.DockerClientProviderStrategy] (main) As no valid configuration was found, execution cannot continue
...

Expected behavior

quarkus-neo4j DOES NOT requires docker when devservices are disabled

Actual behavior

quarkus-neo4j requires docker even if devservices are disabled

How to Reproduce?

Output of uname -a or ver

No response

Output of java -version

Java 17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.5.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.1

Additional information

No response

quarkus-bot[bot] commented 2 years ago

/cc @maxandersen, @michael-simons, @quarkusio/devtools, @stuartwdouglas

rsvoboda commented 2 years ago

mvn quarkus:dev -Dquarkus.devservices.enabled=false with docker available gives:

2021-12-13 21:22:08,464 INFO  [org.tes.doc.DockerClientProviderStrategy] (main) Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2021-12-13 21:22:08,803 INFO  [org.tes.doc.DockerClientProviderStrategy] (main) Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2021-12-13 21:22:08,804 INFO  [org.tes.DockerClientFactory] (main) Docker host IP address is localhost
2021-12-13 21:22:08,840 INFO  [org.tes.DockerClientFactory] (main) Connected to docker:
  Server Version: 20.10.8
  API Version: 1.41
  Operating System: Docker Desktop
  Total Memory: 7959 MB

2021-12-13 21:22:08,842 INFO  [org.tes.uti.ImageNameSubstitutor] (main) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2021-12-13 21:22:09,462 INFO  [org.tes.DockerClientFactory] (main) Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
2021-12-13 21:22:09,462 INFO  [org.tes.DockerClientFactory] (main) Checking the system...
2021-12-13 21:22:09,462 INFO  [org.tes.DockerClientFactory] (main) ✔︎ Docker server version should be at least 1.6.0
2021-12-13 21:22:09,575 INFO  [org.tes.DockerClientFactory] (main) ✔︎ Docker environment should have more than 2GB free disk space
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2021-12-13 21:22:10,678 INFO  [org.neo.dri.int.DriverFactory] (Quarkus Main Thread) Direct driver instance 1591354770 created for server address localhost:7687

2021-12-13 21:22:10,850 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.5.2.Final) started in 2.861s. Listening on: http://localhost:8080
2021-12-13 21:22:10,852 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-12-13 21:22:10,853 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, neo4j, resteasy, smallrye-context-propagation, vertx]
$ docker ps
CONTAINER ID   IMAGE                       COMMAND   CREATED          STATUS          PORTS                     NAMES
f53702429b84   testcontainers/ryuk:0.3.3   "/app"    44 seconds ago   Up 44 seconds   0.0.0.0:50153->8080/tcp   testcontainers-ryuk-8b83886f-ab36-47b6-ba28-b6ffcda5554d
michael-simons commented 2 years ago

Odd. Doesn’t isNormal catch this?

https://github.com/quarkusio/quarkus/blob/1e34199f2361c95dfce7060bab3afd735760645f/extensions/neo4j/deployment/src/main/java/io/quarkus/neo4j/deployment/Neo4jDevServicesProcessor.java#L50

michael-simons commented 2 years ago

Ok, it wasn't a great idea to put the IsDockerWorking check into the annotation.

I have created a PR against 2.5 (See #22168).

Could you please transport this patch to the https://github.com/quarkiverse/quarkus-neo4j version, @gsmet before 2.6 goes out, too? I won't manage this week to get a hold on how to release it, but I like it fixed, too. Thank you!!

gsmet commented 2 years ago

Fixed in https://github.com/quarkusio/quarkus/pull/22168 .