-
Notifications
You must be signed in to change notification settings - Fork 2
151 lines (137 loc) · 4.45 KB
/
run-archiver.yml
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
---
name: run-archiver
on:
workflow_dispatch:
schedule:
- cron: "21 8 1 * *" # 8:21 AM UTC, first of every month
jobs:
archive-run-small:
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
dataset:
- ferceqr
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Conda environment using mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: true
condarc: |
channels:
- conda-forge
- defaults
channel_priority: strict
- name: Log the conda environment
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Run archiver for ${{ matrix.dataset }}
env:
ZENODO_SANDBOX_TOKEN_UPLOAD: ${{ secrets.ZENODO_SANDBOX_TOKEN_UPLOAD }}
ZENODO_SANDBOX_TOKEN_PUBLISH: ${{ secrets.ZENODO_SANDBOX_TOKEN_PUBLISH }}
EPACEMS_API_KEY: ${{ secrets.EPACEMS_API_KEY }}
ZENODO_TOKEN_UPLOAD: ${{ secrets.ZENODO_TOKEN_UPLOAD }}
ZENODO_TOKEN_PUBLISH: ${{ secrets.ZENODO_TOKEN_PUBLISH }}
run: |
pudl_archiver --datasets ${{ matrix.dataset }} --summary-file ${{ matrix.dataset }}_run_summary.json --resume-run
- name: Upload run summaries
if: always()
id: upload_summaries
uses: actions/upload-artifact@v4
with:
name: run-summaries-${{ matrix.dataset }}
path: ${{ matrix.dataset }}_run_summary.json
archive-run-large:
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
dataset:
- epacems
fail-fast: false
runs-on:
group: large-runner-group
labels: ubuntu-22.04-4core
steps:
- uses: actions/checkout@v4
- name: Install Conda environment using mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: true
condarc: |
channels:
- conda-forge
- defaults
channel_priority: strict
- name: Log the conda environment
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Run archiver for ${{ matrix.dataset }}
env:
ZENODO_SANDBOX_TOKEN_UPLOAD: ${{ secrets.ZENODO_SANDBOX_TOKEN_UPLOAD }}
ZENODO_SANDBOX_TOKEN_PUBLISH: ${{ secrets.ZENODO_SANDBOX_TOKEN_PUBLISH }}
EPACEMS_API_KEY: ${{ secrets.EPACEMS_API_KEY }}
ZENODO_TOKEN_UPLOAD: ${{ secrets.ZENODO_TOKEN_UPLOAD }}
ZENODO_TOKEN_PUBLISH: ${{ secrets.ZENODO_TOKEN_PUBLISH }}
run: |
pudl_archiver --datasets ${{ matrix.dataset }} --summary-file ${{ matrix.dataset }}_run_summary.json
- name: Upload run summaries
if: failure() || success()
id: upload_summaries
uses: actions/upload-artifact@v4
with:
name: run-summaries-${{ matrix.dataset }}
path: ${{ matrix.dataset }}_run_summary.json
- name: Upload checkpoints
if: failure() || success()
id: upload_checkpoint
uses: actions/upload-artifact@v4
with:
name: run-checkpoint-${{ matrix.dataset }}
path: .checkpoints/${{ matrix.dataset }}.json
archive-notify:
runs-on: ubuntu-latest
needs:
- archive-run-small
- archive-run-large
if: ${{ always() }}
steps:
- uses: actions/checkout@v4
- name: Download summaries
id: download
uses: actions/download-artifact@v4
with:
pattern: run-summaries-*
merge-multiple: true
- name: show summaries
run: ls -R
- name: Munge summaries together
id: all_summaries
run: |
{
echo "SLACK_PAYLOAD<<EOF"
./scripts/make_slack_notification_message.py --summary-files *_run_summary.json | tee slack-payload.json
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Post update to pudl-deployment
uses: slackapi/slack-github-action@v1.25.0
with:
channel-id: "C03FHB9N0PQ"
payload: ${{ steps.all_summaries.outputs.SLACK_PAYLOAD }}
env:
SLACK_BOT_TOKEN: ${{ secrets.PUDL_DEPLOY_SLACK_TOKEN }}