forked from openproblems-bio/openproblems
-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (145 loc) · 5.45 KB
/
process_results.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Process Nextflow results
on:
repository_dispatch:
types: [benchmark_complete]
push:
branches:
- 'test_process'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
process_results:
runs-on: ubuntu-latest
env:
UPDATE_BRANCH_NAME: "auto_update_benchmark_${{ github.run_number }}"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
path: openproblems
- name: Checkout website repo
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: openproblems-bio/website
path: website
token: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
- name: Checkout NBT reproduciblity repo
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: openproblems-bio/nbt2022-reproducibility
path: nbt2022-reproducibility
token: ${{ secrets.GH_ACTIONS_NBT_REPRODUCIBILITY_PAT }}
- name: Set up website Git branch
working-directory: website
run: |
git checkout -b $UPDATE_BRANCH_NAME
- name: Set up nbt2022-reproducibility Git branch
working-directory: nbt2022-reproducibility
run: |
git checkout -b $UPDATE_BRANCH_NAME
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install AWS CLI
run: |
mkdir /tmp/awscli
cd /tmp/awscli
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install || sudo ./aws/install --update
aws --version
- name: Install package & dependencies
run: |
python -m pip install --upgrade pip
pip install -U wheel setuptools
pip install -U --editable ./openproblems[process]
python -c "import openproblems"
- name: Parse results
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
run: |
if [[ ${{ github.event_name }} == "repository_dispatch" ]]; then
S3_URI="s3://openproblems-nextflow/cwd_main"
else
S3_URI="s3://openproblems-nextflow/cwd_example"
fi
aws s3 cp --quiet --recursive "${S3_URI}" /tmp/results/
rm -r nbt2022-reproducibility/results/*/*.json
rm -r website/data/results/*/
python openproblems/workflow/parse_nextflow.py /tmp website/data/results
- name: Upload results
uses: actions/upload-artifact@main
with:
name: results
path: website/data/results
- name: Move raw output
run: |
rsync -v -r --include "*.raw.json" --include "*/" --exclude "*" website/data/results/ nbt2022-reproducibility/results
rm website/data/results/*/*.raw.json
- name: Push to openproblems-bio/website
if: |
github.event_name == 'repository_dispatch' ||
endsWith(github.event.head_commit.message, '# publish')
shell: bash
working-directory: './website'
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
run: |
git push origin "${UPDATE_BRANCH_NAME}"
- name: Create website Pull Request
if: |
github.event_name == 'repository_dispatch' ||
endsWith(github.event.head_commit.message, '# publish')
uses: peter-evans/create-pull-request@v4
with:
branch: ${{ env.UPDATE_BRANCH_NAME }}
delete-branch: true
base: main
title: '[auto] Update benchmark results'
reviewers: scottgigante-immunai,rcannood,dburkhardt
path: './website'
token: ${{ secrets.GH_ACTIONS_WEBSITE_PAT }}
author: "openproblems-bio <[email protected]>"
commit-message: "Update benchmark results"
- name: Push to openproblems-bio/nbt2022-reproducibility
if: |
github.event_name == 'repository_dispatch' ||
endsWith(github.event.head_commit.message, '# publish')
shell: bash
working-directory: './nbt2022-reproducibility'
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_NBT_REPRODUCIBILITY_PAT }}
run: |
git push origin "${UPDATE_BRANCH_NAME}"
- name: Create nbt2022-reproducibility Pull Request
if: |
github.event_name == 'repository_dispatch' ||
endsWith(github.event.head_commit.message, '# publish')
uses: peter-evans/create-pull-request@v4
with:
branch: ${{ env.UPDATE_BRANCH_NAME }}
delete-branch: true
base: main
title: '[auto] Update benchmark results'
reviewers: scottgigante-immunai,rcannood
path: './nbt2022-reproducibility'
token: ${{ secrets.GH_ACTIONS_NBT_REPRODUCIBILITY_PAT }}
author: "openproblems-bio <[email protected]>"
commit-message: "Update benchmark results"
- name: AWS S3 cleanup
if: "github.event_name == 'repository_dispatch'"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
run: |
aws s3 rm --recursive "s3://openproblems-nextflow/work_main"
aws s3 rm --recursive "s3://openproblems-nextflow/cwd_example"
aws s3 cp --recursive "s3://openproblems-nextflow/cwd_main" "s3://openproblems-nextflow/cwd_example"
aws s3 rm --recursive "s3://openproblems-nextflow/cwd_main"