datacater icon indicating copy to clipboard operation
datacater copied to clipboard

Remote Development with Quarkus

Open ChrisRousey opened this issue 3 years ago • 8 comments

ChrisRousey avatar Feb 02 '23 10:02 ChrisRousey

Add folowing dependencies:

  1. quarkusDev 'io.quarkus:quarkus-minikube'
  2. ~quarkusDev 'io.quarkus:quarkus-container-image-docker'~ -> not needed, we use jib

Add variables to application.yml (if needed):

  1. quarkus.package.type=mutable-jar
  2. quarkus.live-reload.password=quarkus

change to minikube container registry eval $(minikube -p minikube docker-env)

build application with gradle, it will start in minikube ../gradlew build -x test -Dquarkus.kubernetes.deploy=true -Dquarkus.profile=dev

get your local minikube ip minikube ip

connect local agent to remote dev using minikube ip ./gradlew quarkusRemoteDev -Dquarkus.live-reload.url=http://minikube-ip:8080 -Dquarkus.profile=dev

ChrisRousey avatar Feb 02 '23 10:02 ChrisRousey

notes:

  • ~what should networking path be? needs to be set with variable quarkus.live-reload.url=http://my.cluster.host.com:8080~ ->set to minikube ip
  • ~need to add arg to start in dev mode~
  • ~Error in devmode: Exception in thread "main" java.nio.file.NoSuchFileException: /home/jboss/lib/deployment/deployment-class-path.dat~ wasn't starting with dev profile
  • when starting host instance in minikube, readiness probe failing, so local agent can't connect

ChrisRousey avatar Feb 02 '23 10:02 ChrisRousey

So it works, but the dev console is not available or it can not reload classes into the jar?

hknlof avatar Feb 02 '23 12:02 hknlof

@HknLof there was a bug because i wasn't starting the host in minikube with the dev profile.

only thing not working as of now is that the Readiness probe of the host is failing due to refused connection. Other than that i think it should work. I'm going to turn the Liveness/Readiness probes off for testing

ChrisRousey avatar Feb 02 '23 12:02 ChrisRousey

@HknLof it's not the probes causing the problems, but our filters and transforms paths are causing our app to fail when running remote.

ChrisRousey avatar Feb 02 '23 13:02 ChrisRousey

So we need to account for mounting the folder by adjusting the Dockerfile?

hknlof avatar Feb 02 '23 13:02 hknlof

That's my guess. We could have a look together on monday if you'd like.

ChrisRousey avatar Feb 02 '23 17:02 ChrisRousey

Currently, we are loading the images with load-image-k8s, that seems to be sufficient at this point. Closing!

hknlof avatar Apr 03 '23 08:04 hknlof