-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Assemble the apps using Docker Compose (closes #23)
- Loading branch information
1 parent
175c784
commit 47ff51f
Showing
5 changed files
with
166 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
version: "3" | ||
|
||
services: | ||
nsqlookupd: | ||
image: nsqio/nsq | ||
command: /nsqlookupd | ||
ports: | ||
- "4160:4160" | ||
- "4161:4161" | ||
|
||
nsqd: | ||
image: nsqio/nsq | ||
command: /nsqd --lookupd-tcp-address=nsqlookupd:4160 --data-path=/home/ubuntu/snowplow/nsq-data | ||
volumes: | ||
- /home/ubuntu/snowplow/nsq-data:/home/ubuntu/snowplow/nsq-data | ||
depends_on: | ||
- nsqlookupd | ||
ports: | ||
- "4150:4150" | ||
- "4151:4151" | ||
|
||
nsqadmin: | ||
image: nsqio/nsq | ||
command: /nsqadmin --lookupd-http-address=nsqlookupd:4161 | ||
depends_on: | ||
- nsqlookupd | ||
ports: | ||
- "4171:4171" | ||
|
||
scala-stream-collector: | ||
image: snowplow-docker-registry.bintray.io/snowplow/scala-stream-collector-nsq:0.13.0 | ||
command: [ "--config", "/snowplow/config/snowplow-stream-collector.hocon" ] | ||
depends_on: | ||
- nsqd | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- /home/ubuntu/snowplow/configs:/snowplow/config | ||
logging: | ||
options: | ||
max-size: "1M" | ||
max-file: "10" | ||
environment: | ||
- "SP_JAVA_OPTS=-Xms512m -Xmx512m" | ||
|
||
stream-enrich: | ||
image: snowplow-docker-registry.bintray.io/snowplow/stream-enrich-nsq:0.16.0 | ||
command: [ | ||
"--config", "/snowplow/config/snowplow-stream-enrich.hocon", | ||
"--resolver", "file:/snowplow/config/iglu-resolver.json", | ||
"--enrichments", "file:/snowplow/config/enrichments", | ||
"--force-ip-lookups-download" | ||
] | ||
depends_on: | ||
- scala-stream-collector | ||
volumes: | ||
- /home/ubuntu/snowplow/configs:/snowplow/config | ||
logging: | ||
options: | ||
max-size: "1M" | ||
max-file: "10" | ||
environment: | ||
- "SP_JAVA_OPTS=-Xms512m -Xmx512m" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
- name: Setup the docker repository and install docker | ||
sudo: yes | ||
shell: | | ||
apt-get update | ||
apt-get install apt-transport-https ca-certificates curl software-properties-common --yes | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
apt-get update && apt-get install docker-ce --yes | ||
- name: Download docker-compose | ||
sudo: yes | ||
shell: curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose | ||
|
||
- name: Apply executable permissions to the docker-compose binary | ||
sudo: yes | ||
shell: chmod +x /usr/local/bin/docker-compose | ||
|
||
# - name: Pull required images | ||
# sudo: yes | ||
# shell: docker pull "{{ item }}" | ||
# with_items: | ||
# - nsqio/nsq:v1.0.0-compat | ||
# - postgres:9.5 | ||
# - elasticsearch:1.7.5 | ||
# - kibana:4.0.2 | ||
# - snowplow-docker-registry.bintray.io/snowplow/scala-stream-collector:0.11.0 | ||
# - snowplow-docker-registry.bintray.io/snowplow/stream-enrich-nsq:0.16.1 | ||
# - snowplow-docker-registry.bintray.io/snowplow/elasticsearch-loader:0.10.1 | ||
# - snowplow-docker-registry.bintray.io/snowplow/iglu-server:0.3.0 | ||
|
||
# - name: Initialize a docker swarm | ||
# sudo: yes | ||
# shell: docker swarm init --advertise-addr 172.17.0.1 | ||
|
||
- copy: | ||
src: ../files/docker-compose.yml | ||
dest: /home/ubuntu/snowplow/ | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
|
||
- name: Ensure file permissions | ||
become: yes | ||
shell: chown ubuntu:ubuntu -R /home/ubuntu/snowplow && chmod 755 -R /home/ubuntu/snowplow | ||
|
||
- name: Deploy snowplow mini | ||
become: yes | ||
shell: cd /home/ubuntu/snowplow/ && docker-compose up -d | ||
|
||
- name: Create new topic for RawEvents | ||
become: yes | ||
shell: "curl -X POST http://127.0.0.1:4151/topic/create?topic=RawEvents" | ||
|
||
- name: Create new topic for BadEvents | ||
become: yes | ||
shell: "curl -X POST http://127.0.0.1:4151/topic/create?topic=BadEvents" | ||
|
||
- name: Create new topic for EnrichedEvents | ||
become: yes | ||
shell: "curl -X POST http://127.0.0.1:4151/topic/create?topic=EnrichedEvents" | ||
|
||
- name: Create new topic for BadEnrichedEvents | ||
become: yes | ||
shell: "curl -X POST http://127.0.0.1:4151/topic/create?topic=BadEnrichedEvents" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters