-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile-redo-solr
192 lines (188 loc) · 6.26 KB
/
Jenkinsfile-redo-solr
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
pipeline {
agent { label 'monarch-agent-large' }
environment {
HOME = "${env.WORKSPACE}"
PATH = "/opt/poetry/bin:${env.PATH}"
AWS_ACCESS_KEY_ID = credentials('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY')
}
stages {
stage('Setup parameters') {
steps {
script {
properties([
parameters([
stringParam(
defaultValue: 'latest',
description: 'monarch-kg-dev release',
name: 'RELEASE'
),
booleanParam(
defaultValue: true,
description: 'Run KGX Graph Summary',
name: 'KGX_GRAPH_SUMMARY'
),
booleanParam(
defaultValue: true,
description: 'Re-run denormalization step',
name: 'RUN_CLOSURIZER'
),
booleanParam(
defaultValue: false,
description: 'Load Solr',
name: 'SOLR'
),
booleanParam(
defaultValue: false,
description: 'Load sqlite',
name: 'SQLITE'
),
booleanParam(
defaultValue: false,
description: 'Make TSV Exports',
name: 'EXPORT'
),
booleanParam(
defaultValue: false,
description: 'Make JSONL Export',
name: 'JSONL'
),
booleanParam(
defaultValue: false,
description: 'Run KGX Transforms',
name: 'KGX_TRANSFORMS'
),
booleanParam(
defaultValue: false,
description: 'Upload to bucket',
name: 'UPLOAD'
),
booleanParam(
defaultValue: false,
description: 'Update dev deployment to latest release',
name: 'UPDATE_DEV'
)
])
])
}
}
}
stage('setup') {
steps {
sh '''
echo "Current directory: $(pwd)"
# export PATH=$PATH:$HOME/.local/bin
echo "Path: $PATH"
# echo $SHELL
python3 --version
pip --version
poetry --version
# poetry config experimental.new-installer false
poetry install --with dev
poetry run which ingest
'''
}
}
stage('download kg artifacts') {
steps {
sh '''
mkdir output || true
mkdir data || true
gsutil -q -m cp -r gs://data-public-monarchinitiative/monarch-kg-dev/$RELEASE/* output/
gsutil -q -m cp -r gs://monarch-ingest-data-cache/* data/
ls -lasdf
'''
}
}
stage('kgx-graph-summary') {
when {
expression {
return params.KGX_GRAPH_SUMMARY
}
}
steps {
sh 'poetry run kgx graph-summary -i tsv -c "tar.gz" --node-facet-properties provided_by --edge-facet-properties provided_by output/monarch-kg.tar.gz -o output/merged_graph_stats.yaml'
}
}
stage('denormalize') {
when {
expression {
return params.RUN_CLOSURIZER
}
}
steps {
sh 'poetry run ingest closure'
}
}
stage('solr') {
when {
expression {
return params.SOLR
}
}
steps {
sh 'poetry run ingest solr'
}
}
stage('sqlite') {
when {
expression {
return params.SQLITE
}
}
steps {
sh 'poetry run ingest sqlite'
}
}
stage('make tsv exports') {
when {
expression {
return params.EXPORT
}
}
steps {
sh 'poetry run ingest export'
}
}
stage("jsonl") {
when {
expression {
return params.JSONL
}
}
steps {
sh 'poetry run ingest jsonl'
}
}
stage('kgx-transforms'){
when {
expression {
return params.KGX_TRANSFORMS
}
}
steps {
sh './scripts/kgx_transforms.sh'
}
}
stage('upload files') {
when {
expression {
return params.UPLOAD
}
}
steps {
sh 'scripts/update_latest_release.sh'
}
}
stage('update dev deployment') {
when {
expression {
return params.UPDATE_DEV
}
}
steps {
sh 'poetry run python scripts/update-dev-solr.py'
}
}
}
}