-
Notifications
You must be signed in to change notification settings - Fork 16
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
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 44febee
update code for unassigned cases/deaths
849a32e
update the dict for fake fips
f1f5cdd
Set population for fake fips as NAN
84bbfc6
update geo_id for megacounty
339eac5
update cache
8c538e3
Cut 7-day avg signal name
e2d8254
Cut 7-day avg signal name
030d38a
update naming for megacounty
f66b43e
modify test cases for megacounty aggregation
49be65d
delete whitespace
7ee404c
delete whitespace
25162d0
Update jhu/tests/test_geo.py
jingjtang 0dae169
Update jhu/tests/test_geo.py
jingjtang 64790fb
Update jhu/tests/test_geo.py
jingjtang 435f63d
disable 7dav_ signals temporarily
d187ebc
disable 7dav_ signal
131b88b
cut 7day avg signal name
003ac0c
delete df_mega for msa and hrr
b911d8d
revert test cases for msa and hrr
99c3860
resolve conflicts
eabe624
resolve conflicts
b67269b
re-activate 7dav_ signal
50f9e95
change naming for wip signal
cc203c6
resolve conflicts
5931e21
Merge pull request #68 from cmu-delphi/jingjing/jhu_with_unassigned
krivard 480ce66
fixed errors in test_smooth
72c2f73
fixed errors
1ed824a
recover smoothed signals
9dc64f1
add .gitignore
62bc7b3
add gitignore
64be094
add gitignore
a7ff6c4
Use receiving directory on runtime host
korlaxxalrok 30017df
Add Ansible-specific entries to ignore
korlaxxalrok b54d316
Add top-level readme
korlaxxalrok f2f137b
Update DETAILS.md
jingjtang dc2c6f7
Add much text to readme
korlaxxalrok d98a58b
Update README.md
korlaxxalrok c8902e0
Update README.md
korlaxxalrok bcfefc7
Update README.md
korlaxxalrok cf638f5
Update README.md
korlaxxalrok 9eab4b6
Update README.md
korlaxxalrok 3176d4b
Apply suggestions from code review
korlaxxalrok 18f1d23
Fix a wee bit of punctuation
korlaxxalrok e25084b
Switch back to local directory for csv output
korlaxxalrok 2b7cc96
Merge pull request #105 from cmu-delphi/run-jhu
korlaxxalrok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -118,3 +118,8 @@ venv.bak/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# Ansible | ||
.retry | ||
.indicators-ansible-vault-pass | ||
indicators-ansible-vault-pass |
This file contains hidden or 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 |
---|---|---|
@@ -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. | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Make some stuff! | ||
- When your stuff works you can create your remote tracking branch. | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Consult with a platform engineer for the remaining production setup needs. | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Initiate a pull request against the corresponding `deploy-*` branch for your indicator. | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- If your peers and Jenkins likes it then merge it to deploy. | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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 | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
### 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.) | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- 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 | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
### 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: | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- 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. | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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. | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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. |
This file contains hidden or 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,7 +1,7 @@ | ||
{ | ||
"export_start_date": "2020-02-20", | ||
"static_file_dir": "./static", | ||
"export_dir": "./receiving", | ||
"export_dir": "/common/covidcast/receiving/jhu-csse", | ||
korlaxxalrok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"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" | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.