Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Stream Enrich 0.14.0 image (closes #36)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenFradet committed Apr 20, 2018
1 parent e121459 commit 6c9251b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
- IMG=scala-stream-collector/0.13.0/kafka
- IMG=scala-stream-collector/0.13.0/kinesis
- IMG=scala-stream-collector/0.13.0/nsq
- IMG=stream-enrich/0.13.0
- IMG=stream-enrich/0.14.0
- IMG=s3-loader/0.6.0
- IMG=elasticsearch-loader/0.10.1
global:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can pull the images from the registry directly:
docker pull snowplow-docker-registry.bintray.io/snowplow/scala-stream-collector-nsq:0.13.0

# Stream Enrich image
docker pull snowplow-docker-registry.bintray.io/snowplow/stream-enrich:0.13.0
docker pull snowplow-docker-registry.bintray.io/snowplow/stream-enrich:0.14.0

# Elasticsearch Loader image
docker pull snowplow-docker-registry.bintray.io/snowplow/elasticsearch-loader:0.10.1
Expand All @@ -44,7 +44,7 @@ docker pull snowplow-docker-registry.bintray.io/snowplow/base:0.1.0
docker build -t snowplow/scala-stream-collector-nsq:0.13.0 scala-stream-collector/0.13.0/nsq

# Stream Enrich image
docker build -t snowplow/stream-enrich:0.13.0 stream-enrich/0.13.0
docker build -t snowplow/stream-enrich:0.13.0 stream-enrich/0.14.0

# Elasticsearch Loader image
docker build -t snowplow/elasticsearch-loader:0.10.1 elasticsearch-loader/0.10.1
Expand Down Expand Up @@ -76,8 +76,8 @@ docker run \
# Stream Enrich
docker run \
-v $PWD/stream-enrich-config:/snowplow/config \
snowplow/stream-enrich:0.13.0 \ # if you have built the image
# snowplow-docker-registry.bintray.io/snowplow/stream-enrich:0.13.0 if you have pulled the image
snowplow/stream-enrich:0.14.0 \ # if you have built the image
# snowplow-docker-registry.bintray.io/snowplow/stream-enrich:0.14.0 if you have pulled the image
--config /snowplow/config/config.hocon \
--resolver file:/snowplow/config/resolver.json \
--enrichments file:/snowplow/config/enrichments/ \
Expand Down
23 changes: 23 additions & 0 deletions stream-enrich/0.14.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM snowplow-docker-registry.bintray.io/snowplow/base:0.1.0
LABEL maintainer="Snowplow Analytics Ltd. <[email protected]>"

# The version of the collector to download.
ENV ENRICH_VERSION="0.14.0"

# The name of the archive to download.
ENV ARCHIVE="snowplow_stream_enrich_${ENRICH_VERSION}.zip"

# Install the Scala Stream Collector.
RUN mkdir -p /tmp/build && \
cd /tmp/build && \
wget -q http://dl.bintray.com/snowplow/snowplow-generic/${ARCHIVE} && \
unzip -d ${SNOWPLOW_BIN_PATH} ${ARCHIVE} && \
cd /tmp && \
rm -rf /tmp/build

# Defines an entrypoint script delegating the lauching of stream enrich to the snowplow user.
# The script uses dumb-init as the top-level process.
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT [ "docker-entrypoint.sh" ]

CMD [ "--help" ]
15 changes: 15 additions & 0 deletions stream-enrich/0.14.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/dumb-init /bin/sh
set -e

# If the config directory has been mounted through -v, we chown it.
if [ "$(stat -c %u ${SNOWPLOW_CONFIG_PATH})" != "$(id -u snowplow)" ]; then
chown snowplow:snowplow ${SNOWPLOW_CONFIG_PATH}
fi

# Needed because of SCE's ./ip_geo file
cd $(eval echo ~snowplow)

# Make sure we run the collector as the snowplow user
exec su-exec snowplow:snowplow /usr/bin/java \
$SP_JAVA_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap \
-jar ${SNOWPLOW_BIN_PATH}/snowplow-stream-enrich-${ENRICH_VERSION}.jar "$@"
9 changes: 5 additions & 4 deletions stream-enrich/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ Additional JVM options can be set through the `SP_JAVA_OPTS` environment variabl
Running the container without arguments will print out its usage:

```bash
$ docker run snowplow-docker-registry.bintray.io/snowplow/stream-enrich:0.x.0
$ VERSION=0.14.0
$ docker run snowplow-docker-registry.bintray.io/snowplow/stream-enrich:$VERSION

snowplow-stream-enrich 0.x.0
snowplow-stream-enrich $VERSION
Usage: snowplow-stream-enrich [options]

--help
Expand All @@ -47,7 +48,7 @@ Alternatively, we can mount a configuration folder and run Stream Enrich:
$ docker run \
-d \
-v ${PWD}/config:/snowplow/config \
snowplow-docker-registry.bintray.io/snowplow/stream-enrich:0.x.0 \
snowplow-docker-registry.bintray.io/snowplow/stream-enrich:$VERSION \
--config /snowplow/config/config.hocon \
--resolver file:/snowplow/config/resolver.json \
--enrichments file:/snowplow/config/enrichments/ \
Expand All @@ -61,7 +62,7 @@ $ docker run \
-d \
-v ${PWD}/config:/snowplow/config \
-e 'SP_JAVA_OPTS=-Xms512m -Xmx512m' \
snowplow-docker-registry.bintray.io/snowplow/stream-enrich:0.x.0 \
snowplow-docker-registry.bintray.io/snowplow/stream-enrich:$VERSION \
--config /snowplow/config/config.hocon \
--resolver file:/snowplow/config/resolver.json \
--enrichments file:/snowplow/config/enrichments/ \
Expand Down

0 comments on commit 6c9251b

Please sign in to comment.