Skip to content

Add new configuration to set up safegraph deployment branch #182

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 72 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
cee3e14
update cache
huisaddison Jun 2, 2020
63dc22e
remove default end_date
huisaddison Jun 2, 2020
fbf218f
update start_date
huisaddison Jun 2, 2020
1df4d22
update cache
Jun 4, 2020
9771171
update cache
Jun 5, 2020
535b76a
update cache
Jun 6, 2020
97f4172
update cache
Jun 7, 2020
dd52749
update cache
Jun 8, 2020
751cfdc
update cache
Jun 10, 2020
42daeb2
update cache
Jun 11, 2020
34557ba
update cache
Jun 12, 2020
27385f1
update cache
Jun 13, 2020
6319831
update cache
Jun 14, 2020
aed978a
update cache
Jun 15, 2020
d3dd000
update cache
Jun 16, 2020
70f4739
update cache
Jun 17, 2020
182820a
update cache
Jun 18, 2020
b29a29e
update cache
Jun 19, 2020
f8c6468
update cache
Jun 20, 2020
858d6fc
update cache
Jun 21, 2020
c0d54d4
update cache
Jun 22, 2020
5e3113a
update cache
Jun 23, 2020
269cb40
update cache
Jun 24, 2020
227d951
update cache
Jun 25, 2020
d7e40b1
update cache
Jun 26, 2020
57c0399
update cache
Jun 27, 2020
40be88e
update cache
Jun 28, 2020
25f3768
update cache
Jun 29, 2020
3381fe9
update cache
Jun 30, 2020
8a862d2
update cache
Jul 1, 2020
9598aea
update cache
Jul 2, 2020
fca5955
update cache
Jul 3, 2020
4878335
update cache
Jul 4, 2020
de60ba1
update cache
Jul 5, 2020
51a357e
update cache
Jul 6, 2020
3839aae
update cache
Jul 7, 2020
510373b
update cache
Jul 8, 2020
a59e76e
update cache
Jul 9, 2020
a67ff51
update cache
Jul 10, 2020
c4eb952
update cache
Jul 11, 2020
0a1e77d
update cache
Jul 12, 2020
94b84fd
update cache
Jul 13, 2020
a1b0dcd
update cache
Jul 14, 2020
e0b1775
update cache
Jul 15, 2020
c8998df
update cache
Jul 16, 2020
38976a5
update cache
Jul 17, 2020
6f1eefa
update cache
Jul 18, 2020
1fdaae4
update cache
Jul 19, 2020
dad05ad
update cache
Jul 20, 2020
23419b8
update cache
Jul 21, 2020
ec75fed
update cache
Jul 22, 2020
8794c3a
update cache
Jul 23, 2020
65f7264
update cache
Jul 24, 2020
bc283b4
update cache
Jul 25, 2020
3745242
update cache
Jul 26, 2020
5fce3d1
update cahce
Jul 27, 2020
ad84a39
Set up initial google_health-deploy branch
korlaxxalrok Jul 24, 2020
8c038c4
Use templates dir
korlaxxalrok Jul 24, 2020
cb8db3a
Merge branch 'run-ght' into bgc-productionize-google_health
korlaxxalrok Jul 27, 2020
cf4b8b3
Remove end date from params
korlaxxalrok Jul 27, 2020
36fe00b
Switch to midas export dir
korlaxxalrok Jul 27, 2020
f78eae5
Properly rename Jenkins pipeline stage scripts
korlaxxalrok Jul 27, 2020
5e82a34
Handle google_health's testing needs
korlaxxalrok Jul 28, 2020
a67ff3d
Change to the Ansible root dir before trying to do Ansible things
korlaxxalrok Jul 28, 2020
5f49b7c
Delegate to localhost
korlaxxalrok Jul 28, 2020
6cd76a0
Tell Ansible we want to connect locally for this playbook
korlaxxalrok Jul 29, 2020
c5caa7f
Remove set -x from Bash scripts
korlaxxalrok Jul 29, 2020
0b56c33
Merge branch 'bgc-finalize-production-config' into build-deploy-safeg…
korlaxxalrok Aug 4, 2020
a189aa0
Add initial Jenkins/Ansible necessities for CI/CD
korlaxxalrok Aug 5, 2020
a27e921
Remove ght cache files
korlaxxalrok Aug 5, 2020
ad43bca
Disable pylint convention messages
korlaxxalrok Aug 5, 2020
055564b
Work around linter errors
korlaxxalrok Aug 5, 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
18 changes: 18 additions & 0 deletions ansible/ansible-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- hosts: runtime_host
vars_files:
- vars.yaml
- vault.yaml
tasks:
- name: Copy and unarchive the package into the indicators runtime host directory.
unarchive:
Expand All @@ -18,9 +19,26 @@
group: "{{ runtime_user }}"
state: link

- name: Check to see if we have a params file to send.
local_action: stat files/{{ indicator }}-params-prod.json
register: file

- name: Check to see if we have a params template to send.
local_action: stat templates/{{ indicator }}-params-prod.json.j2
register: template

- name: Set production params file.
copy:
src: files/{{ indicator }}-params-prod.json
dest: "{{ indicators_runtime_dir }}/{{ indicator }}/params.json"
owner: "{{ runtime_user }}"
group: "{{ runtime_user }}"
when: file.stat.exists

- name: Set production params template.
template:
src: templates/{{ indicator }}-params-prod.json.j2
dest: "{{ indicators_runtime_dir }}/{{ indicator }}/params.json"
owner: "{{ runtime_user }}"
group: "{{ runtime_user }}"
when: template.stat.exists
15 changes: 15 additions & 0 deletions ansible/google_health-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- hosts: localhost
connection: local
vars_files:
- vars.yaml
- vault.yaml
tasks:
- name: Set test params template.
template:
src: templates/{{ indicator }}-params-test.json.j2
dest: "{{ workspace }}/{{ indicator }}/tests/params.json"
owner: "{{ jenkins_user }}"
group: "{{ jenkins_user }}"
mode: "0644"
delegate_to: localhost
8 changes: 8 additions & 0 deletions ansible/templates/google_health-params-prod.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"static_file_dir": "./static",
"export_dir": "/common/covidcast/receiving/ght",
"cache_dir": "./cache",
"start_date": "2020-02-01",
"end_date": "",
"ght_key": "{{ google_health_api_key }}"
}
8 changes: 8 additions & 0 deletions ansible/templates/google_health-params-test.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"static_file_dir": "../static",
"export_dir": "./receiving",
"cache_dir": "../cache",
"start_date": "2020-02-11",
"end_date": "2020-04-30",
"ght_key": "{{ google_health_api_key }}"
}
11 changes: 11 additions & 0 deletions ansible/templates/safegraph-params-prod.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"static_file_dir": "./static",
"raw_data_dir": "/common/safegraph",
"export_dir": "./receiving",
"cache_dir": "./cache",
"n_core": "6",
"aws_access_key_id": "{{ safegraph_aws_access_key_id }}",
"aws_secret_access_key": "{{ safegraph_aws_secret_access_key }}",
"aws_default_region": "us-east-1",
"aws_endpoint": "https://s3.wasabisys.com"
}
8 changes: 7 additions & 1 deletion ansible/vars.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
---
runtime_user: "indicators"
jenkins_user: "jenkins"
jenkins_artifact_dir: "/var/lib/jenkins/artifacts"
indicators_runtime_dir: "/home/{{ runtime_user }}/runtime"
package: "{{ indicator }}.tar.gz" # This is passed in the Ansible invocation.
package: "{{ indicator }}.tar.gz" # {{ indicator }} is passed in from the Jenkins shell script wrapper.
python_version: "3.8.2"
pyenv_python_path: "/home/{{ runtime_user }}/.pyenv/versions/{{ python_version }}/bin/python"

# Indicators variables.
google_health_api_key: "{{ vault_google_health_api_key }}"
safegraph_aws_access_key_id: "{{ vault_safegraph_aws_access_key_id }}"
safegraph_aws_secret_access_key: "{{ vault_aws_safegraph_secret_access_key }}"
16 changes: 16 additions & 0 deletions ansible/vault.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$ANSIBLE_VAULT;1.1;AES256
39626439303237333632613162313237313935316232393262346461353534356537376136646336
6562346664633562363466373230303931313139306163350a633130356639343830613030633839
65616533653265653636613337333634333439643762376162626262653730653632643462366464
6134633532303530320a636464346365373463356566353438316233333632353235313463336134
30613531323236393833343462336362353734613065313364316330376635633035653366376631
38373630653638643536643936313063646436663861323838313564633430613635613062383938
31323932336132353938613661333531626162323163373234613830663361643830343536396432
32613739366331636561656237316432653665613366393265663336343465656437333331353764
33313666663439646637313466386262383332653934336233646565383833633462346137653038
65666332646162323663656135343536623533363530623566353963663930633135663136666265
38383761323064613432623439663732656639613264303736343538396166303363653262636538
36376463613335636433326336353165666237663637666333383039353938303962366636363734
64393566363730316231393362326161393063373565313133646661366562353039303965353037
66386364303837666466383865333730396339353235653634623735306431383730636434306536
353937393766396332646232666336343266
133 changes: 0 additions & 133 deletions google_health/cache/Data_500_anosmia_ms.csv

This file was deleted.

133 changes: 0 additions & 133 deletions google_health/cache/Data_501_anosmia_ms.csv

This file was deleted.

Loading