-
Notifications
You must be signed in to change notification settings - Fork 2
354 lines (330 loc) · 13.5 KB
/
production_ci.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
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
name: Production CI Pipeline
on:
workflow_dispatch:
inputs:
tag:
description: "The release version and tag."
required: true
type: string
concurrency: ci
jobs:
# cada job necesita el anterior
update_versions:
runs-on: ubuntu-latest
env:
GHCR_TOKEN: ${{ secrets.ADMIN_TOKEN }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: main
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "poetry"
- name: Install dependencies
run: |
cd ci
poetry install
- name: Run dagger pipeline
run: |
cd ci
poetry run python main.py update version \
alert_archiving_step correction_step early_classification_step feature_step \
lc_classification_step lightcurve-step magstats_step metadata_step prv_candidates_step \
s3_step scribe sorting_hat_step watchlist_step xmatch_step \
--stage=production --version=${{ inputs.tag }}
build-alert-archiving-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: alert_archiving_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-correction-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: correction_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-early-classification-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: early_classification_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-feature-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: feature_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-lc-classification-balto-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: lc_classification_step_balto --build-args=model:balto --package-dir=lc_classification_step
submodules: true
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-lc-classification-messi-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: lc_classification_step_messi --build-args=model:messi --package-dir=lc_classification_step
submodules: true
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-lc-classification-mlp-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: lc_classification_step_mlp --build-args=model:mlp --package-dir=lc_classification_step
submodules: true
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-lc-classification-ztf-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: lc_classification_step_ztf --build-args=model:ztf --package-dir=lc_classification_step
submodules: true
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-lightcurve-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: lightcurve-step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-magstats-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: magstats_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-metadata-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: metadata_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-prv-candidates-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: prv_candidates_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-s3-step-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: s3_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-scribe-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: scribe
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-sorting-hat-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: sorting_hat_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-watchlist-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: watchlist_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
build-xmatch-dagger:
needs: update_versions
uses: ./.github/workflows/template_build_with_dagger.yaml
with:
stage: production
extra-args: xmatch_step
secrets:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
release-chart:
needs:
- build-alert-archiving-dagger
- build-correction-dagger
- build-early-classification-dagger
- build-feature-dagger
- build-lc-classification-balto-dagger
- build-lc-classification-messi-dagger
- build-lc-classification-mlp-dagger
- build-lc-classification-ztf-dagger
- build-lightcurve-dagger
- build-magstats-dagger
- build-metadata-dagger
- build-prv-candidates-dagger
- build-s3-step-dagger
- build-scribe-dagger
- build-sorting-hat-dagger
- build-watchlist-dagger
- build-xmatch-dagger
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Configure Git
run: |
git config user.name "alerceadmin"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.ADMIN_TOKEN }}"
deploy_production:
needs: release-chart
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
- name: Configure AWS credentials
id: creds
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: us-east-1
output-credentials: true
unset-current-credentials: true
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "poetry"
- name: Install dependencies
run: |
cd ci
poetry install
- name: Run dagger pipeline
run: |
cd ci
poetry run python main.py deploy prepare
poetry run python main.py deploy add-package alert-archive-step --chart=alert-archive-step --values=alert_archive_step-helm-values --chart-folder=alert_archiving_step
poetry run python main.py deploy add-package correction-step --chart=correction-step --values=correction_step-helm-values --chart-folder=correction_step
poetry run python main.py deploy add-package early-classifier-step --chart=early-classifier --values=early_classification_step-helm-values --chart-folder=early_classification_step
poetry run python main.py deploy add-package feature-step --chart=feature-step --values=feature_step-helm-values --chart-folder=feature_step
poetry run python main.py deploy add-package lc-classifier-step --chart=lc-classifier-step --values=lc_classification_step_ztf-helm-values --chart-folder=lc_classification_step
poetry run python main.py deploy add-package lightcurve-step --chart=lightcurve-step --values=lightcurve-step-helm-values --chart-folder=lightcurve-step
poetry run python main.py deploy add-package magstats-step --chart=magstats-step --values=magstats_step-helm-values --chart-folder=magstats_step
poetry run python main.py deploy add-package metadata-step --chart=metadata-step --values=metadata_step-helm-values --chart-folder=metadata_step
poetry run python main.py deploy add-package prv-candidates-step --chart=prv-candidates --values=prv_candidates_step-helm-values --chart-folder=prv_candidates_step
poetry run python main.py deploy add-package s3-step --chart=s3-step --values=s3_step-helm-values --chart-folder=s3_step
poetry run python main.py deploy add-package scribe-psql --chart=scribe --values=scribe_step_psql-helm-values --chart-folder=scribe
poetry run python main.py deploy add-package scribe-mongo --chart=scribe --values=scribe_step_mongo-helm-values --chart-folder=scribe
poetry run python main.py deploy add-package sorting-hat-step-ztf --chart=sorting-hat --values=sorting_hat_step_ztf-helm-values --chart-folder=sorting_hat_step
poetry run python main.py deploy add-package sorting-hat-step-atlas --chart=sorting-hat --values=sorting_hat_step_atlas-helm-values --chart-folder=sorting_hat_step
poetry run python main.py deploy add-package xmatch-step --chart=xmatch-step --values=xmatch_step-helm-values --chart-folder=xmatch_step
poetry run python main.py deploy add-package watchlist-step --chart=watchlist-step --values=watchlist_step-helm-values --chart-folder=watchlist_step
poetry run python main.py deploy execute --stage=production --clear
deploy_elasticc:
needs: release-chart
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
- name: Configure AWS credentials
id: creds
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: us-east-1
output-credentials: true
unset-current-credentials: true
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "poetry"
- name: Install dependencies
run: |
cd ci
poetry install
- name: Run dagger pipeline
run: |
cd ci
poetry run python main.py deploy prepare
poetry run python main.py deploy add-package correction-step-elasticc --chart=correction-step --values=correction_step-helm-values-elasticc --chart-folder=correction_step
poetry run python main.py deploy add-package feature-step-elasticc --chart=feature-step --values=feature_step-helm-values-elasticc --chart-folder=feature_step
poetry run python main.py deploy add-package balto-classifier --chart=lc-classifier-step --values=balto-helm-values --chart-folder=lc_classification_step
poetry run python main.py deploy add-package messi-classifier --chart=lc-classifier-step --values=messi-helm-values --chart-folder=lc_classification_step
poetry run python main.py deploy add-package tinkywinky-classifier --chart=lc-classifier-step --values=tinkywinky-helm-values --chart-folder=lc_classification_step
poetry run python main.py deploy add-package lightcurve-step-elasticc --chart=lightcurve-step --values=lightcurve-step-helm-values-elasticc --chart-folder=lightcurve-step
poetry run python main.py deploy add-package magstats-step-elasticc --chart=magstats-step --values=magstats_step-helm-values-elasticc --chart-folder=magstats_step
poetry run python main.py deploy add-package prv-candidates-step-elasticc --chart=prv-candidates --values=prv_candidates_step-helm-values-elasticc --chart-folder=prv_candidates_step
poetry run python main.py deploy add-package scribe-elasticc --chart=scribe --values=scribe_step-helm-values-elasticc --chart-folder=scribe
poetry run python main.py deploy add-package sorting-hat-step-elasticc --chart=sorting-hat --values=sorting_hat_step-helm-values-elasticc --chart-folder=sorting_hat_step
poetry run python main.py deploy add-package xmatch-step-elasticc --chart=xmatch-step --values=xmatch_step-helm-values-elasticc --chart-folder=xmatch_step
poetry run python main.py deploy execute --stage=production --clear
create_realease:
needs: deploy_production
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
with:
tag_name: ${{ inputs.tag }}
release_name: Release ${{ inputs.tag }}
body: |
Changes in this Release
draft: false
prerelease: false