Skip to content

Extra rocker builds #592

Extra rocker builds

Extra rocker builds #592

name: Extra rocker builds
on:
workflow_dispatch:
inputs:
rver:
default: "devel"
biocver:
default: "3.20"
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.20' }})
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.20' }}) >> $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.20' }}) >> $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.20' }}) >> $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.20' }}) >> $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
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 }}