Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit d8bea5b

Browse files
committed
added spot price to launch configuration
1 parent 8c20186 commit d8bea5b

File tree

16 files changed

+141
-18
lines changed

16 files changed

+141
-18
lines changed

backend/backend/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
SECRET_KEY = os.environ.get('SECRET_KEY', 'secret-key')
2424

2525
# SECURITY WARNING: don't run with debug turned on in production!
26-
DEBUG = os.environ.get('DEBUG', False)
26+
DEBUG = bool(os.environ['DEBUG'])
2727

2828
ALLOWED_HOSTS = ['*']
2929

backend/core/management/commands/watch_celery.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ class Command(BaseCommand):
2424

2525
def handle(self, *args, **options):
2626
print('Starting celery worker with autoreload...')
27-
autoreload.main(restart_celery)
28-
27+
autoreload.run_with_reloader(restart_celery)

backend/core/management/commands/watch_celery_beat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ class Command(BaseCommand):
2424

2525
def handle(self, *args, **options):
2626
print('Starting celery worker with autoreload...')
27-
autoreload.main(restart_celery_beat)
27+
autoreload.run_with_reloader(restart_celery_beat)

backend/requirements/base.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
boto3==1.9.130
2+
3+
celery==4.3.0
4+
5+
Django==2.2
6+
django-cors-headers==2.5.2
7+
django-filter==2.1.0
8+
djangorestframework==3.9.2
9+
djangorestframework_simplejwt==4.3.0
10+
django-shortcuts==1.6
11+
django-debug-toolbar==1.11
12+
13+
# Django page caching is not working with this version of Redis
14+
# but this version is required by Celery
15+
django-redis==4.10.0
16+
17+
django-storages==1.7.1
18+
django-constance==2.4.0 # for managing settings in admin
19+
20+
pandas==0.24.2
21+
pandas_flavor==0.1.2
22+
pyjanitor==0.16.6
23+
24+
xlrd==1.2.0 # required by pandas for Excel support
25+
XlsxWriter==1.1.6 # used by the excel recon tool
26+
django-postgres-copy==2.4.0
27+
django-safedelete==0.5.1
28+
29+
gunicorn==19.9.0
30+
31+
psycopg2-binary==2.8.2
32+
33+
redis==3.2.1
34+
35+
requests==2.21.0

backend/requirements/dev.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
better_exceptions==0.2.2
2+
pyupio==1.0.2
3+
django-extensions==2.1.6 # NOTE: in installed_apps
4+
Werkzeug==0.15.2 # used for runserver_plus exception console
5+
ipython==7.4.0
6+
jupyter==1.0.0

backend/requirements/test.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pytest==4.4.1
2+
pytest-cov==2.6.1
3+
pytest-django==3.4.8
4+
factory_boy==2.11.1
5+
flake8==3.7.7
6+
flake8-isort==2.7.0
7+
coverage==4.5.3
8+
moto==1.3.7

backend/scripts/dev/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM python:3.7
2+
ENV PYTHONUNBUFFERED 1
3+
ENV PYTHONDONTWRITEBYTECODE 1
4+
RUN mkdir /code
5+
WORKDIR /code
6+
COPY requirements/base.txt requirements/dev.txt requirements/test.txt /code/requirements/
7+
RUN pip install -r requirements/base.txt \
8+
&& pip install -r requirements/dev.txt \
9+
&& pip install -r requirements/test.txt
10+
COPY scripts/dev/start_dev.sh scripts/dev/start_beat.sh /
11+
ADD . /code/

backend/scripts/dev/start_beat.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -o nounset
4+
set -o errexit
5+
6+
PIDFILE='/code/celerybeat.pid'
7+
SCHEDULE_FILE='/code/celerybeat-schedule'
8+
9+
trap "rm ${PIDFILE} ; exit 130" SIGINT
10+
trap "rm ${PIDFILE} ; exit 137" SIGKILL
11+
trap "rm ${PIDFILE} ; exit 143" SIGTERM
12+
13+
if [[ -f $PIDFILE ]]
14+
then
15+
rm $PIDFILE
16+
fi
17+
18+
if [[ -f $SCHEDULE_FILE ]]
19+
then
20+
rm $SCHEDULE_FILE
21+
fi
22+
23+
exec python3 manage.py watch_celery_beat
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
celery worker --app=backend.celery_app:app --loglevel=info

backend/scripts/dev/start_dev.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
python3 manage.py collectstatic --no-input
4+
python3 manage.py makemigrations
5+
python3 manage.py migrate --no-input
6+
7+
# this creates a default superuser if there are no users
8+
# see backend/accounts/management/commands/create_default_user.py
9+
python3 manage.py create_default_user
10+
while true; do
11+
python3 manage.py runserver_plus 0.0.0.0:8000
12+
sleep 5s
13+
done

0 commit comments

Comments
 (0)