Skip to content

Commit 88bcc7d

Browse files
authored
Merge pull request #101 from cmu-delphi/prodction-prep-deploy-jhu
Review and prepare the deploy-jhu branch for production
2 parents edce5d1 + 2b7cc96 commit 88bcc7d

File tree

270 files changed

+5814
-30
lines changed

Some content is hidden

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

270 files changed

+5814
-30
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,8 @@ venv.bak/
118118

119119
# mypy
120120
.mypy_cache/
121+
122+
# Ansible
123+
.retry
124+
.indicators-ansible-vault-pass
125+
indicators-ansible-vault-pass

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Covidcast Indicators
2+
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).
4+
5+
## The indicators
6+
7+
Each subdirectory contained here that is named after an indicator has specific documentation. Please review as necessary!
8+
9+
## General workflow for indicators creation and deployment
10+
11+
**tl;dr**
12+
13+
- Create your new indicator branch from `main`.
14+
- Build it using the appropriate template, following the guidelines in the included README.md and REVIEW.md files.
15+
- Make some stuff!
16+
- When your stuff works, push your `dev-*` branch to remote for review.
17+
- Consult with a platform engineer for the remaining production setup needs. They will create a branch called `deploy-*` for your indicator.
18+
- Initiate a pull request against this new branch.
19+
- If your peers like it and Jenkins approves, deploy your changes by merging the PR.
20+
- Rejoice!
21+
22+
### Starting out
23+
24+
The `main` branch should contain up-to-date code and supporting libraries. This should be your starting point when creating a new indicator.
25+
26+
```shell
27+
# Hint
28+
#
29+
git checkout main
30+
git checkout -b dev-my-feature-branch
31+
```
32+
33+
### Creating your indicator
34+
35+
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.
36+
37+
- Consult your peers with questions! :handshake:
38+
39+
Once you have something that runs locally and passes tests you set up your remote branch eventual review and production deployment.
40+
41+
```shell
42+
# Hint
43+
#
44+
git push -u origin dev-my-feature-branch
45+
```
46+
47+
### Setting up for review and deployment
48+
49+
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:
50+
51+
- Creating the corresponding `deploy-*` branch in the repo.
52+
- Adding the necessary Jenkins scripts for your indicator.
53+
- Preparing the runtime host with any Automation configuration necessities.
54+
- Reviewing the workflow to make sure it meets the general guidelines and will run as expected on the runtime host.
55+
56+
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.
57+
58+
If everything looks ok, platform engineering has validated the last mile, and the pull request is accepted, you can merge the PR. Deployment will start automatically.
59+
60+
Hopefully it'll be a full on :tada:, after that :crossed_fingers:
61+
62+
If not, circle back and try again.
63+
64+
## Production overview
65+
66+
### Running production code
67+
68+
Currently, the production indicators all live and run on the venerable and perennially useful Delphi primary server (also known generically as "the runtime host").
69+
70+
- This is a virtual machine running RHEL 7.5 and living in CMU's Campus Cloud vSphere-based infrastructure environemnt.
71+
72+
### Delivering an indicator to the production environment
73+
74+
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.
75+
76+
- 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:
77+
- Environment - Sets up some environment-specific needs that the other stages depend on.
78+
- Build - Create the Python venv on the Jenkins host.
79+
- Test - Run linting and unit tests.
80+
- Package - Tar and gzip the built environment.
81+
- 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).
82+
83+
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.

google_health/cache/Data_500_anosmia_ms.csv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ geo_id,timestamp,val
131131
500,2020-05-13,0.00000000
132132
500,2020-05-14,0.00000000
133133
500,2020-05-15,0.00000000
134+
500,2020-05-16,0.00000000
135+
500,2020-05-17,0.00000000
136+
500,2020-05-18,0.00000000
137+
500,2020-05-19,0.00000000
138+
500,2020-05-20,0.00000000
139+
500,2020-05-21,0.00000000
140+
500,2020-05-22,0.00000000
141+
500,2020-05-23,0.00000000
142+
500,2020-05-24,2200.70422535
143+
500,2020-05-25,1973.16495659
144+
500,2020-05-26,0.00000000
145+
500,2020-05-27,0.00000000
146+
500,2020-05-28,0.00000000
147+
500,2020-05-29,0.00000000
148+
500,2020-05-30,0.00000000
149+
500,2020-05-31,0.00000000
150+
500,2020-06-01,0.00000000
151+
500,2020-06-02,0.00000000
152+
500,2020-06-03,0.00000000
153+
500,2020-06-04,0.00000000
154+
500,2020-06-05,0.00000000

google_health/cache/Data_501_anosmia_ms.csv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ geo_id,timestamp,val
131131
501,2020-05-13,392.32625361
132132
501,2020-05-14,324.14725935
133133
501,2020-05-15,247.25216534
134+
501,2020-05-16,282.22614066
135+
501,2020-05-17,289.84124969
136+
501,2020-05-18,390.53549826
137+
501,2020-05-19,540.29622067
138+
501,2020-05-20,241.80713566
139+
501,2020-05-21,376.88500026
140+
501,2020-05-22,356.14953551
141+
501,2020-05-23,320.52164769
142+
501,2020-05-24,256.10714479
143+
501,2020-05-25,328.92618894
144+
501,2020-05-26,142.09376105
145+
501,2020-05-27,285.08656631
146+
501,2020-05-28,145.95659513
147+
501,2020-05-29,203.30545511
148+
501,2020-05-30,249.98138165
149+
501,2020-05-31,142.33883376
150+
501,2020-06-01,134.02327689
151+
501,2020-06-02,328.02073255
152+
501,2020-06-03,268.44266113
153+
501,2020-06-04,403.02506167
154+
501,2020-06-05,203.98113312

google_health/cache/Data_502_anosmia_ms.csv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ geo_id,timestamp,val
131131
502,2020-05-13,0.00000000
132132
502,2020-05-14,0.00000000
133133
502,2020-05-15,0.00000000
134+
502,2020-05-16,0.00000000
135+
502,2020-05-17,0.00000000
136+
502,2020-05-18,0.00000000
137+
502,2020-05-19,0.00000000
138+
502,2020-05-20,0.00000000
139+
502,2020-05-21,0.00000000
140+
502,2020-05-22,0.00000000
141+
502,2020-05-23,0.00000000
142+
502,2020-05-24,0.00000000
143+
502,2020-05-25,0.00000000
144+
502,2020-05-26,0.00000000
145+
502,2020-05-27,0.00000000
146+
502,2020-05-28,0.00000000
147+
502,2020-05-29,0.00000000
148+
502,2020-05-30,0.00000000
149+
502,2020-05-31,0.00000000
150+
502,2020-06-01,0.00000000
151+
502,2020-06-02,0.00000000
152+
502,2020-06-03,0.00000000
153+
502,2020-06-04,0.00000000
154+
502,2020-06-05,0.00000000

google_health/cache/Data_503_anosmia_ms.csv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ geo_id,timestamp,val
131131
503,2020-05-13,0.00000000
132132
503,2020-05-14,0.00000000
133133
503,2020-05-15,0.00000000
134+
503,2020-05-16,0.00000000
135+
503,2020-05-17,0.00000000
136+
503,2020-05-18,0.00000000
137+
503,2020-05-19,0.00000000
138+
503,2020-05-20,3672.42012486
139+
503,2020-05-21,0.00000000
140+
503,2020-05-22,0.00000000
141+
503,2020-05-23,0.00000000
142+
503,2020-05-24,0.00000000
143+
503,2020-05-25,0.00000000
144+
503,2020-05-26,0.00000000
145+
503,2020-05-27,0.00000000
146+
503,2020-05-28,0.00000000
147+
503,2020-05-29,0.00000000
148+
503,2020-05-30,0.00000000
149+
503,2020-05-31,0.00000000
150+
503,2020-06-01,0.00000000
151+
503,2020-06-02,0.00000000
152+
503,2020-06-03,0.00000000
153+
503,2020-06-04,0.00000000
154+
503,2020-06-05,0.00000000

google_health/cache/Data_504_anosmia_ms.csv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ geo_id,timestamp,val
131131
504,2020-05-13,557.11659680
132132
504,2020-05-14,363.57013223
133133
504,2020-05-15,847.97233675
134+
504,2020-05-16,444.98346642
135+
504,2020-05-17,534.41672775
136+
504,2020-05-18,545.05004653
137+
504,2020-05-19,183.43119011
138+
504,2020-05-20,554.50828444
139+
504,2020-05-21,191.32736853
140+
504,2020-05-22,184.24842629
141+
504,2020-05-23,622.69156751
142+
504,2020-05-24,1108.10718092
143+
504,2020-05-25,663.20789572
144+
504,2020-05-26,772.27266461
145+
504,2020-05-27,190.29199506
146+
504,2020-05-28,363.83261971
147+
504,2020-05-29,0.00000000
148+
504,2020-05-30,0.00000000
149+
504,2020-05-31,219.38533138
150+
504,2020-06-01,921.24370291
151+
504,2020-06-02,559.06455322
152+
504,2020-06-03,178.48945958
153+
504,2020-06-04,568.41047377
154+
504,2020-06-05,184.42864118

google_health/cache/Data_505_anosmia_ms.csv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ geo_id,timestamp,val
131131
505,2020-05-13,1033.24114744
132132
505,2020-05-14,966.23647884
133133
505,2020-05-15,671.32931951
134+
505,2020-05-16,0.00000000
135+
505,2020-05-17,0.00000000
136+
505,2020-05-18,1081.27786689
137+
505,2020-05-19,336.54208784
138+
505,2020-05-20,1359.58768990
139+
505,2020-05-21,713.28805930
140+
505,2020-05-22,0.00000000
141+
505,2020-05-23,1253.98677913
142+
505,2020-05-24,437.29613611
143+
505,2020-05-25,0.00000000
144+
505,2020-05-26,0.00000000
145+
505,2020-05-27,330.85299711
146+
505,2020-05-28,0.00000000
147+
505,2020-05-29,335.79555758
148+
505,2020-05-30,0.00000000
149+
505,2020-05-31,401.38591473
150+
505,2020-06-01,674.71132597
151+
505,2020-06-02,0.00000000
152+
505,2020-06-03,320.48723068
153+
505,2020-06-04,0.00000000
154+
505,2020-06-05,326.18573894

google_health/cache/Data_506_anosmia_ms.csv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ geo_id,timestamp,val
131131
506,2020-05-13,224.16752446
132132
506,2020-05-14,690.35335010
133133
506,2020-05-15,677.35234002
134+
506,2020-05-16,0.00000000
135+
506,2020-05-17,537.89871869
136+
506,2020-05-18,502.89870470
137+
506,2020-05-19,1105.62934682
138+
506,2020-05-20,230.84100350
139+
506,2020-05-21,942.86292166
140+
506,2020-05-22,490.42349066
141+
506,2020-05-23,269.12959025
142+
506,2020-05-24,564.57111674
143+
506,2020-05-25,1049.97217083
144+
506,2020-05-26,0.00000000
145+
506,2020-05-27,683.47100277
146+
506,2020-05-28,677.34375290
147+
506,2020-05-29,0.00000000
148+
506,2020-05-30,0.00000000
149+
506,2020-05-31,272.29992876
150+
506,2020-06-01,675.67841894
151+
506,2020-06-02,455.37555267
152+
506,2020-06-03,429.08720078
153+
506,2020-06-04,769.12885310
154+
506,2020-06-05,668.76250905

google_health/cache/Data_507_anosmia_ms.csv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ geo_id,timestamp,val
131131
507,2020-05-13,0.00000000
132132
507,2020-05-14,0.00000000
133133
507,2020-05-15,0.00000000
134+
507,2020-05-16,2329.37339856
135+
507,2020-05-17,0.00000000
136+
507,2020-05-18,2010.05025126
137+
507,2020-05-19,0.00000000
138+
507,2020-05-20,0.00000000
139+
507,2020-05-21,0.00000000
140+
507,2020-05-22,2102.16523019
141+
507,2020-05-23,0.00000000
142+
507,2020-05-24,0.00000000
143+
507,2020-05-25,2227.66763199
144+
507,2020-05-26,0.00000000
145+
507,2020-05-27,0.00000000
146+
507,2020-05-28,0.00000000
147+
507,2020-05-29,0.00000000
148+
507,2020-05-30,0.00000000
149+
507,2020-05-31,0.00000000
150+
507,2020-06-01,0.00000000
151+
507,2020-06-02,0.00000000
152+
507,2020-06-03,0.00000000
153+
507,2020-06-04,0.00000000
154+
507,2020-06-05,0.00000000

0 commit comments

Comments
 (0)