-
Notifications
You must be signed in to change notification settings - Fork 31
322 lines (278 loc) · 13.6 KB
/
daily-rocker-builds.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
name: Extra rocker builds
on:
workflow_dispatch:
inputs:
rver:
default: "devel"
biocver:
default: "3.21"
check-rocker-image:
default: "rocker/rstudio"
schedule:
- cron: '0 18 * * *'
jobs:
check_versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set defaults for schedule
id: defs
run: |
echo rver=$(echo ${{ github.event.inputs.rver || 'devel' }}) >> $GITHUB_OUTPUT
BIOCVER=$(echo ${{ github.event.inputs.biocver || '3.21' }})
echo "develbiocver=$BIOCVER" >> $GITHUB_OUTPUT
echo check-rocker-image=$(echo ${{ github.event.inputs.check-rocker-image || 'rocker/rstudio' }}) >> $GITHUB_OUTPUT
RELEASE_BIOC_VER=$(echo "${BIOCVER%.*}.$((${BIOCVER##*.}-1))")
echo "releasebiocver=$RELEASE_BIOC_VER" >> $GITHUB_OUTPUT
echo release-tag=$(echo "RELEASE_${RELEASE_BIOC_VER}" | sed 's/\./_/g') >> $GITHUB_OUTPUT
- name: Bump R version
id: rbump
run: |
curl https://hub.docker.com/v2/repositories/${{steps.defs.outputs.check-rocker-image}}/tags | jq '.results[].name' | tr -d '"' > /tmp/taglist
curl https://raw.githubusercontent.com/${{ github.repository }}/${{steps.defs.outputs.release-tag}}/.github/workflows/build_containers.yaml | grep 'amdtag' | awk -F"'" '/amdtag:/ {print $4}' | uniq > /tmp/currtag
RELEASE_R_VER=$(curl https://bioconductor.org/config.yaml | yq e '.r_ver_for_bioc_ver."${{steps.defs.outputs.releasebiocver}}"')
LATEST_TAG=$(cat /tmp/taglist | grep "$RELEASE_R_VER" | sort -n | tail -n 1)
CURR_TAG=$(cat /tmp/currtag | sort -n | tail -n 1)
echo latest-tag=$LATEST_TAG >> $GITHUB_OUTPUT
if [ "$LATEST_TAG" == "$CURR_TAG" ]; then
echo "Detected '$LATEST_TAG' == '$CURR_TAG' as latest available tag"
echo verdict="no" >> $GITHUB_OUTPUT
else
echo "Detected mismatching versions latest '$LATEST_TAG' != '$CURR_TAG' current tag"
mkdir -p ${{github.workspace}}/tmp/${{github.repository}}
git clone https://github.com/${{github.repository}} -b ${{steps.defs.outputs.release-tag}} ${{github.workspace}}/tmp/${{github.repository}}
cd ${{github.workspace}}/tmp/${{github.repository}}
AUTO_BRANCH="auto-bump-${{steps.defs.outputs.releasebiocver}}-for-${LATEST_TAG}"
sed -i "s/$CURR_TAG/$LATEST_TAG/g" .github/workflows/build_containers.yaml
sed -r -i 's/(^ARG BIOCONDUCTOR_PATCH=)([0-9]+)$/echo "\1$((\2+1))"/ge' Dockerfile
echo verdict="yes" >> $GITHUB_OUTPUT
fi
- name: Open pull request
id: cpr
uses: peter-evans/create-pull-request@v6
if: steps.rbump.outputs.verdict == 'yes'
with:
token: ${{secrets.PAT}}
commit-message: Auto-bump ${{steps.rbump.outputs.latest-tag}}
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
base: ${{steps.defs.outputs.release-tag}}
path: ${{github.workspace}}/tmp/${{github.repository}}
branch: auto-bump-bioc-${{steps.defs.outputs.release-tag}}-r-${{steps.rbump.outputs.latest-tag}}
title: '[Auto] Bumping ${{steps.defs.outputs.release-tag}} branch to R ${{steps.rbump.outputs.latest-tag}}'
body: |
Bumping R version.
Note that the Bioconductor automatic PR bot is experimental, please make sure to check the changes manually before merging.
labels: |
auto-bump
buildrver:
strategy:
matrix:
arch: [amd64, arm64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Free root space
uses: almahmoud/free-root-space@main
with:
verbose: true
- name: Set defaults for schedule
id: defs
run: |
echo rver=$(echo ${{ github.event.inputs.rver || 'devel' }}) >> $GITHUB_OUTPUT
echo biocver=$(echo ${{ github.event.inputs.biocver || '3.21' }}) >> $GITHUB_OUTPUT
echo registryuser=$(echo ${{ github.repository_owner }} | awk '{print tolower($0)}') >> $GITHUB_OUTPUT
echo rockerintermediateprefix=$(echo "ghcr.io/${{ github.repository_owner }}/rocker" | awk '{print tolower($0)}') >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: matrix.arch == 'arm64'
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prep rocker rocker files
run: bash .github/scripts/rocker_prep.sh ${{ steps.defs.outputs.rver }} ${{ steps.defs.outputs.biocver }} ${{ steps.defs.outputs.rockerintermediateprefix }} ${{ matrix.arch }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/${{ matrix.arch }}
- name: Build and push r-ver
uses: docker/build-push-action@v3
with:
file: rocker-versioned2/dockerfiles/r-ver_${{ steps.defs.outputs.rver }}.Dockerfile
context: rocker-versioned2
push: true
tags: ${{ steps.defs.outputs.rockerintermediateprefix }}-r-ver:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
buildrstudio:
strategy:
matrix:
arch: [amd64, arm64]
needs: buildrver
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Free root space
uses: almahmoud/free-root-space@main
with:
verbose: true
- name: Set defaults for schedule
id: defs
run: |
echo rver=$(echo ${{ github.event.inputs.rver || 'devel' }}) >> $GITHUB_OUTPUT
echo biocver=$(echo ${{ github.event.inputs.biocver || '3.21' }}) >> $GITHUB_OUTPUT
echo registryuser=$(echo ${{ github.repository_owner }} | awk '{print tolower($0)}') >> $GITHUB_OUTPUT
echo rockerintermediateprefix=$(echo "ghcr.io/${{ github.repository_owner }}/rocker" | awk '{print tolower($0)}') >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: matrix.arch == 'arm64'
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prep rocker rocker files
run: |
bash .github/scripts/rocker_prep.sh ${{ steps.defs.outputs.rver }} ${{ steps.defs.outputs.biocver }} ${{ steps.defs.outputs.rockerintermediateprefix }} ${{ matrix.arch }}
- name: Move some tidyverse builds to docker for arm64 to avoid timeout
run: |
head -n44 rocker-versioned2/scripts/install_tidyverse.sh >> rocker-versioned2/scripts/install_rstudio.sh
sed -i "\|RUN /rocker_scripts/install_rstudio.sh|i COPY scripts /rocker_scripts" rocker-versioned2/dockerfiles/rstudio_${{ steps.defs.outputs.rver }}.Dockerfile
if: matrix.arch == 'arm64'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/${{ matrix.arch }}
- name: Build and push rstudio
uses: docker/build-push-action@v3
with:
file: rocker-versioned2/dockerfiles/rstudio_${{ steps.defs.outputs.rver }}.Dockerfile
context: rocker-versioned2
push: true
tags: ${{ steps.defs.outputs.rockerintermediateprefix }}-rstudio:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
buildtidyverse:
strategy:
matrix:
arch: [amd64, arm64]
runs-on: ubuntu-latest
needs: buildrstudio
steps:
- uses: actions/checkout@v3
- name: Free root space
uses: almahmoud/free-root-space@main
with:
verbose: true
- name: Set defaults for schedule
id: defs
run: |
echo rver=$(echo ${{ github.event.inputs.rver || 'devel' }}) >> $GITHUB_OUTPUT
echo biocver=$(echo ${{ github.event.inputs.biocver || '3.21' }}) >> $GITHUB_OUTPUT
echo registryuser=$(echo ${{ github.repository_owner }} | awk '{print tolower($0)}') >> $GITHUB_OUTPUT
echo rockerintermediateprefix=$(echo "ghcr.io/${{ github.repository_owner }}/rocker" | awk '{print tolower($0)}') >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: matrix.arch == 'arm64'
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prep rocker rocker files
run: bash .github/scripts/rocker_prep.sh ${{ steps.defs.outputs.rver }} ${{ steps.defs.outputs.biocver }} ${{ steps.defs.outputs.rockerintermediateprefix }} ${{ matrix.arch }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/${{ matrix.arch }}
- name: Build and push tidyverse
uses: docker/build-push-action@v3
with:
file: rocker-versioned2/dockerfiles/tidyverse_${{ steps.defs.outputs.rver }}.Dockerfile
context: rocker-versioned2
push: true
tags: ${{ steps.defs.outputs.rockerintermediateprefix }}-tidyverse:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
mlbuild:
strategy:
matrix:
arch: [amd64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Free root space
uses: almahmoud/free-root-space@main
with:
verbose: true
- name: Set defaults for schedule
id: defs
run: |
echo rver=$(echo ${{ github.event.inputs.rver || 'devel' }}) >> $GITHUB_OUTPUT
echo biocver=$(echo ${{ github.event.inputs.biocver || '3.21' }}) >> $GITHUB_OUTPUT
echo registryuser=$(echo ${{ github.repository_owner }} | awk '{print tolower($0)}') >> $GITHUB_OUTPUT
echo rockerintermediateprefix=$(echo "ghcr.io/${{ github.repository_owner }}/rocker" | awk '{print tolower($0)}') >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: matrix.arch == 'arm64'
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prep rocker rocker files
run: |
## git clone rocker
git clone --depth 1 https://github.com/rocker-org/rocker-versioned2
sed -i 's#11.8.0-cudnn8-devel-ubuntu22.04#12.6.2-cudnn-devel-ubuntu24.04#g' rocker-versioned2/dockerfiles/cuda_${{ steps.defs.outputs.rver }}.Dockerfile
sed -i 's#11.8.0-cudnn8-devel-ubuntu22.04#12.6.2-cudnn-devel-ubuntu24.04#g' rocker-versioned2/dockerfiles/ml_${{ steps.defs.outputs.rver }}.Dockerfile
sed -i 's#11.8.0-cudnn8-devel-ubuntu22.04#12.6.2-cudnn-devel-ubuntu24.04#g' rocker-versioned2/dockerfiles/ml-verse_${{ steps.defs.outputs.rver }}.Dockerfile
# Package archived from CRAN
sed -i '/rmdshower/d' rocker-versioned2/scripts/install_verse.sh
sed -i 's#rocker/cuda:${{ steps.defs.outputs.rver }}#${{ steps.defs.outputs.rockerintermediateprefix }}-cuda:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}#g' rocker-versioned2/dockerfiles/ml_${{ steps.defs.outputs.rver }}.Dockerfile
sed -i 's#rocker/ml:${{ steps.defs.outputs.rver }}#${{ steps.defs.outputs.rockerintermediateprefix }}-ml:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}#g' rocker-versioned2/dockerfiles/ml-verse_${{ steps.defs.outputs.rver }}.Dockerfile
echo "Bioconductor Version: ${{ steps.defs.outputs.biocver }}"
if [ "${{ steps.defs.outputs.rver }}" == "devel" ]; then
bash .github/scripts/devel_or_patched_rversion.sh "${{ steps.defs.outputs.biocver }}" "rocker-versioned2/dockerfiles/cuda_${{ steps.defs.outputs.rver }}.Dockerfile"
bash .github/scripts/devel_or_patched_rversion.sh "${{ steps.defs.outputs.biocver }}" "rocker-versioned2/dockerfiles/ml_${{ steps.defs.outputs.rver }}.Dockerfile"
bash .github/scripts/devel_or_patched_rversion.sh "${{ steps.defs.outputs.biocver }}" "rocker-versioned2/dockerfiles/ml-verse_${{ steps.defs.outputs.rver }}.Dockerfile"
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/${{ matrix.arch }}
- name: Build and load cuda
uses: docker/build-push-action@v3
with:
file: rocker-versioned2/dockerfiles/cuda_${{ steps.defs.outputs.rver }}.Dockerfile
context: rocker-versioned2
push: true
tags: ${{ steps.defs.outputs.rockerintermediateprefix }}-cuda:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
- name: Build and load ml
uses: docker/build-push-action@v3
with:
file: rocker-versioned2/dockerfiles/ml_${{ steps.defs.outputs.rver }}.Dockerfile
context: rocker-versioned2
push: true
tags: ${{ steps.defs.outputs.rockerintermediateprefix }}-ml:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
- name: Build and load ml-verse
uses: docker/build-push-action@v3
with:
file: rocker-versioned2/dockerfiles/ml-verse_${{ steps.defs.outputs.rver }}.Dockerfile
context: rocker-versioned2
push: true
tags: ${{ steps.defs.outputs.rockerintermediateprefix }}-ml-verse:${{ steps.defs.outputs.rver }}-${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}