Skip to content

Review and prepare the deploy-jhu branch for production #101

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

Merged
merged 46 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
685348e
revert 7day smooth to wip_
huisaddison Jun 2, 2020
44febee
update code for unassigned cases/deaths
Jun 8, 2020
849a32e
update the dict for fake fips
Jun 8, 2020
f1f5cdd
Set population for fake fips as NAN
Jun 8, 2020
84bbfc6
update geo_id for megacounty
Jun 8, 2020
339eac5
update cache
Jun 9, 2020
8c538e3
Cut 7-day avg signal name
Jun 9, 2020
e2d8254
Cut 7-day avg signal name
Jun 9, 2020
030d38a
update naming for megacounty
Jun 10, 2020
f66b43e
modify test cases for megacounty aggregation
Jun 10, 2020
49be65d
delete whitespace
Jun 10, 2020
7ee404c
delete whitespace
Jun 10, 2020
25162d0
Update jhu/tests/test_geo.py
jingjtang Jun 11, 2020
0dae169
Update jhu/tests/test_geo.py
jingjtang Jun 11, 2020
64790fb
Update jhu/tests/test_geo.py
jingjtang Jun 11, 2020
435f63d
disable 7dav_ signals temporarily
Jun 11, 2020
d187ebc
disable 7dav_ signal
Jun 11, 2020
131b88b
cut 7day avg signal name
Jun 11, 2020
003ac0c
delete df_mega for msa and hrr
Jun 11, 2020
b911d8d
revert test cases for msa and hrr
Jun 11, 2020
99c3860
resolve conflicts
Jun 11, 2020
eabe624
resolve conflicts
Jun 11, 2020
b67269b
re-activate 7dav_ signal
Jun 11, 2020
50f9e95
change naming for wip signal
Jun 12, 2020
cc203c6
resolve conflicts
Jun 19, 2020
5931e21
Merge pull request #68 from cmu-delphi/jingjing/jhu_with_unassigned
krivard Jun 19, 2020
480ce66
fixed errors in test_smooth
Jun 19, 2020
72c2f73
fixed errors
Jun 19, 2020
1ed824a
recover smoothed signals
Jun 19, 2020
9dc64f1
add .gitignore
Jun 19, 2020
62bc7b3
add gitignore
Jun 19, 2020
64be094
add gitignore
Jun 19, 2020
a7ff6c4
Use receiving directory on runtime host
korlaxxalrok Jun 22, 2020
30017df
Add Ansible-specific entries to ignore
korlaxxalrok Jun 22, 2020
b54d316
Add top-level readme
korlaxxalrok Jun 22, 2020
f2f137b
Update DETAILS.md
jingjtang Jun 22, 2020
dc2c6f7
Add much text to readme
korlaxxalrok Jun 22, 2020
d98a58b
Update README.md
korlaxxalrok Jun 23, 2020
c8902e0
Update README.md
korlaxxalrok Jun 23, 2020
bcfefc7
Update README.md
korlaxxalrok Jun 23, 2020
cf638f5
Update README.md
korlaxxalrok Jun 23, 2020
9eab4b6
Update README.md
korlaxxalrok Jun 23, 2020
3176d4b
Apply suggestions from code review
korlaxxalrok Jun 23, 2020
18f1d23
Fix a wee bit of punctuation
korlaxxalrok Jun 23, 2020
e25084b
Switch back to local directory for csv output
korlaxxalrok Jun 23, 2020
2b7cc96
Merge pull request #105 from cmu-delphi/run-jhu
korlaxxalrok Jun 23, 2020
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,8 @@ venv.bak/

# mypy
.mypy_cache/

# Ansible
.retry
.indicators-ansible-vault-pass
indicators-ansible-vault-pass
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Covidcast Indicators

Pipeline code and supporting libaries for the **Real-time COVID-19 Indicators** used in the Delphi Group's **COVIDcast** map [<https://covidcast.cmu.edu>].

## The indicators

Each subdirectory contained here that is named after an indicator has specific documentation. Please review as necessary!

## General workflow for indicators creation and deployment

**tl;dr**

- Create your new indicator branch from `main`.
- Bulid it according to the established guidelines.
- Make some stuff!
- When your stuff works you can create your remote tracking branch.
- Consult with a platform engineer for the remaining production setup needs.
- Initiate a pull request against the corresponding `deploy-*` branch for your indicator.
- If your peers and Jenkins likes it then merge it to deploy.
- Rejoice!

### Starting out

The `main` branch should contain up-to-date code and supporting libraries This should be your starting point when creating a new indicator.

```shell
# Hint
#
git checkout main
git checkout -b my-feature-branch
```

### Creating your indicator

Review an existing indicator's directory to gain a sense of the pattern(s) to follow (replicate the directory structure, general code structure, linting and test guidelines, etc.)

- Consult your peers with questions! :handshake:

Once you have something that runs locally and passes tests you set up your remote branch eventual review and production deployment.

```shell
# Hint
#
git push -u origin my-feature-branch
```

### Setting up for review and deployment

Once you have your branch set up you should get in touch with a platform engineer to pair up on the remaining production needs. Tasks that may need to be taken care of are:

- Create the corresponding `deploy-*` branch in the repo.
- Add the necessary Jenkins scripts for your indicator.
- Prep the runtime host with any Automation configuration necessities.
- Generally review the workflow to makes sure it meets the general guidelines and will run as expected on the runtime host.

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.

If everything looks ok, platform engineering has validated the last mile, and the pull request is accepted, merge and deployment should start.

Hopefully it'll be a full on :tada: after that :crossed_fingers:

If not, circle back and try again.

## Production overview

### Running production code

Currently, the production indicators all live and run on the venerable and perennially useful Delphi primary server (also known generically as "the runtime host").

- This is a virtual machine running RHEL 7.5 and living in CMU's Campus Cloud vSphere-based infrastructure environemnt.

### Delivering an indicator to the production environment

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.

- 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:
- Environment - Sets up some environment-specific needs that the other stages depend on.
- Build - Create the Python venv on the Jenkins host.
- Test - Run linting and unit tests.
- Package - Tar and gzip the built environment.
- 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).

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.
2 changes: 1 addition & 1 deletion ansible/files/jhu-params-prod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"export_start_date": "2020-02-20",
"static_file_dir": "./static",
"export_dir": "./receiving",
"export_dir": "/common/covidcast/receiving/jhu-csse",
"cache_dir": "./cache",
"base_url": "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_{metric}_US.csv"
}