-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from brighthive/feat/add-cloudwatch-logging
Feat/add cloudwatch logging
- Loading branch information
Showing
7 changed files
with
501 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,7 @@ | |
**/__pycache__ | ||
|
||
# pytest artifacts | ||
**/.pytest_cache | ||
**/.pytest_cache | ||
|
||
**/sandbox.py | ||
**/push.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#!/bin/bash | ||
|
||
MAX_RETRIES=5 | ||
if [ -z $WORKERS ]; then | ||
WORKERS=4 | ||
fi | ||
|
||
|
||
if [ "$APP_ENV" == "DEVELOPMENT" ] || [ -z "$APP_ENV" ]; then | ||
# docker-compose.yml sets the APP_ENV | ||
gunicorn -b 0.0.0.0 matching:app --reload --log-level=DEBUG --timeout 240 | ||
gunicorn -b 0.0.0.0 matching:app -w $WORKERS --worker-class gevent --reload --log-level=DEBUG --timeout 240 | ||
else | ||
gunicorn -b 0.0.0.0 matching:app --reload | ||
gunicorn -b 0.0.0.0 matching:app -w $WORKERS --worker-class gevent | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,19 @@ | ||
''' | ||
This module provides the POST endpoint for finding matches. | ||
''' | ||
from flask_restful import Resource | ||
from flask_restful import Resource, request | ||
from webargs import fields | ||
from webargs.flaskparser import use_args | ||
|
||
from matching.common.util import compute_match_with_score | ||
|
||
individual_args = { | ||
"mci_id": fields.Str(), | ||
"vendor_id": fields.Str(), | ||
"ssn": fields.Str(), | ||
"registration_date": fields.Str(), | ||
"first_name": fields.Str(), | ||
"middle_name": fields.Str(), | ||
"last_name": fields.Str(), | ||
"date_of_birth": fields.Str(), | ||
"email_address": fields.Str(), | ||
"telephone": fields.Str(), | ||
"mailing_address_id": fields.Str(), | ||
"gender_id": fields.Str(), | ||
"education_level_id": fields.Str(), | ||
"employment_status_id": fields.Str(), | ||
"source_id": fields.Str() | ||
} | ||
|
||
class ComputeMatch(Resource): | ||
# Keeping this as a sanity-check placeholder, for now. | ||
def get(self): | ||
return {'hello': 'world'} | ||
|
||
@use_args(individual_args) | ||
def post(self, args): | ||
mci_id, score = compute_match_with_score(args) | ||
|
||
# @use_args(individual_args) | ||
def post(self): | ||
mci_id, score = compute_match_with_score(request.get_json(force=True)) | ||
return {'mci_id': mci_id, 'score': score}, 201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters