Extra rocker builds #227
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Extra rocker builds | |
on: | |
workflow_dispatch: | |
inputs: | |
rver: | |
default: "devel" | |
biocver: | |
default: "3.19" | |
schedule: | |
- cron: '0 18 * * *' | |
jobs: | |
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.19' }}) >> $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.19' }}) >> $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.19' }}) >> $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.19' }}) >> $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#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 | |
BIOC_MINOR=$(echo "${{ steps.defs.outputs.biocver }}" | awk -F'.' '{print $NF}') | |
echo "Bioconductor Version: ${{ steps.defs.outputs.biocver }}" | |
if [ "${{ steps.defs.outputs.rver }}" = "devel" ]; then | |
DEVEL_R_VER=$(curl https://bioconductor.org/config.yaml | grep '"${{ steps.defs.outputs.rver }}":' | awk '{print $2}' | sed 's/"//g') | |
REL_VER=$(curl https://cran.r-project.org/src/base/VERSION-INFO.dcf | grep "$DEVEL_R_VER" | awk -F':' '{print $1}') | |
# if the matching version is under release rather than devel, use patched pre-release rather than devel pre-release | |
if [ "$REL_VER" == "Release" ]; then | |
sed -i 's#R_VERSION=${{ steps.defs.outputs.rver }}#R_VERSION=patched#g' rocker-versioned2/dockerfiles/cuda_${{ steps.defs.outputs.rver }}.Dockerfile | |
fi | |
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 }} |