Skip to content

Commit

Permalink
Adding new way to docker big graphite ! (#538)
Browse files Browse the repository at this point in the history
* Adding new way to docker big graphite !

* Expose more ports in the docker launch script + add missing config file.

Co-authored-by: crto-es-vyg <57795163+crto-es-vyg@users.noreply.github.com>
Co-authored-by: Harold Dost <github@hdost.com>
  • Loading branch information
3 people committed Feb 14, 2020
1 parent cda45ef commit 5dc2b88
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker-ng/aggregator-cache/Dockerfile
@@ -0,0 +1,4 @@
FROM bg-image
RUN pip install carbon
ENTRYPOINT ["bg-carbon-cache"]
CMD ["--debug","--nodaemon","--conf=/conf/carbon.conf","start"]
12 changes: 12 additions & 0 deletions docker-ng/aggregator-cache/carbon.conf
@@ -0,0 +1,12 @@
[cache]
BG_DATA_DRIVER = cassandra
BG_METADATA_DRIVER = elasticsearch
DATABASE = biggraphite
BG_CASSANDRA_KEYSPACE = biggraphite
BG_CASSANDRA_CONTACT_POINTS = cassandra
BG_CASSANDRA_CONTACT_POINTS_METADATA =
BG_CACHE = memory
STORAGE_DIR = /tmp
BG_ELASTICSEARCH_HOSTS = elasticsearch
BG_ELASTICSEARCH_PORT = 9200
#BG_ELASTICSEARCH_INDEX_SUFFIX = _%Y-w%W
Empty file.
5 changes: 5 additions & 0 deletions docker-ng/bg-image/Dockerfile
@@ -0,0 +1,5 @@
FROM python:3.6
COPY . /bg/
WORKDIR /bg
ENV GRAPHITE_NO_PREFIX=true
RUN pip install -r requirements.txt && pip install -e .
4 changes: 4 additions & 0 deletions docker-ng/build.sh
@@ -0,0 +1,4 @@
docker build ../ -t bg-image -f bg-image/Dockerfile
docker build aggregator-cache/ -t aggregator-cache -f aggregator-cache/Dockerfile
docker build graphite-web/ -t graphite-web -f graphite-web/Dockerfile
docker network create biggraphite-network
6 changes: 6 additions & 0 deletions docker-ng/graphite-web/Dockerfile
@@ -0,0 +1,6 @@
FROM bg-image
RUN pip install graphite-web
COPY local_settings.py /usr/local/lib/python3.6/site-packages/graphite/
COPY start-graphite-web.sh /bg
RUN chmod +x /bg/start-graphite-web.sh
ENTRYPOINT /bg/start-graphite-web.sh
15 changes: 15 additions & 0 deletions docker-ng/graphite-web/local_settings.py
@@ -0,0 +1,15 @@
DEBUG = True
LOG_DIR = '/tmp'
STORAGE_DIR = '/tmp'
STORAGE_FINDERS = ['biggraphite.plugins.graphite.Finder']
TAGDB = 'biggraphite.plugins.tags.BigGraphiteTagDB'
# Cassandra configuration
BG_CASSANDRA_KEYSPACE = 'biggraphite'
BG_CASSANDRA_CONTACT_POINTS = 'cassandra'
BG_DATA_DRIVER = 'cassandra'
BG_CACHE = 'memory'
WEBAPP_DIR = '/usr/local/webapp/'
## Elasticsearch configuration
BG_METADATA_DRIVER = 'elasticsearch'
BG_ELASTICSEARCH_HOSTS = 'elasticsearch'
BG_ELASTICSEARCH_PORT = '9200'
5 changes: 5 additions & 0 deletions docker-ng/graphite-web/start-graphite-web.sh
@@ -0,0 +1,5 @@
#!/bin/bash
export DJANGO_SETTINGS_MODULE=graphite.settings
django-admin migrate
django-admin migrate --run-syncdb
cd /usr/local/lib/python3.6/site-packages/graphite && run-graphite-devel-server.py /usr/local
10 changes: 10 additions & 0 deletions docker-ng/launch.sh
@@ -0,0 +1,10 @@
set -x
set -e
docker run --network=biggraphite-network --rm -d --name cassandra cassandra:3.11.3
sleep 20
docker exec cassandra cqlsh -e "CREATE KEYSPACE IF NOT EXISTS biggraphite WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = false;" localhost --cqlversion="3.4.4"
docker run -p 9200:9200 --rm --name elasticsearch -d --network=biggraphite-network docker.elastic.co/elasticsearch/elasticsearch:6.3.2
sleep 20
docker run -d --rm --name kibana -p 5601:5601 --network=biggraphite-network docker.elastic.co/kibana/kibana:6.3.2
docker run -d --rm --name aggregator-cache -p 2003:2003 --network=biggraphite-network -v $(pwd)/aggregator-cache/:/conf aggregator-cache
docker run -d --rm --name graphite-web -p 8080:8080 --network=biggraphite-network graphite-web
1 change: 1 addition & 0 deletions docker-ng/stop.sh
@@ -0,0 +1 @@
docker stop $(docker container ls -q)

0 comments on commit 5dc2b88

Please sign in to comment.