-
Notifications
You must be signed in to change notification settings - Fork 10
156 lines (138 loc) · 5.15 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: EpiGraphHub
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
_AIRFLOW_DB_UPGRADE: true
_AIRFLOW_WWW_USER_CREATE: true
_AIRFLOW_WWW_USER_EMAIL: [email protected]
_AIRFLOW_WWW_USER_FIRST_NAME: Super
_AIRFLOW_WWW_USER_LAST_NAME: Admin
_AIRFLOW_WWW_USER_PASSWORD: airflow
_AIRFLOW_WWW_USER_USERNAME: airflow
AIRFLOW_FILES_PATH_DIR_HOST: /home/runner/work/EpiGraphHub/EpiGraphHub/containers/airflow
AIRFLOW_HOME: /opt/airflow
AIRFLOW_PORT: 8099
AIRFLOW__API__AUTH_BACKENDS: airflow.api.auth.backend.basic_auth
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: true
AIRFLOW__CORE__FERNET_KEY: rhZaG4rip4DrA4Z93rI9uqWVK2/8Tk+zSixmEe3ZZo8=
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://dev_airflow_user:airflow_password@postgres:25432/dev_airflow
AIRFLOW__WEBSERVER__SECRET_KEY: 79197e3bef40d1d2a6cf07cb1f4c9f54e82a3bcfc6b92ed06d081856eee2
AWS_ACCESS_KEY_ID: minio-user
AWS_SECRET_ACCESS_KEY: minio-password
AWS_DEFAULT_REGION: us-east-1
ENV: dev
FLOWER_PORT: 28888
FLOWER_PASSWORD: flowerpass
MINIO_ROOT_USER: minio-user
MINIO_ROOT_PASSWORD: minio-password
MINIO_PORT_1: 9000
MINIO_PORT_2: 9090
POSTGRES_HOST_UID: 1001
POSTGRES_HOST_GID: 121
POSTGRES_HOST: postgres
POSTGRES_PORT: 25432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_EPIGRAPH_HOST: postgres
POSTGRES_EPIGRAPH_PORT: 25432
POSTGRES_EPIGRAPH_USER: dev_epigraph
POSTGRES_EPIGRAPH_PASSWORD: dev_epigraph
POSTGRES_EPIGRAPH_DB: dev_epigraphhub
POSTGRES_EPIGRAPH_DB_PRIVATE: dev_privatehub
POSTGRES_EPIGRAPH_DB_SANDBOX: dev_sandbox
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: redispass
SUPERSET_PORT: 8088
SUPERSET_DB_PATH_DIR_HOST: /tmp/superset
SUPERSET_DB_PATH_HOST: /tmp/superset/superset.db
SUPERSET_HOME: /opt/data/superset
SUPERSET_MAIL_DEFAULT_SENDER:
SUPERSET_MAIL_PASSWORD:
SUPERSET_MAIL_PORT: 587
SUPERSET_MAIL_SERVER:
SUPERSET_MAIL_USERNAME:
SUPERSET_MAIL_USE_TLS: true
SUPERSET_SECRET_KEY: superset-on-ci
POSTGRES_DATA_DIR_HOST: /home/runner/work/psql_data
POSTGRES_CONFIG_FILE_HOST: /home/runner/work/EpiGraphHub/EpiGraphHub/containers/postgresql/sql/dev/postgresql.conf
SUPERSET_DB_USER: postgres
SUPERSET_DB_PASSWORD: postgres
SUPERSET_DB_DATABASE: postgres
jobs:
main:
runs-on: ubuntu-latest
timeout-minutes: 55
defaults:
run:
shell: bash -l {0}
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- name: Create environment variables file
run: |
export HOST_UID=$(id -u)
export HOST_GID=$(id -g)
export POSTGRES_HOST_UID=$(id -u)
export POSTGRES_HOST_GID=$(id -g)
envsubst < .env.tpl > .env
mkdir /home/runner/work/psql_data
- name: setup
run: |
make prepare-host
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
mamba-version: "*"
environment-file: conda/base.yaml
channels: conda-forge,r,nodefaults
activate-environment: epigraphhub
use-mamba: true
miniforge-variant: Mambaforge
- name: configure epigraphhub credentials
run: |
epigraphhub-config --name ci-epigraphhub \
--db-uri "${POSTGRES_EPIGRAPH_USER}:${POSTGRES_EPIGRAPH_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_EPIGRAPH_DB}"
- name: configure aws s3 credentials to minio
run: make dev-create-s3-credential
- name: build docker containers
run: make containers-build
- name: start services
run: |
make containers-start-services SERVICES="superset airflow postgres"
- name: wait for the services are properly working
run: |
docker ps
make containers-wait-all
- name: run epigraphhub tests
run: |
wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chromedriver-linux64.zip -O /tmp/chromedriver-linux64.zip
unzip /tmp/chromedriver-linux64.zip -d /tmp
sudo rm /usr/bin/chromedriver
sudo mv /tmp/chromedriver-linux64/chromedriver /usr/bin
python -m unittest /home/runner/work/EpiGraphHub/EpiGraphHub/tests/*
# TODO: Fix containers/postgres/sql/dev/02-epigraphhub.sql script
# - name: Trigger all DAGs
# run: |
# make containers-exec ARGS="-T" SERVICE=airflow CMD='airflow dags test owid 2022-10-25'
# make containers-exec ARGS="-T" SERVICE=airflow CMD='airflow dags test foph 2022-10-25'
# make containers-exec ARGS="-T" SERVICE=airflow CMD='airflow dags test colombia 2022-10-25'
# make containers-exec ARGS="-T" SERVICE=airflow CMD='airflow dags test web_status_test 2022-10-25'
- name: Test MinIO access
run: aws --endpoint-url http://localhost:9000/ s3 ls
- name: Generate logs
if: ${{ failure() }}
run: |
make containers-logs ARGS="--tail 1000" SERVICES="" > /tmp/containers-services.log
- name: Archive log artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: containers-services
path: /tmp/containers-services.log