Skip to content

Merge remote-tracking branch 'refs/remotes/origin/develop' into develop #96

Merge remote-tracking branch 'refs/remotes/origin/develop' into develop

Merge remote-tracking branch 'refs/remotes/origin/develop' into develop #96

name: Build and Push Base Images
on:
push:
paths:
- "base-images/**/Dockerfile"
- "base-images/**/*"
- ".github/workflows/build_base_images.yaml"
workflow_dispatch:
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
images: ${{ steps.changed_dirs.outputs.dirs }}
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Get changed directories
id: changed_dirs
run: |
changed_dirs=$(git diff --name-only --diff-filter=d ${{ github.event.before }} ${{ github.sha }} | grep '^base-images/' | awk -F/ '{print $2}' | uniq | sed 's/^/"/;s/$/",/')
changed_dirs=$(echo $changed_dirs | tr -d '\n')
echo "dirs=[ $changed_dirs ]"
echo "dirs=[$changed_dirs]" >> $GITHUB_OUTPUT
build-and-push-base-images:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.images != '[]' || contains(github.event_name, 'workflow_dispatch') }}
strategy:
matrix:
image: ${{fromJson(needs.detect-changes.outputs.images)}}
buildargs:
- |
JUPYTER_VARIANT=minimal
CUDA_VARIANT=nocuda
- |
JUPYTER_VARIANT=scipy
CUDA_VARIANT=cuda-devel
#- |
# JUPYTER_VARIANT=minimal
# CUDA_VARIANT=cuda-runtime
#- |
# JUPYTER_VARIANT=minimal
# CUDA_VARIANT=cuda-cudnn
#- |
# JUPYTER_VARIANT=minimal
# CUDA_VARIANT=cuda-devel
- |
JUPYTER_VARIANT=scipy
CUDA_VARIANT=nocuda
#- |
# JUPYTER_VARIANT=scipy
# CUDA_VARIANT=cuda-runtime
#- |
# JUPYTER_VARIANT=scipy
# CUDA_VARIANT=cuda-cudnn
uses: ./.github/workflows/reusable-docker-build-push.yml
with:
image: ${{ matrix.image }}
folder: base-images/${{ matrix.image }}
buildargs: ${{ matrix.buildargs }}
#pull-to-harbor:
# needs: [build-and-push-base-images, detect-changes]
# if: ${{ needs.detect-changes.outputs.images != '[]' || contains(github.event_name, 'workflow_dispatch') }}
# runs-on: ubuntu-latest
# strategy:
# matrix:
# image: ${{fromJson(needs.detect-changes.outputs.images)}}
# steps:
# - name: pull
# run: |
# openssl s_client -showcerts -connect harbor.ki.fh-swf.de:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/ca.crt
# sudo cp /tmp/ca.crt /usr/local/share/ca-certificates/
# sudo update-ca-certificates
# tag=$(echo "${{ matrix.image }}" | grep sha | head -n 1 | awk -F ':' '{print $2}')
# docker image pull harbor.ki.fh-swf.de/ghcr.io/fhswf/jupyterhub-k8s/${{ matrix.image }}:$tag