Skip to content
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

Utilize docker-compose for orchestrating the example cluster. #25

Closed
wants to merge 7 commits into from
Closed

Conversation

tkaemming
Copy link
Contributor

This makes it a bit easier to start and stop (and destroy) the linked containers for the test environment, and makes the user-defined flags such as --topic a bit more obvious, since they're not alongside the networking topology flags like --link.

Also, it should also be possible to use the build attribute to build the confluent/bottledwater:0.1 and confluent/postgres-bw:0.1 images (for the bottledwater and postgres services, respectively) from the local repository, rather than pulling from Docker Hub. This would make it a little bit easier to hack on the internals, since you would not have to repeatedly build and tag new images independently during development. I'd be happy to take the time to adjust the build Dockerfiles to make that work, if you're interested.

@ghost
Copy link

ghost commented Jul 25, 2015

It looks like @tkaemming hasn't signed our Contributor License Agreement, yet.

Appreciation of efforts,

clabot

@tkaemming tkaemming changed the title Utilize docker-compose for orchestrating example cluster. Utilize docker-compose for orchestrating the example cluster. Jul 25, 2015
@wanghaisheng
Copy link

@tkaemming Sir i edit the Dockerfile.client to build my custom client

# Builds a docker image for the Bottled Water client.
# Expects links to "postgres", "kafka" and "schema-registry" containers.
#
# Usage:
#
#   docker build -f build/Dockerfile.client -t confluent/bottledwater:0.1 .
#   docker run -d --name bottledwater --link postgres:postgres --link kafka:kafka --link schema-registry:schema-registry confluent/bottledwater:0.1

FROM postgres:9.4

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y libcurl3 libjansson4 libpq5

ADD avro-1.7.7.tar.gz /
ADD librdkafka-0.8.6.tar.gz /
ADD bottledwater-bin.tar.gz /

RUN cp /usr/local/lib/librdkafka.so.1 /usr/lib/x86_64-linux-gnu && \
    cp /usr/local/lib/libavro.so.22.0.0 /usr/lib/x86_64-linux-gnu

#CMD /usr/local/bin/bottledwater \
#    --postgres "hostaddr=${POSTGRES_PORT_5432_TCP_ADDR} port=${POSTGRES_PORT_5432_TCP_PORT} dbname=fhirbase user=fhirbase" \
#    --broker ${KAFKA_PORT_9092_TCP_ADDR}:${KAFKA_PORT_9092_TCP_PORT} \
#    --schema-registry http://${SCHEMA_REGISTRY_PORT_8081_TCP_ADDR}:${SCHEMA_REGISTRY_PORT_8081_TCP_PORT}

CMD /usr/local/bin/bottledwater \
        --postgres "hostaddr=192.168.59.103 port=5432 dbname=fhirbase user=fhirbase" \
        --broker 192.168.59.103:9092 \
        --schema-registry http://192.168.59.103:8081

i can successfully build image like this
docker build -f build/Dockerfile.client -t edwin/fhirbase-bottledwater:0.1 .
but when i run docker-compose run --rm -d bottledwater ,it failed
when i docker logs id it says
/usr/local/bin/bottledwater: Connection to database failed: fe_sendauth: no password supplied

@tkaemming
Copy link
Contributor Author

@wanghaisheng I'm not exactly sure what that has to do with this pull request, but you're missing a connection password that is required for whatever database you're attempting to connect to. There are a bunch of ways to fix this, mounting a ~/.pgpass file to the container is probably one of the better ones: http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html

As an aside for the maintainer(s), with regard to the CLA message above: I'm perfectly happy to sign it, but I'm not sure where to do so.

@wanghaisheng
Copy link

@tkaemming thx for your point, after a little dig into the source code ,I figure out it "--postgres" param format could be "postgres://user:pass@host:port/dbname " it works now

@gonzalo-bulnes
Copy link
Contributor

Hi @tkaemming, the @ConfluentCLABot used to provide more details about the CLA, and you can find instructions for reading the CLA (and eventually signing it) in this comment.


You can run `docker logs bottledwater` to see what it's doing. Now Bottled Water has taken
You can run `docker-compose logs bottledwater` to see what it's doing. Now Bottled Water has taken
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkaemming I used the docker-compose'd demo yesterday, following the instructions that you updated in the README.

(I think that using Docker Compose actually does simplify the demo, and that the docker-compose.yml file does help understanding how the pieces are linked together. That's great!)

Also, I noticed something I think may be an error:

  • (sudo) docker-compose logs bottledwater raises the following error: Error response from daemon: no such id: bottledwater
  • (sudo) docker-compose logs bottledwaterpg_bottledwater_run_1, on the other hand, prints the logs as expected

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting… I don't get an error as you do trying to get the logs — however, I don't get any log output, either! Interrogating the container directly via docker logs works, as does docker bottledwaterpg_bottledwater_run_1.

In either case, I suppose docker-compose up -d bottledwater would be more appropriate than docker-compose run here and that also fixes the log issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes a lot of sense @tkaemming !

@tkaemming
Copy link
Contributor Author

[clabot:check]

@ghost
Copy link

ghost commented Oct 1, 2015

@confluentinc It looks like @tkaemming just signed our Contributor License Agreement. 👍

Always at your service,

clabot

This starts it as a service, rather than a one-off command, which is
more appropriate, and enables easier access to log output, etc.
@tkaemming
Copy link
Contributor Author

Closing, as this has been supplanted by #62.

@tkaemming tkaemming closed this Mar 29, 2016
@samstokes
Copy link
Contributor

@tkaemming Hi, I was in a hurry yesterday, but wanted to say thanks for your work on this! Hope you don't mind that I ended up reimplementing it. I did make an effort to compare them and see if I could build on top of your branch instead of redoing from scratch, but that proved tricky due to a combination of bitrot and superficial differences, and I have another large PR about to land that depends on my version. You definitely led the way here though.

@tkaemming
Copy link
Contributor Author

No problem — happy to see the project continuing to move forward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants