Skip to content

Commit

Permalink
Upgrade brainzutils and sentry-sdk (#1367)
Browse files Browse the repository at this point in the history
* Upgrade brainzutils and sentry-python

* Do not pass email logger

* Remove email_config from messybrainz

* Delete all references to LOG_EMAIL

* Use git hash to set sentry release

* Update BU to include new sentry goodness

Co-authored-by: Alastair Porter <alastair@metabrainz.org>
  • Loading branch information
amCap1712 and alastair committed Mar 31, 2021
1 parent 41246d0 commit a8ef558
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 35 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,6 @@ COPY . /code/listenbrainz/
WORKDIR /code/listenbrainz
RUN rm -rf ./listenbrainz/webserver/static/
RUN rm -f /code/listenbrainz/listenbrainz/config.py /code/listenbrainz/listenbrainz/config.pyc

ARG GIT_COMMIT_SHA
ENV GIT_SHA ${GIT_COMMIT_SHA}
5 changes: 3 additions & 2 deletions consul_config.py.ctmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"{{.}}",
{{- end -}}
{{- end -}}
import os

DEBUG = False

Expand Down Expand Up @@ -127,10 +128,10 @@ LISTENBRAINZ_LABS_API_URL = 'https://labs.api.listenbrainz.org'

# Sentry config
LOG_SENTRY = {
'dsn': '''{{template "KEY" "sentry/dsn_private"}}''',
'dsn': '''{{template "KEY" "sentry/dsn"}}''',
'environment': '''{{template "KEY" "sentry/environment"}}''',
'release': os.getenv('GIT_SHA', None),
}
SENTRY_DSN_PUBLIC = '''{{template "KEY" "sentry/dsn_public"}}'''
DATASETS_SENTRY_DSN = '''{{template "KEY" "sentry/datasets_dsn"}}'''


Expand Down
5 changes: 4 additions & 1 deletion docker/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ git describe --tags --dirty --always > .git-version
ENV=${1:-beta}
TAG=${2:-beta}
echo "building for env $ENV tag $TAG"
docker build -t metabrainz/listenbrainz:$TAG --target listenbrainz-prod --build-arg deploy_env=$ENV . && \
docker build -t metabrainz/listenbrainz:$TAG \
--target listenbrainz-prod \
--build-arg deploy_env=$ENV \
--build-arg GIT_COMMIT_SHA=$(git describe --tags --dirty --always) . && \
docker push metabrainz/listenbrainz:$TAG
9 changes: 0 additions & 9 deletions listenbrainz/config.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ PLAYING_NOW_MAX_DURATION = 10 * 60
# 'backup_count': 100, # optional
# }

# LOG_EMAIL = {
# 'mail_server': 'localhost',
# 'mail_port': 25,
# 'mail_from_host': 'listenbrainz.org',
# 'log_email_recipients': [],
# 'log_email_topic': 'ListenBrainz Error',
# 'level': 'ERROR',
# }

# LOG_SENTRY = {
# 'dsn':'',
# 'environment': 'development',
Expand Down
4 changes: 0 additions & 4 deletions listenbrainz/rtd_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
#LOG_FILE_ENABLED = True
#LOG_FILE = "./listenbrainz.log"

#LOG_EMAIL_ENABLED = True
#LOG_EMAIL_TOPIC = "ListenBrainz Webserver Failure"
#LOG_EMAIL_RECIPIENTS = [] # List of email addresses (strings)

#LOG_SENTRY_ENABLED = True
#SENTRY_DSN = ""

Expand Down
1 change: 0 additions & 1 deletion listenbrainz/webserver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def gen_app(config_path=None, debug=None):
# Logging
app.init_loggers(
file_config=app.config.get('LOG_FILE'),
email_config=app.config.get('LOG_EMAIL'),
sentry_config=app.config.get('LOG_SENTRY')
)

Expand Down
1 change: 0 additions & 1 deletion listenbrainz/websockets/websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
init_error_handlers(app)
app.init_loggers(
file_config=app.config.get('LOG_FILE'),
email_config=app.config.get('LOG_EMAIL'),
sentry_config=app.config.get('LOG_SENTRY')
)

Expand Down
1 change: 0 additions & 1 deletion listenbrainz_spark/config.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ LOG_SENTRY = {
'dsn':'',
'environment': 'development',
}
SENTRY_DSN_PUBLIC = ''

# Model id is made up of two parts.
# String + UUID
Expand Down
4 changes: 0 additions & 4 deletions messybrainz/custom_config.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ REDIS_NAMESPACE = "messybrainz"
#LOG_FILE_ENABLED = True
#LOG_FILE = "./messybrainz.log"

#LOG_EMAIL_ENABLED = True
#LOG_EMAIL_TOPIC = "MessyBrainz Webserver Failure"
#LOG_EMAIL_RECIPIENTS = [] # List of email addresses (strings)

#LOG_SENTRY_ENABLED = True
#SENTRY_DSN = ""

Expand Down
4 changes: 0 additions & 4 deletions messybrainz/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
#LOG_FILE_ENABLED = True
#LOG_FILE = "./messybrainz.log"

#LOG_EMAIL_ENABLED = True
#LOG_EMAIL_TOPIC = "MessyBrainz Webserver Failure"
#LOG_EMAIL_RECIPIENTS = [] # List of email addresses (strings)

#LOG_SENTRY_ENABLED = True
#SENTRY_DSN = ""

Expand Down
4 changes: 0 additions & 4 deletions messybrainz/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
#LOG_FILE_ENABLED = True
#LOG_FILE = "./messybrainz.log"

#LOG_EMAIL_ENABLED = True
#LOG_EMAIL_TOPIC = "MessyBrainz Webserver Failure"
#LOG_EMAIL_RECIPIENTS = [] # List of email addresses (strings)

#LOG_SENTRY_ENABLED = True
#SENTRY_DSN = ""

Expand Down
1 change: 0 additions & 1 deletion messybrainz/webserver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def create_app(debug=None, config_path=None):
# Logging
app.init_loggers(
file_config=app.config.get('LOG_FILE'),
email_config=app.config.get('LOG_EMAIL'),
sentry_config=app.config.get('LOG_SENTRY')
)

Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ yattag == 1.14.0
xmltodict == 0.12.0
oauth2client == 4.1.3
pika == 0.13.0
git+https://github.com/metabrainz/brainzutils-python.git@v1.16.1
git+https://github.com/metabrainz/brainzutils-python.git@v1.18.1
spotipy == 2.16.1
git+https://github.com/metabrainz/data-set-hoster.git@v-2021-02-10.0#egg=datasethoster
pyyaml == 5.4.1
eventlet == 0.30.2
uWSGI == 2.0.19.1
nose == 1.3.7
sentry-sdk[flask]==0.19.5
sentry-sdk[flask] == 0.20.3
six == 1.15.0
pydantic == 1.8.1
pycountry == 20.7.3
Expand All @@ -36,7 +36,6 @@ Jinja2==2.11.3
werkzeug==1.0.1
Flask-DebugToolbar==0.11.0
Flask-UUID==0.2
raven[flask]==6.10.0
msgpack-python==0.5.6
requests==2.23.0
SQLAlchemy==1.3.23
Expand Down

0 comments on commit a8ef558

Please sign in to comment.