Extra rocker builds #150
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.18" | |
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.18' }}) >> $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.18' }}) >> $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.18' }}) >> $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.18' }}) >> $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 | |
if [ $((BIOC_MINOR%2)) -eq 0 ]; | |
then | |
echo "Using latest release R since Bioc devel version is even"; | |
sed -i 's#R_VERSION=${{ steps.defs.outputs.rver }}#R_VERSION=latest#g' rocker-versioned2/dockerfiles/cuda_${{ steps.defs.outputs.rver }}.Dockerfile | |
else | |
echo "Using latest pre-release R since Bioc devel version is even"; | |
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 }} |