Skip to content

Commit

Permalink
Merge pull request #10 from sowmya-dixit/secor-0.29
Browse files Browse the repository at this point in the history
Secor on Kubernetes: Dockerfile changes
  • Loading branch information
anandp504 authored Mar 26, 2021
2 parents 0144e35 + 149e25b commit b684b95
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ADD target/secor-*-bin.tar.gz $SECOR_HOME

COPY src/main/scripts/docker-entrypoint.sh /docker-entrypoint.sh
RUN find $SECOR_HOME -type d -exec chown -R secor:secor {} \;
RUN chown secor:secor /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

USER secor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void init(SecorConfig config) {
mPollTimeout = config.getNewConsumerPollTimeoutSeconds();
Properties props = new Properties();
props.put("bootstrap.servers", config.getKafkaSeedBrokerHost() + ":" + config.getKafkaSeedBrokerPort());
props.put("enable.auto.commit", true);
props.put("enable.auto.commit", false);
props.put("auto.offset.reset", "earliest");
props.put("key.deserializer", ByteArrayDeserializer.class);
props.put("value.deserializer", ByteArrayDeserializer.class);
Expand Down
35 changes: 17 additions & 18 deletions src/main/scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/bin/sh
set -e

# SECOR_CONFIG=''

# if [ -z "$ZOOKEEPER_QUORUM" ]; then
# echo "ZOOKEEPER_QUORUM variable not set, launch with -e ZOOKEEPER_QUORUM=zookeeper:2181"
# exit 1
# else
# SECOR_CONFIG="$SECOR_CONFIG -Dzookeeper.quorum=$ZOOKEEPER_QUORUM"
# echo "zookeeper.quorum=$ZOOKEEPER_QUORUM"
# fi

# if [ -z "$ZOOKEEPER_PATH" ]; then
# echo "ZOOKEEPER_PATH variable not set, launch with -e ZOOKEEPER_PATH=/"
# exit 1
# else
# SECOR_CONFIG="$SECOR_CONFIG -Dkafka.zookeeper.path=$ZOOKEEPER_PATH"
# echo "kafka.zookeeper.path=$ZOOKEEPER_PATH"
# fi

# if [ ! -z "$KAFKA_SEED_BROKER_HOST" ]; then
# SECOR_CONFIG="$SECOR_CONFIG -Dkafka.seed.broker.host=$KAFKA_SEED_BROKER_HOST"
# echo "kafka.seed.broker.host=$KAFKA_SEED_BROKER_HOST"
Expand All @@ -27,13 +27,13 @@ set -e
# SECOR_CONFIG="$SECOR_CONFIG -Dkafka.seed.broker.port=$KAFKA_SEED_BROKER_PORT"
# echo "kafka.seed.broker.port=$KAFKA_SEED_BROKER_PORT"
# fi

if [ ! -z "$SECOR_GROUP" ]; then
SECOR_CONFIG="$SECOR_CONFIG -Dsecor.kafka.group=$SECOR_GROUP"
echo "secor.kafka.group=$SECOR_GROUP"
fi


# if [ ! -z "$AWS_REGION" ]; then
# SECOR_CONFIG="$SECOR_CONFIG -Daws.region=$AWS_REGION"
# echo "aws.region=$AWS_REGION"
Expand Down Expand Up @@ -67,7 +67,7 @@ fi
# SECOR_CONFIG="$SECOR_CONFIG -Dschema.registry.url=$SECOR_SCHEMA_REGISTRY"
# echo "schema.registry.url=$SECOR_SCHEMA_REGISTRY"
# fi

# if [ ! -z "$MESSAGE_TIMESTAMP_NAME" ]; then
# SECOR_CONFIG="$SECOR_CONFIG -Dmessage.timestamp.name=$MESSAGE_TIMESTAMP_NAME"
# echo "message.timestamp.name=$MESSAGE_TIMESTAMP_NAME"
Expand All @@ -80,7 +80,7 @@ fi
# SECOR_CONFIG="$SECOR_CONFIG -Dsecor.parser.timezone=$SECOR_PARSER_TIMEZONE"
# echo "secor.parser.timezone=$SECOR_PARSER_TIMEZONE"
# fi

# if [ ! -z "$CLOUD_SERVICE" ]; then
# SECOR_CONFIG="$SECOR_CONFIG -Dcloud.service=$CLOUD_SERVICE"
# echo "cloud.service=$CLOUD_SERVICE"
Expand All @@ -97,7 +97,7 @@ fi
# SECOR_CONFIG="$SECOR_CONFIG -Dsecor.gs.path=$SECOR_GS_PATH"
# echo "secor.gs.path=$SECOR_GS_PATH"
# fi

# if [ ! -z "$SECOR_MAX_FILE_BYTES" ]; then
# SECOR_CONFIG="$SECOR_CONFIG -Dsecor.max.file.size.bytes=$SECOR_MAX_FILE_BYTES"
# echo "secor.max.file.size.bytes=$SECOR_MAX_FILE_BYTES"
Expand All @@ -106,8 +106,8 @@ fi
# SECOR_CONFIG="$SECOR_CONFIG -Dsecor.max.file.age.seconds=$SECOR_MAX_FILE_SECONDS"
# echo "secor.max.file.age.seconds=$SECOR_MAX_FILE_SECONDS"
# fi


# if [ ! -z "$SECOR_KAFKA_TOPIC_FILTER" ]; then
# SECOR_CONFIG="$SECOR_CONFIG -Dsecor.kafka.topic_filter=$SECOR_KAFKA_TOPIC_FILTER"
# echo "secor.kafka.topic_filter=$SECOR_KAFKA_TOPIC_FILTER"
Expand All @@ -120,15 +120,14 @@ fi
# SECOR_CONFIG="$SECOR_CONFIG -Dsecor.message.parser.class=$SECOR_MESSAGE_PARSER"
# echo "secor.message.parser.class=$SECOR_MESSAGE_PARSER"
# fi
# SECOR_CONFIG="$SECOR_CONFIG $SECOR_EXTRA_OPTS"
# SECOR_CONFIG="$SECOR_CONFIG $SECOR_EXTRA_OPTS"​

cd /opt/secor


DEFAULT_CLASSPATH="*:lib/*"
CLASSPATH=${CLASSPATH:-$DEFAULT_CLASSPATH}

# exec java -Xmx${JVM_MEMORY:-512m} $JAVA_OPTS -ea -Dsecor_group=${SECOR_GROUP:-partition} -Dlog4j.configuration=file:${LOG4J_CONFIGURATION:-log4j.docker.properties} \
# -Dconfig=${CONFIG_FILE:-secor.prod.partition.properties} $SECOR_CONFIG \
# -cp $CLASSPATH ${SECOR_MAIN_CLASS:-com.pinterest.secor.main.ConsumerMain}
Expand Down

0 comments on commit b684b95

Please sign in to comment.