-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (74 loc) · 2.69 KB
/
build_base_images.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
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