Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Commit

Permalink
Add graphite template
Browse files Browse the repository at this point in the history
manuquentin committed Jun 6, 2014
1 parent 057f18c commit 20d8c95
Showing 4 changed files with 43 additions and 17 deletions.
13 changes: 5 additions & 8 deletions examples/golang-statsd-graphite/.gaudi.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ applications:
links: [statsd]
volumes:
.: /app
# after_script: go run /app/app.go
after_script: go run /app/app.go
custom:
modules: [github.com/cactus/go-statsd-client/statsd]

@@ -13,18 +13,15 @@ applications:
links: [graphite]
ports:
8125: 8125
2003: 2003

graphite:
type: index
image: bryanlarsen/graphite
volumes:
/data/graphite:/opt/graphite/storage
type: graphite
ports:
8080: 80
80: 8080
2003: 2003
2023: 2023 # Carbon aggregator ports
2024: 2024 # Carbon aggregator ports
7002: 7002 # Carbon cache query port

# sudo gaudi
# sudo docker logs app
# sudo docker logs -f app
19 changes: 11 additions & 8 deletions templates/graphite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# @see hopsoft/graphite-statsd
FROM stackbrew/debian:wheezy

[[ updateApt ]]
[[ addUserFiles ]]

RUN apt-get install -y -f libcairo2 libcairo2-dev python-cairo libbz2-dev libsqlite3-dev nginx-light
RUN apt-get -y --force-yes install vim nginx python-flup expect git memcached sqlite3 libcairo2 libcairo2-dev python-cairo pkg-config build-essential python-dev libsqlite3-dev

[[ .Container.SetCustomValue "pythonVersion" "2.7.6"]]
[[ installPython ]]
RUN wget -P /opt http://python-distribute.org/distribute_setup.py
RUN python /opt/distribute_setup.py
RUN easy_install pip

[[ .Container.SetCustomValue "djangoVersion" "1.5"]]
[[ installDjango ]]

RUN pip install whisper carbon graphite-web django-tagging pysqlite flup daemonize gunicorn 'Twisted<12.0'
RUN pip install django==1.3 whisper==0.9.12 carbon graphite-web django-tagging==0.3.1 pysqlite flup daemonize gunicorn twisted==11.1.0 python-memcached==1.53 txAMQP==0.6.2

# Configure graphite
RUN mv /opt/graphite/conf/carbon.conf.example /opt/graphite/conf/carbon.conf
@@ -21,13 +20,17 @@ RUN mv /opt/graphite/conf/dashboard.conf.example /opt/graphite/conf/dashboard.co
RUN mv /opt/graphite/conf/graphTemplates.conf.example /opt/graphite/conf/graphTemplates.conf
RUN mv /opt/graphite/conf/graphite.wsgi.example /opt/graphite/conf/graphite.wsgi
RUN mv /opt/graphite/webapp/graphite/local_settings.py.example /opt/graphite/webapp/graphite/local_settings.py
RUN echo "\n\n[stats]\npattern = ^stats.*\nretentions = 10s:6h,1min:6d,10min:1800d" >> /opt/graphite/conf/storage-schemas.conf

# Create locations for pid/log files
RUN mkdir -p /var/run/graphite && chown www-data /var/run/graphite
RUN mkdir -p /var/log/carbon && chown www-data /var/log/carbon

# Initialize the webapp
RUN cd /opt/graphite/webapp/graphite && python manage.py syncdb --noinput
sed -i -e "s|#SECRET_KEY = 'UNSAFE_DEFAULT'|SECRET_KEY = 'OJNOKdsqds!d987§8'|" /opt/graphite/webapp/graphite/local_settings.py
ADD ./graphite_syncdb /tmp/graphite_syncdb
RUN chmod 775 /tmp/graphite_syncdb
RUN /tmp/graphite_syncdb

# Add custom setup script
[[ beforeAfterScripts ]]
26 changes: 26 additions & 0 deletions templates/graphite/graphite_syncdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env expect

set timeout -1
spawn python /opt/graphite/webapp/graphite/manage.py syncdb

expect "Would you like to create one now" {
send "yes\r"
}

expect "Username *:" {
send "root\r"
}

expect "E-mail address:" {
send "root.graphite@mailinator.com\r"
}

expect "Password:" {
send "root\r"
}

expect "Password *:" {
send "root\r"
}

expect "Superuser created successfully"
2 changes: 1 addition & 1 deletion templates/graphite/nginx.conf
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ http {
add_header Access-Control-Allow-Headers "origin, authorization, accept";

location /content {
alias /var/lib/graphite/webapp/content;
alias /opt/graphite/webapp/content/;
}

location /media {

0 comments on commit 20d8c95

Please sign in to comment.