Hi Everyone,
I have been working on a feature at [1] that allows for any image to be
used as a Devservice.
cool.
I think the easiest way to explain it is with a few examples. Say I wanted
to start an image that exposed a REST API and automatically wire up my MP
REST client to talk to it, I would do the following:quarkus.devservices.custom.test.image=stuart/getting-started:1.0.0-SNAPSHOT
quarkus.devservices.custom.test.url-prefix=http://
quarkus.devservices.custom.test.ports=8080
org.acme.rest.client.GreetingService/mp-rest/url=${quarkus.devservices.custom.test.url}The first line gives us the image name ('test' is an arbitrary name, you
can have any number of these, and they are started alphabetically). The
second line is used to build the url, and the third line tells Quarkus the
port to expose. The file line actually wires up the REST client to use the
resulting URL after Quarkus has started.
a) should we be able to specify a command to run natively rather than "only" in a container via image ? maybe refer to maven artifact to run ?
b) should http:// prefer for these devservices not just be http:// by default ?
c) the port assignment should be random should it not to avoid conflicts ? also you'll need a port mapping from container to host port won't you ?
d) would it make sense to be able to refer to metadata on the container to expose to quarkus beyond just the port for url building ?
Let's look at a slightly more complex example, say I want to start a
Quarkus application as a dev service that uses a database, but I want it to
share the current applications devservices managed database, I would do the
following:quarkus.devservices.custom.test.image=stuart/hibernate-orm-quickstart:1.0.0-SNAPSHOT
quarkus.devservices.custom.test.env.QUARKUS_DATASOURCE_JDBC_URL=[quarkus.datasource.jdbc.url]
quarkus.devservices.custom.test.env.QUARKUS_DATASOURCE_PASSWORD=[quarkus.datasource.password]
quarkus.devservices.custom.test.env.QUARKUS_DATASOURCE_USERNAME=[quarkus.datasource.username]As above the first line is the image name, but the subsequent lines set
environment variables to the properties that were set by the database
devservice. This uses a different syntax to our normal expansions, as this
is not actually part of the config system (it's not really build or runtime
config, it's config that becomes available as containers are started).
you mean the key quarkus.devservices.custom.* is part of the config system but the value [quarkus.datasource.password] is to be resolved lazily later. Makes sense ....not a super fan of alternate syntax ....could we just have it be escape ? \${quarkus...} or use $[quarkus...] to say ${} is resolved eagerly and $[] is lazily/later ?
This is not 100% complete (e.g. if you tried the example above with Kafka
instead it won't work just yet), however I thought I would gather some
feedback before I put the finishing touches on it and start writing tests
and docs.
Looks interesting for sure.
/max
Stuart
[1] https://github.com/stuartwdouglas/quarkus/tree/generic-devservices
--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2cxLYhr%3Dq1MeKAYrAPAGjK63-vODPdAgwFtDOKnJmG%2BNxA%40mail.gmail.com.
Hi Everyone,
I have been working on a feature at [1] that allows for any image to be
used as a Devservice.cool.
I think the easiest way to explain it is with a few examples. Say I wanted
to start an image that exposed a REST API and automatically wire up my MP
REST client to talk to it, I would do the following:quarkus.devservices.custom.test.image=stuart/getting-started:1.0.0-SNAPSHOT
quarkus.devservices.custom.test.url-prefix=http://
quarkus.devservices.custom.test.ports=8080
org.acme.rest.client.GreetingService/mp-rest/url=${quarkus.devservices.custom.test.url}The first line gives us the image name ('test' is an arbitrary name, you
can have any number of these, and they are started alphabetically). The
second line is used to build the url, and the third line tells Quarkus the
port to expose. The file line actually wires up the REST client to use the
resulting URL after Quarkus has started.a) should we be able to specify a command to run natively rather than "only" in a container via image ? maybe refer to maven artifact to run ?
b) should http:// prefer for these devservices not just be
http://by default ?
c) the port assignment should be random should it not to avoid conflicts ? also you'll need a port mapping from container to host port won't you ?
d) would it make sense to be able to refer to metadata on the container to expose to quarkus beyond just the port for url building ?
Let's look at a slightly more complex example, say I want to start a
Quarkus application as a dev service that uses a database, but I want it to
share the current applications devservices managed database, I would do the
following:quarkus.devservices.custom.test.image=stuart/hibernate-orm-quickstart:1.0.0-SNAPSHOT
quarkus.devservices.custom.test.env.QUARKUS_DATASOURCE_JDBC_URL=[quarkus.datasource.jdbc.url]
quarkus.devservices.custom.test.env.QUARKUS_DATASOURCE_PASSWORD=[quarkus.datasource.password]
quarkus.devservices.custom.test.env.QUARKUS_DATASOURCE_USERNAME=[quarkus.datasource.username]As above the first line is the image name, but the subsequent lines set
environment variables to the properties that were set by the database
devservice. This uses a different syntax to our normal expansions, as this
is not actually part of the config system (it's not really build or runtime
config, it's config that becomes available as containers are started).you mean the key
quarkus.devservices.custom.*is part of the config system but the value[quarkus.datasource.password]is to be resolved lazily later. Makes sense ....not a super fan of alternate syntax ....could we just have it be escape ?\${quarkus...}or use$[quarkus...]to say${}is resolved eagerly and$[]is lazily/later ?
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2cwHWLY1Cskw%2BhKbHwZP74KT1%3DJ8tTYkS47NUwGf_9Kwmw%40mail.gmail.com.
Potentially if the other project is also a quarkus project we could also generate metadata based on that projects devservices info, and use it to auto connect stuff with no configuration (in a similar manner to what we already do with label based discovery).
You do know we kinda already do deploy to openshift and you don’t need to do anything, right ? :)
Yes this custom dev service overlaps with docker compose but that is what testcontainers are. Automated docker compose for app development as opposed to generic anything docker compose.
Can't you do this kind of stuff with docker compose?
On Fri, Oct 1, 2021 at 4:12 AM Stuart Douglas <sdou...@redhat.com> wrote:Potentially if the other project is also a quarkus project we could also generate metadata based on that projects devservices info, and use it to auto connect stuff with no configuration (in a similar manner to what we already do with label based discovery).I think this is the more interesting idea of Quarkus automatically publishing configuration points for auto wiring in a docker/kube environment. Then somebody does not have to define the container and can just deploy the Quarkus app. The idea I had awhile ago was a kube/openshift deployment service for quarkus that would allow you to take the container out of the equation and punt it so that "we" Red Hat could control the container and take one step out of the dev process.
But, I'm pretty sure the other composition stuff you are doing already exists, specifically with Docker Compose. And you can always define a set of services for Kube/Openshift too. What you're doing seems a bit redundant.
--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2czT6MRAvcnaKhsxow0JSGyCtWS0t8QhnCQV-gPBGmbusQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/018cf2a7-d809-41ba-9d9d-27533b1cee4f%40Spark.
There already are some labels used on containers for figuring out debug options we could look at but wonder what other “good default decisions” you had coming to mind ?
Btw. I was assuming if we were launching quarkus apps as maven artifacts we would just do it “raw” without container layer in between. Wouldn’t that be simpler ?
Stuart--Bill BurkeRed Hat
--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2czT6MRAvcnaKhsxow0JSGyCtWS0t8QhnCQV-gPBGmbusQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAMsYBfU1F0W2%2B2MSROXNfFc7ipjkyw-i5jvP6ooOT%3DqM3sahLA%40mail.gmail.com.
Dev services for dedicated/dependent/isloated DBsome other appliance makes a lot of sense, but this can get quite unwieldy very quickly if you start pulling in other microservices. Think > 5 microservices running locally all with their own DBs. Also think about cross-team microservices where you'd have to learn all about how to configure it and you'd be susceptible to changes you might not be aware of.FYI: I'm just adding general skepticism to add feedback. I've worked in an environment with many inter dependent microservices and it was very hard to impossible to clone the environment beyond a dedicated TEST bed. And was impossible to do integration tests locally without pointing your microservice to the TEST environment.
On Fri, 8 Oct 2021 at 06:54, William Burke <bbu...@redhat.com> wrote:Dev services for dedicated/dependent/isloated DBsome other appliance makes a lot of sense, but this can get quite unwieldy very quickly if you start pulling in other microservices. Think > 5 microservices running locally all with their own DBs. Also think about cross-team microservices where you'd have to learn all about how to configure it and you'd be susceptible to changes you might not be aware of.FYI: I'm just adding general skepticism to add feedback. I've worked in an environment with many inter dependent microservices and it was very hard to impossible to clone the environment beyond a dedicated TEST bed. And was impossible to do integration tests locally without pointing your microservice to the TEST environment.I know what you mean, and longer term this is exactly the problem I think we should try and solve. Live reload, continuous testing and devservices are great, but they don't help at all if the only way to actually test your change is to package it up and send it to a staging environment.
On Fri, 8 Oct 2021 at 06:54, William Burke <bbu...@redhat.com> wrote:Dev services for dedicated/dependent/isloated DBsome other appliance makes a lot of sense, but this can get quite unwieldy very quickly if you start pulling in other microservices. Think > 5 microservices running locally all with their own DBs. Also think about cross-team microservices where you'd have to learn all about how to configure it and you'd be susceptible to changes you might not be aware of.FYI: I'm just adding general skepticism to add feedback. I've worked in an environment with many inter dependent microservices and it was very hard to impossible to clone the environment beyond a dedicated TEST bed. And was impossible to do integration tests locally without pointing your microservice to the TEST environment.I know what you mean, and longer term this is exactly the problem I think we should try and solve. Live reload, continuous testing and devservices are great, but they don't help at all if the only way to actually test your change is to package it up and send it to a staging environment.
On Thu, Oct 7, 2021 at 8:09 PM Stuart Douglas <sdou...@redhat.com> wrote:On Fri, 8 Oct 2021 at 06:54, William Burke <bbu...@redhat.com> wrote:Dev services for dedicated/dependent/isloated DBsome other appliance makes a lot of sense, but this can get quite unwieldy very quickly if you start pulling in other microservices. Think > 5 microservices running locally all with their own DBs. Also think about cross-team microservices where you'd have to learn all about how to configure it and you'd be susceptible to changes you might not be aware of.FYI: I'm just adding general skepticism to add feedback. I've worked in an environment with many inter dependent microservices and it was very hard to impossible to clone the environment beyond a dedicated TEST bed. And was impossible to do integration tests locally without pointing your microservice to the TEST environment.I know what you mean, and longer term this is exactly the problem I think we should try and solve. Live reload, continuous testing and devservices are great, but they don't help at all if the only way to actually test your change is to package it up and send it to a staging environment.CONTRACT TESTING.Can we please try to solve this by working through an easier-to-consume pact testing system than trying to stand up actual instances of other services?