Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #894 from mitodl/server-status-#889
Browse files Browse the repository at this point in the history
Replaced the status app with django-server-status
  • Loading branch information
giocalitri committed Mar 14, 2016
2 parents 72ca6d1 + bc09c24 commit de98b3b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 260 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STATUS_TOKEN=
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ db:
image: postgres
ports:
- "5432"

redis:
image: redis
ports:
- "6379"

elastic:
image: elasticsearch
command: elasticsearch -Des.network.host=0.0.0.0
ports:
- "9200"

stats:
image: kamon/grafana_graphite
ports:
- "8125/udp:8125/udp"
- "8071:80"

web:
build: .
mem_limit: 384m
Expand Down Expand Up @@ -45,13 +49,15 @@ web:
CELERY_RESULT_BACKEND: redis://redis:6379/4
BROKER_URL: redis://redis:6379/4
HAYSTACK_URL: elastic:9200
env_file: .env
ports:
- "8070:8070"
links:
- db
- redis
- elastic
- stats

celery:
image: lore_web
mem_limit: 384m
Expand Down
5 changes: 4 additions & 1 deletion lore/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def get_var(name, default):
'search',
'roles',
'xanalytics',
'server_status',
)

MIDDLEWARE_CLASSES = (
Expand Down Expand Up @@ -374,6 +375,7 @@ def get_var(name, default):
}

# Celery
USE_CELERY = True
BROKER_URL = get_var("BROKER_URL", get_var("REDISCLOUD_URL", None))
CELERY_RESULT_BACKEND = get_var(
"CELERY_RESULT_BACKEND", get_var("REDISCLOUD_URL", None)
Expand All @@ -396,7 +398,8 @@ def get_var(name, default):

XANALYTICS_URL = get_var('XANALYTICS_URL', "")

# Token required to access the status page.
# server-status
HEALTH_CHECK = ['CELERY', 'REDIS', 'POSTGRES', 'ELASTIC_SEARCH']
STATUS_TOKEN = get_var(
"STATUS_TOKEN",
"7E17C32A63B2810F0053DE454FC8395CA3262CCB8392D2307887C5E67F132550"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ beautifulsoup4==4.4.1

# Application monitoring requirements
newrelic==2.58.1.44
django-server-status==0.3
Empty file removed status/__init__.py
Empty file.
Empty file removed status/tests/__init__.py
Empty file.
117 changes: 0 additions & 117 deletions status/tests/test_status.py

This file was deleted.

140 changes: 0 additions & 140 deletions status/views.py

This file was deleted.

3 changes: 1 addition & 2 deletions ui/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from django.conf.urls import include, url
from django.contrib import admin

from status.views import status
from ui.views import (
welcome,
create_repo,
Expand Down Expand Up @@ -54,7 +53,7 @@
),
url(r'^repositories/(?P<repo_slug>[-\w]+)/import/$',
upload, name='upload'),
url(r'^status/$', status, name='status'),
url(r'^status/', include('server_status.urls')),
]

if (settings.DEFAULT_FILE_STORAGE ==
Expand Down

0 comments on commit de98b3b

Please sign in to comment.