-
Notifications
You must be signed in to change notification settings - Fork 705
Minor improvements #6
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM confluentinc/base | ||
|
||
ENV COMPONENT=kafka-rest | ||
|
||
# default listener | ||
EXPOSE 8082 | ||
|
||
RUN echo "===> installing ${COMPONENT}..." \ | ||
&& apt-get update && apt-get install -y confluent-${COMPONENT} \ | ||
&& echo "===> clean up ..." \ | ||
&& apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* \ | ||
&& echo "===> Setting up ${COMPONENT} dirs" \ | ||
&& chmod -R ag+w /etc/${COMPONENT} | ||
|
||
COPY include/etc/confluent/docker /etc/confluent/docker | ||
|
||
CMD ["/etc/confluent/docker/run"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset \ | ||
-o errexit \ | ||
-o verbose \ | ||
-o xtrace | ||
|
||
dub ensure ZOOKEEPER_CONNECT | ||
dub ensure SCHEMA_REGISTERY_URL | ||
|
||
dub path /etc/${COMPONENT}/ writable | ||
|
||
dub template "/etc/confluent/docker/${COMPONENT}.properties.template" "/etc/${COMPONENT}/${COMPONENT}.properties" | ||
dub template "/etc/confluent/docker/log4j.properties.template" "/etc/${COMPONENT}/log4j.properties" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset \ | ||
-o errexit \ | ||
-o verbose \ | ||
-o xtrace | ||
|
||
echo "===> Check if Zookeeper is healthy ..." | ||
cub zk-ready $ZOOKEEPER_CONNECT 20 10 2 | ||
|
||
echo "===> Check if Kafka is healthy ..." | ||
cub kafka-ready $ZOOKEEPER_CONNECT 1 20 10 2 | ||
|
||
|
||
: <<'TODO' | ||
echo "==> Check if Schema Registry is healthy ..." | ||
cub schema_registry-ready $SCHEMA_REGISTRY_URL 20 10 2 | ||
TODO | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
{# required properties #} | ||
zookeeper.connect={{env['ZOOKEEPER_CONNECT']}} | ||
schema.registry.url={{env['SCHEMA_REGISTRY_URL']}} | ||
|
||
{# optional properties #} | ||
{% set other_props = { | ||
'LISTENERS': 'listeners', | ||
'ID_CONFIG': 'id', | ||
'HOST_NAME': 'host.name', | ||
'PRODUCER_THREADS': 'producer.threads', | ||
'CONSUMER_ITERATOR_TIMEOUT_MS': 'consumer.iterator.timeout.ms', | ||
'CONSUMER_ITERATOR_BACKOFF_MS': 'consumer.iterator.backoff.ms', | ||
'CONSUMER_REQUEST_TIMEOUT_MS': 'consumer.request.timeout.ms', | ||
'CONSUMER_REQUEST_MAX_BYTES': 'consumer.request.max.bytes', | ||
'CONSUMER_THREADS': 'consumer.threads', | ||
'CONSUMER_INSTANCE_TIMEOUT_MS': 'consumer.instance.timeout.ms', | ||
'SIMPLE_CONSUMER_MAX_POOL_SIZE': 'simpleconsumer.pool.size.max', | ||
'SIMPLE_CONSUMER_POOL_TIMEOUT_MS': 'simpleconsumer.pool.timeout.ms' | ||
} -%} | ||
|
||
{% for k, property in other_props.iteritems() %} | ||
{% if env.get(k) != None %} | ||
{{property}}={{env[k]}} | ||
{% endif %} | ||
{% endfor %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "===> Printing /etc/${COMPONENT}/${COMPONENT}.properties " | ||
cat /etc/${COMPONENT}/${COMPONENT}.properties | ||
|
||
echo "===> Launching ${COMPONENT} ... " | ||
# Don't need exec as the command has it. | ||
${COMPONENT}-start /etc/${COMPONENT}/${COMPONENT}.properties | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still do need to add 'exec' here per @theduderog There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nevermind. I'm going to go ahead and merge this PR and then I'll make this change when I add Schema Registry. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
log4j.rootLogger={{ env["LOG4J_ROOT_LOGLEVEL"] | default('INFO') }}, stdout | ||
|
||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset \ | ||
-o errexit \ | ||
-o verbose \ | ||
-o xtrace | ||
|
||
echo "===> ENV Variables ..." | ||
env | ||
|
||
echo "===> User" | ||
id | ||
|
||
echo "===> Configuring ..." | ||
/etc/confluent/docker/configure | ||
|
||
echo "===> Running preflight checks ... " | ||
/etc/confluent/docker/ensure | ||
|
||
echo "===> Launching ... " | ||
/etc/confluent/docker/launch |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset \ | ||
-o errexit \ | ||
-o verbose \ | ||
-o xtrace | ||
|
||
|
||
echo "===> Check if /opt/kafka/data is writable ..." | ||
dub path /opt/kafka/data writable | ||
echo "===> Check if /opt/${COMPONENT}/data is writable ..." | ||
dub path /opt/${COMPONENT}/data writable | ||
|
||
echo "===> Check if Zookeeper is healthy ..." | ||
cub zk-ready $ZOOKEEPER_CONNECT 20 10 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
echo "===> Printing /etc/kafka/server.properties " | ||
cat /etc/kafka/server.properties | ||
echo "===> Printing /etc/${COMPONENT}/${COMPONENT}.properties " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jeremy suggested removing this line as this has SSL password and it would be a security bug. |
||
cat /etc/${COMPONENT}/${COMPONENT}.properties | ||
|
||
echo "===> Launching kafka ... " | ||
echo "===> Launching ${COMPONENT} ... " | ||
# Don't need exec as the command has it. | ||
kafka-server-start /etc/kafka/server.properties | ||
${COMPONENT}-server-start /etc/${COMPONENT}/${COMPONENT}.properties |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset \ | ||
-o errexit \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
echo "===> Printing /etc/kafka/zookeeper.properties " | ||
cat /etc/kafka/zookeeper.properties | ||
echo "===> Printing /etc/kafka/${COMPONENT}.properties " | ||
cat /etc/kafka/${COMPONENT}.properties | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rnpridgeon Does zookeeper config ever include any passwords ? I think it would for 3.5 when SSL is enabled but not sure for 3.4. |
||
|
||
echo "===> Printing /opt/zookeeper/data/myid " | ||
cat /opt/zookeeper/data/myid | ||
echo "===> Printing /opt/${COMPONENT}/data/myid " | ||
cat /opt/${COMPONENT}/data/myid | ||
|
||
echo "===> Launching zookeeper ... " | ||
echo "===> Launching ${COMPONENT} ... " | ||
# Don't need exec as the command has it. | ||
zookeeper-server-start /etc/kafka/zookeeper.properties | ||
${COMPONENT}-server-start /etc/kafka/${COMPONENT}.properties |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset \ | ||
-o errexit \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rnpridgeon Jeremy suggested that we should not print out the server.properties in the launch script as it might contain the keystore password when SSL is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind. I'm going to go ahead and merge this PR and then I'll make this change when I add Schema Registry.