Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2714 new data service #2732

Merged
merged 23 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3df1f03
New poetry project #2714
iamleeg Jun 17, 2022
ee395ee
Update metadata and docs for new data service #2714
iamleeg Jun 17, 2022
f2450ed
Test that I can make a Case instance. #2714
iamleeg Jun 17, 2022
c9ef37d
Require confirmation date to be set in the data model #2714
iamleeg Jun 17, 2022
b6876b3
Case can be created if it has a confirmation date #2714
iamleeg Jun 17, 2022
79255e7
Install Flask #2714
iamleeg Jun 17, 2022
5d0ce48
Case fetching by ID #2714
iamleeg Jun 17, 2022
b70b6d7
End to end test for getting a case from the new data service #2714
iamleeg Jun 20, 2022
c38a4e0
Configure choice of backend store #2714
iamleeg Jun 20, 2022
54744f7
CI runner #2714
iamleeg Jun 20, 2022
6568e33
Python version must be a string #2714
iamleeg Jun 20, 2022
2087c4e
PEP8 conformance #2714
iamleeg Jun 20, 2022
f2879cd
Unhappy path e2e test cases #2714
iamleeg Jun 20, 2022
6b405d3
list cases (works when empty) #2714
iamleeg Jun 20, 2022
0d8430a
List cases API call does indeed list cases #2714
iamleeg Jun 20, 2022
84b44ef
Fix typo in mongo connection string #2714
iamleeg Jun 20, 2022
a67022e
PEP8 #2714
iamleeg Jun 20, 2022
a7bb57c
Model uses ISO date instead of datetime #2714
iamleeg Jun 20, 2022
c3ab176
Mongo Store correctly uses data model #2714
iamleeg Jun 20, 2022
1009920
Use ISO8601 format for dates #2714
iamleeg Jun 20, 2022
d3c3d47
Do not run powtry update in CI #2714
iamleeg Jun 20, 2022
fab92ee
PEP8 #2714
iamleeg Jun 20, 2022
bd60467
Update test to store a BSON confirmation date; fix case model to dese…
iamleeg Jun 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/reusable-data-service-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Re-usable Data Service Python CI

on:
push:
branches: [main, '*-stable']
paths:
- '.github/workflows/reusable-data-service-ci.yml'
- 'data-serving/reusable-data-service/**'
pull_request:
paths:
- '.github/workflows/reusable-data-service-ci.yml'
- 'data-serving/reusable-data-service/**'
workflow_dispatch:

jobs:
ci:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: data-serving/reusable-data-service
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10.5'
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run python tests
run: |
pip install poetry
poetry install
poetry run pytest
21 changes: 14 additions & 7 deletions data-serving/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# All things data

# Emerging outbreaks

Any new outbreak that is tracked by Global.health will use the `reusable-data-service` for CRUD operations on line list cases.
It incorporates a simple "day zero" schema along with facilities for flexibly extending the data model.

## Configuration

TBD as the service gets written!

# COVID-19 instances

The `data-service` folder contains the service for CRUD operations involving the COVID-19 schema.

## Database design

G.h case data, as well as the source, user, and session data for the curator portal, is stored in a MongoDB database.
G.h COVID-19 case data, as well as the source, user, and session data for the curator portal, is stored in a MongoDB database.

We have multiple instances of MongoDB, ranging from local instances for development, to dev and qa (for
https://dev-data.covid-19.global.health/ and https://qa-data.covid-19.global.health in the case of COVID-19 data),
Expand Down Expand Up @@ -154,9 +167,3 @@ Add your index as a [migration](https://github.com/globaldothealth/list/tree/mai
##### Sample PRs

* [Adding a new compound index](https://github.com/globaldothealth/list/pull/701/files)

## Extending to new outbreaks

Our database design is intended to be flexible enough to support future outbreaks. To spin up an instance of the curator
service with a different dataset, create a new database in your MongoDB instance and
[point the curator portal to it](https://github.com/globaldothealth/list/blob/main/dev/docker-compose.yml).
11 changes: 11 additions & 0 deletions data-serving/reusable-data-service/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#####################
Reusable Data Service
#####################

Introduction
============

The Global.health reusable data service takes lessons learned from the
COVID-19 data service (see ../data-service) and provides a scalable,
extensible application server for CRUD operations on line list data
for infectious disease outbreaks.
Loading