Skip to content

Commit 459ae19

Browse files
author
Irving Popovetsky
authored
Add Honeycomb.io instrumentation, plus a number of build and doc… (#277)
* Add Honeycomb.io instrumentation, plus a number of build and doc fixes Signed-off-by: Irving Popovetsky <irving@popovetsky.com> * Force a rebuild of the cache, as we're going from poetry 0.12 style lockfile to a 1.0 style lockfile Signed-off-by: Irving Popovetsky <irving@popovetsky.com> * appease the linter gods Signed-off-by: Irving Popovetsky <irving@popovetsky.com> * Codeclimate hates the default gunicorn sample config Signed-off-by: Irving Popovetsky <irving@popovetsky.com>
1 parent de0d2a0 commit 459ae19

10 files changed

Lines changed: 1157 additions & 207 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545

4646
- restore_cache: # ensure this step occurs *before* installing dependencies
4747
keys:
48-
- v1-dependencies-{{ checksum "poetry.lock" }}
48+
- v2-dependencies-{{ checksum "poetry.lock" }}
4949
# fallback to using the latest cache if no exact match is found
50-
- v1-dependencies-
50+
- v2-dependencies-
5151

5252
- run:
5353
name: Installing dependencies

.codeclimate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ plugins:
1212

1313
exclude_patterns:
1414
- "**/migrations/"
15-
- "./src/tests/*"
15+
- "./src/tests/*"
16+
- "./src/gunicorn_config.py"

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ENV PATH="/opt/venv/bin:$PATH"
2525
COPY poetry.lock pyproject.toml ./
2626

2727
RUN pip install poetry && \
28-
poetry config settings.virtualenvs.create false && \
28+
poetry config virtualenvs.create false && \
2929
poetry install --no-dev --no-interaction --no-ansi
3030

3131

@@ -73,4 +73,4 @@ FROM app As Prod
7373

7474
EXPOSE 8000
7575
CMD python manage.py process_tasks &\
76-
gunicorn operationcode_backend.wsgi -b 0.0.0.0:8000 -w 3 --access-logfile=- --error-logfile=- --capture-output --logger-class "operationcode_backend.custom_logging.CustomGunicornLogger"
76+
gunicorn operationcode_backend.wsgi -c /src/gunicorn_config.py

docker/docker-compose.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,31 @@ version: '3.6'
22
services:
33

44
backend:
5-
image: back-end:latest
5+
image: operationcode/back-end:latest
66
build:
77
context: ..
88
dockerfile: docker/Dockerfile
9-
target: Staging
10-
container_name: backend02
9+
target: Prod
10+
depends_on:
11+
- db
12+
container_name: backend
1113
env_file:
1214
- .env
1315
ports:
1416
- 8000:8000
1517

1618
pybot:
17-
image: pybot:latest
18-
container_name: pybot01
19+
image: operationcode/pybot:latest
20+
depends_on:
21+
- db
22+
container_name: pybot
1923
env_file:
2024
- pybot.env
2125
ports:
2226
- 5000:5000
2327

2428
db:
25-
image: postgres:9.6.11
29+
image: postgres:9.6
2630
container_name: backend-postgres
2731
ports:
2832
- 5432:5432

example.env

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ SECRET_KEY=[SECRET_KEY]
99

1010

1111
# Database creds
12-
ENGINE=[DB_ENGINE]
13-
NAME=[DB_NAME]
14-
USER=[DB_USER]
15-
PASSWORD=[DB_PASSWORD]
16-
HOST=[DB_HOST]
17-
PORT=[DB_PORT]
12+
DB_ENGINE=[DB_ENGINE]
13+
DB_NAME=[DB_NAME]
14+
DB_USER=[DB_USER]
15+
DB_PASSWORD=[DB_PASSWORD]
16+
DB_HOST=[DB_HOST]
17+
DB_PORT=[DB_PORT]
1818

1919

2020
# Defaults to True when running in development. Define here to override
2121
DEBUG=[True|False]
2222

2323

2424
# Sets which file in src.settings to use. Defaults to `development` for `development.py`
25-
DJANGO_SETTINGS_MODULE=[MODULE]
25+
DJANGO_ENV=development
2626

2727

2828
# Token used to authenticate with pybot for things like Slack invites
@@ -44,3 +44,7 @@ AWS_STORAGE_BUCKET_NAME=[BUCKET_NAMAE]
4444
BUCKET_REGION_NAME=[REGION_NAME]
4545
AWS_ACCESS_KEY_ID=[ACCESS_KEY_ID]
4646
AWS_SECRET_ACCESS_KEY=[SECRET_ACCESS_KEY]
47+
48+
# Honeycomb API token and dataset name
49+
HONEYCOMB_WRITEKEY=[HONEYCOMB_API_TOKEN]
50+
HONEYCOMB_DATASET=[HONEYCOMB_DATASET]

0 commit comments

Comments
 (0)