Skip to content

Commit

Permalink
Merge pull request #1492 from jason-fox/feature/postgres-cache-enable
Browse files Browse the repository at this point in the history
Update Dockerfiles to add backend.enable option to Postgres
  • Loading branch information
AlvaroVega authored Jun 5, 2018
2 parents e5b135a + 3d5bd47 commit 8b32b57
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docker/cygnus-ngsi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ ENV CYGNUS_POSTGRESQL_ATTR_PERSISTENCE ""
ENV CYGNUS_POSTGRESQL_BATCH_SIZE ""
ENV CYGNUS_POSTGRESQL_BATCH_TIMEOUT ""
ENV CYGNUS_POSTGRESQL_BATCH_TTL ""
ENV CYGNUS_POSTGRESQL_ENABLE_CACHE ""

# Carto options
ENV CYGNUS_CARTO_USER ""
Expand Down Expand Up @@ -231,10 +232,12 @@ RUN \
${FLUME_HOME}/plugins.d/cygnus/lib/cygnus-ngsi-${CYGNUS_VERSION}-jar-with-dependencies.jar && \
rm -f ${FLUME_HOME}/plugins.d/cygnus/libext/cygnus-common-${CYGNUS_VERSION}-jar-with-dependencies.jar && \
rm -f ${FLUME_HOME}/plugins.d/cygnus/lib/cygnus-ngsi-${CYGNUS_VERSION}-jar-with-dependencies.jar && \
echo "INFO: Copy some files needed for starting cygnus-ngsi" && \
cp -p ${CYGNUS_HOME}/docker/cygnus-ngsi/cygnus-entrypoint.sh / && \
cp -p ${CYGNUS_HOME}/docker/cygnus-ngsi/agent.conf ${FLUME_HOME}/conf/ && \
cp -p ${CYGNUS_HOME}/docker/cygnus-ngsi/cartodb_keys.conf ${FLUME_HOME}/conf/


COPY cygnus-entrypoint.sh /
COPY agent.conf ${FLUME_HOME}/conf/
COPY agent.conf ${CYGNUS_HOME}/docker/cygnus-ngsi/agent.conf
COPY cartodb_keys.conf ${FLUME_HOME}/conf/

# Define the entry point
ENTRYPOINT ["/cygnus-entrypoint.sh"]
Expand Down
1 change: 1 addition & 0 deletions docker/cygnus-ngsi/agent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ cygnus-ngsi.sinks.postgresql-sink.postgresql_password =
#cygnus-ngsi.sinks.postgresql-sink.batch_size = 1
#cygnus-ngsi.sinks.postgresql-sink.batch_timeout = 30
#cygnus-ngsi.sinks.postgresql-sink.batch_ttl = 10
#cygnus-ngsi.sinks.postgresql-sink.backend.enable_cache = false


cygnus-ngsi.channels.mysql-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
Expand Down
3 changes: 3 additions & 0 deletions docker/cygnus-ngsi/cygnus-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ if [ "$CYGNUS_POSTGRESQL_HOST" != "" ]; then
if [ "$CYGNUS_POSTGRESQL_BATCH_TTL" != "" ]; then
sed -i '/#'${CYGNUS_AGENT_NAME}'.sinks.postgresql-sink.batch_ttl/c '${CYGNUS_AGENT_NAME}'.sinks.postgresql-sink.batch_ttl = '${CYGNUS_POSTGRESQL_BATCH_TTL} ${FLUME_HOME}/conf/${AGENT_CONF_FILE}
fi
if [ "$CYGNUS_POSTGRESQL_ENABLE_CACHE" != "" ]; then
sed -i '/#'${CYGNUS_AGENT_NAME}'.sinks.postgresql-sink.backend.enable_cache/c '${CYGNUS_AGENT_NAME}'.sinks.postgresql-sink.backend.enable_cache = '${CYGNUS_POSTGRESQL_ENABLE_CACHE} ${FLUME_HOME}/conf/${AGENT_CONF_FILE}
fi

if [ "${CYGNUS_MULTIAGENT,,}" == "true" ]; then
# Run the Cygnus command
Expand Down

0 comments on commit 8b32b57

Please sign in to comment.