-
Notifications
You must be signed in to change notification settings - Fork 99
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
A way to tell the plugin to look at localhost for health checks. #97
Comments
Hi, the waiting for exposed TCP ports opening can be turned off using As CirceCI could be common use-case I would prefer to solve this issue by detection of CirceCI environment ( I read the documentation and I'm not sure if just changing to So it doesn't make any sense to execute docker-compose in the primary container because the executed services wouldn't be accessible from the primary container. The documentation doesn't says anything about exposing the TCP ports back to the primary container. So the recommendation is to execute also the Gradle build in the remote Docker - then it should work as usual. Or do you have any other idea how to solve it? |
Thanks for that! So the documentation on CircleCI is a little misleading. The containers run But - if I run a docker container as part of my build, IT can't see those containers. So what I'm doing is composing my DB, API, and Client inside my build container, so they can talk to eachother quite happily The caveat here is that they run on a remote host (thanks to the way CircleCI works), so whilst they can see eachother, I can only access their TCP ports on "localhost" as viewed from my build. So what I was thinking is here: gradle-docker-compose-plugin/src/main/groovy/com/avast/gradle/dockercompose/tasks/ComposeUp.groovy Line 217 in ce2e78c
Splitting the concept of DOCKER_HOST and SERVICE_HOST, if SERVICE_HOST is defined. Which I think its fine because there is no rule to say that services are always exposed on the DOCKER_HOST. What this would mean is that I could specify: DOCKER_HOST=tcp://xxx.yyy.zzz.qqq # defined by CIRCLECI
SERVICE_HOST=localhost # defined by me. in my build, so that checks and system properties relating to containers could use SERVICE_HOST, if available. What do you think? |
I like the idea of separation of DOCKER_HOST and SERVICE_HOST. The last problem we must handle is to choose to right port to use. It's defined in this code: gradle-docker-compose-plugin/src/main/groovy/com/avast/gradle/dockercompose/tasks/ComposeUp.groovy Line 254 in ce2e78c
Can you please check how the ports are exposed? E.g. if a service exposes port 80 on port 8080, then the service is available on |
That's right - it just uses the default port mappings :) |
So I prepared this PR. Could you please check if it's what you are expecting? |
You are a software machine! I'll have a look asap.
…On Mon, 4 Sep 2017, 17:53 Michal Augustýn ***@***.***> wrote:
So I prepared this PR
<#98>. Could
you please check if it's what you are expecting?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANXRbc_-BI2WRlbMmtIydZtcvilz3ZDks5sfCsKgaJpZM4PLsHj>
.
|
I will release a new version ASAP, it will be |
Hi,
I've been using your plugin for a while, very successfully on CircleCI 1.0
However, we're now moving to CircleCI 2.0 which doesn't allow you to run your own docker instance - instead, it runs a remote one for you and when you compose containers, they run on a remote host.
The problem is, the build itself on CircleCI also runs in a docker container, and that container cannot directly reach the remote docker host. What happens is that CircleCI binds all exposed ports to the build container.
As a result my healthcheck output is as follows:
So the plugin correctly detects the remote host, but isn't aware that CircleCI has made the service TCP ports accessible on 'localhost' instead.
Looking at the source, I can't see a way to tell the plugin:
detect the remote docker instance, but expect the ports to be bound on xxx.yyy (or localhost)
I'm wondering about turning the healthcheck off and doing it manually for now, but it's not ideal.
The text was updated successfully, but these errors were encountered: