Skip to content

Commit e57673a

Browse files
authored
Revert "Add 7-day average of each signal to Safegraph indicator"
1 parent ee49484 commit e57673a

File tree

183 files changed

+216334
-354819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+216334
-354819
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 119 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE/data_quality_issue.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/source_signal_request.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ venv.bak/
116116
# mkdocs documentation
117117
/site
118118

119-
# VSCode settings
120-
*.vscode
121-
122119
# mypy
123120
.mypy_cache/
124121

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 78 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,93 @@
11
# Covidcast Indicators
22

3-
[![License: MIT][mit-image]][mit-url]
3+
Pipeline code and supporting libraries for the **Real-time COVID-19 Indicators** used in the Delphi Group's [**COVIDcast** map](https://covidcast.cmu.edu).
44

5-
In early April 2020, Delphi developed a uniform data schema for [a new Epidata endpoint focused on COVID-19](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html). Our intent was to provide signals that would track in real-time and in fine geographic granularity all facets of the COVID-19 pandemic, aiding both nowcasting and forecasting. Delphi's long history in tracking and forecasting influenza made us uniquely situated to provide access to data streams not available anywhere else, including medical claims data, electronic medical records, lab test records, massive public surveys, and internet search trends. We also process commonly-used publicly-available data sources, both for user convenience and to provide data versioning for sources that do not track revisions themselves.
5+
## The indicators
66

7-
Each data stream arrives in a different format using a different delivery technique, be it sftp, an access-controlled API, or an email attachment. The purpose of each pipeline in this repository is to fetch the raw source data, extract informative aggregate signals, and output those signals---which we call **COVID-19 indicators**---in a common format for upload to the [COVIDcast API](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html).
7+
Each subdirectory contained here that is named after an indicator has specific documentation. Please review as necessary!
88

9-
For client access to the API, along with a variety of other utilities, see our [R](https://cmu-delphi.github.io/covidcast/covidcastR/) and [Python](https://cmu-delphi.github.io/covidcast/covidcast-py/html/) packages.
9+
## General workflow for indicators creation and deployment
1010

11-
For interactive visualizations (of a subset of the available indicators), see our [COVIDcast map](https://covidcast.cmu.edu).
11+
**tl;dr**
1212

13-
## Organization
13+
1. Create your new indicator branch from `main`.
14+
2. Build it using the appropriate template, following the guidelines in the included README.md and REVIEW.md files.
15+
3. Make some stuff!
16+
4. When your stuff works, push your `dev-*` branch to remote for review.
17+
5. Consult with a platform engineer for the remaining production setup needs. They will create a branch called `deploy-*` for your indicator.
18+
6. Initiate a pull request against this new branch.
19+
7. Following [the source documentation template](https://github.com/cmu-delphi/delphi-epidata/blob/main/docs/api/covidcast-signals/_source-template.md), create public API documentation for the source. You can submit this as a pull request against the delphi-epidata repository.
20+
8. If your peers like the code, the documentation is ready, and Jenkins approves, deploy your changes by merging the PR.
21+
9. Rejoice!
1422

15-
Utilities:
16-
* `_delphi_utils_python` - common behaviors
17-
* `_template_python` & `_template_r` - starting points for new data sources
18-
* `ansible` & `jenkins` - automated testing and deployment
19-
* `sir_complainsalot` - a Slack bot to check for missing data
23+
### Starting out
2024

21-
Indicator pipelines: all remaining directories.
25+
The `main` branch should contain up-to-date code and supporting libraries. This should be your starting point when creating a new indicator.
2226

23-
Each indicator pipeline includes its own documentation.
27+
```shell
28+
# Hint
29+
#
30+
git checkout main
31+
git checkout -b dev-my-feature-branch
32+
```
2433

25-
* Consult README.md for directions to install, lint, test, and run the pipeline for that indicator.
26-
* Consult REVIEW.md for the checklist to use for code reviews.
27-
* Consult DETAILS.md (if present) for implementation details, including handling of corner cases.
34+
### Creating your indicator
2835

36+
Create a directory for your new indicator by making a copy of `_template_r` or `_template_python` depending on the programming language you intend to use. The template copies of `README.md` and `REVIEW.md` include the minimum requirements for code structure, documentation, linting, testing, and method of configuration. Beyond that, we don't have any established restrictions on implementation; you can look at other existing indicators see some examples of code layout, organization, and general approach.
2937

30-
## License
38+
- Consult your peers with questions! :handshake:
3139

32-
This repository is released under the **MIT License**.
40+
Once you have something that runs locally and passes tests you set up your remote branch eventual review and production deployment.
3341

34-
[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
35-
[mit-url]: https://opensource.org/licenses/MIT
42+
```shell
43+
# Hint
44+
#
45+
git push -u origin dev-my-feature-branch
46+
```
47+
48+
You can then set draft public API documentation for people who would fetch this
49+
data from the API. Public API documentation is kept in the delphi-epidata
50+
repository, and there is a [template Markdown
51+
file](https://github.com/cmu-delphi/delphi-epidata/blob/main/docs/api/covidcast-signals/_source-template.md)
52+
that outlines the features that need to be documented. You can create a pull
53+
request to add a new file to `docs/api/covidcast-signals/` for your source. Our
54+
goal is to have public API documentation for the data at the same time as it
55+
becomes available to the public.
56+
57+
### Setting up for review and deployment
58+
59+
Once you have your branch set up you should get in touch with a platform engineer to pair up on the remaining production needs. These include:
60+
61+
- Creating the corresponding `deploy-*` branch in the repo.
62+
- Adding the necessary Jenkins scripts for your indicator.
63+
- Preparing the runtime host with any Automation configuration necessities.
64+
- Reviewing the workflow to make sure it meets the general guidelines and will run as expected on the runtime host.
65+
66+
Once all the last mile configuration is in place you can create a pull request against the correct `deploy-*` branch to initiate the CI/CD pipeline which will build, test, and package your indicator for deployment.
67+
68+
If everything looks ok, you've drafted source documentation, platform engineering has validated the last mile, and the pull request is accepted, you can merge the PR. Deployment will start automatically.
69+
70+
Hopefully it'll be a full on :tada:, after that :crossed_fingers:
71+
72+
If not, circle back and try again.
73+
74+
## Production overview
75+
76+
### Running production code
77+
78+
Currently, the production indicators all live and run on the venerable and perennially useful Delphi primary server (also known generically as "the runtime host").
79+
80+
- This is a virtual machine running RHEL 7.5 and living in CMU's Campus Cloud vSphere-based infrastructure environemnt.
81+
82+
### Delivering an indicator to the production environment
83+
84+
We use a branch-based git workflow coupled with [Jenkins](https://www.jenkins.io/) and [Ansible](https://www.ansible.com/) to build, test, package, and deploy each indicator individually to the runtime host.
85+
86+
- Jenkins dutifully manages the whole process for us by executing several "stages" in the context of a [CI/CD pipeline](https://dzone.com/articles/learn-how-to-setup-a-cicd-pipeline-from-scratch). Each stage does something unique, building on the previous stage. The stages are:
87+
- Environment - Sets up some environment-specific needs that the other stages depend on.
88+
- Build - Create the Python venv on the Jenkins host.
89+
- Test - Run linting and unit tests.
90+
- Package - Tar and gzip the built environment.
91+
- Deploy - Trigger an Ansible playbook to place the built package onto the runtime host, place any necessary production configuration, and adjust the runtime envirnemnt (if necessary).
92+
93+
There are several additional Jenkins-specific files that will need to be created for each indicator, as well as some configuration additions to the runtime host. It will be important to pair with a platform engineer to prepare the necessary production environment needs, test the workflow, validate on production, and ultimately sign off on a production release.

0 commit comments

Comments
 (0)