-
Notifications
You must be signed in to change notification settings - Fork 4
114 lines (107 loc) · 4.01 KB
/
build_mlops.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Build jupyterlab-mlops Image
env:
KEDRO_DEFAULT_VERSION: "0.19.8"
MLFLOW_DEFAULT_VERSION: "2.15.1"
VSCODE_DEFAULT_VERSION: "NONE"
PYTHON_DEFAULT_VERSION: "3.11"
NB_DEFAULT_UID: "1000"
NB_DEFAULT_GID: "100"
NB_DEFAULT_USER: "jupyter"
on:
pull_request:
paths:
- 'jupyterlab-mlops/**'
- '.github/workflows/build_mlops.yml'
push:
tags:
- 'jupyterlab-mlops-*.*.*'
jobs:
buildx-mlops:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- base-image: "jupyter/pyspark-notebook:lab-3.2.1"
spark-support: true
kedro-version: "0.17.5"
mlflow-version: "1.23.1"
vscode-version: "4.0.2"
python-version: "3.8"
tag-base: dev
nb-user: jovyan
- base-image: "jupyter/pyspark-notebook:lab-3.2.1"
spark-support: true
kedro-version: "0.17.5"
mlflow-version: "1.23.1"
vscode-version: "4.0.2"
python-version: "3.8"
tag-base: azure
nb-user: azureuser
nb-uid: "1001"
nb-gid: "1004"
- base-image: "gcr.io/deeplearning-platform-release/base-cpu.py310:m124"
spark-support: false
kedro-version: "0.19.8"
mlflow-version: "2.15.1"
vscode-version: "4.91.1"
python-version: "3.10"
tag-base: vertex
nb-user: jupyter
- base-image: "jupyter/minimal-notebook:python-3.11.6"
spark-support: false
kedro-version: "0.19.8"
mlflow-version: "2.15.1"
vscode-version: "4.91.1"
python-version: "3.11"
tag-base: python-3.11
nb-user: jovyan
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
id: buildx-mlops
with:
install: true
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx
- name: Login to GCR
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.PUBLIC_GCR_DEPLOY_SA_KEY }}
- name: Extract tag
if: github.event_name == 'push'
id: tag-info
run: |
TAG_NAME=${GITHUB_REF#refs/*/}
IMAGE_VERSION=`echo $TAG_NAME | sed -e's/\(.*\)-\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\)\+/\2/'`
echo "::set-output name=IMAGE_VERSION::$IMAGE_VERSION"
- name: Build jupyterlab-mlops
uses: docker/build-push-action@v3
with:
context: jupyterlab-mlops
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: gcr.io/getindata-images-public/jupyterlab-mlops:${{ matrix.tag-base }}-${{ github.sha }},gcr.io/getindata-images-public/jupyterlab-mlops:${{ matrix.tag-base }}-${{ steps.tag-info.outputs.IMAGE_VERSION || 'latest' }},gcr.io/getindata-images-public/jupyterlab-mlops:${{ matrix.tag-base }}-latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
build-args: |
BASE_IMAGE=${{ matrix.base-image }}
SPARK_SUPPORT=${{ matrix.spark-support }}
KEDRO_VERSION=${{ matrix.kedro-version || env.KEDRO_DEFAULT_VERSION }}
MLFLOW_VERSION=${{ matrix.mlflow-version || env.MLFLOW_DEFAULT_VERSION }}
VSCODE_VERSION=${{ matrix.vscode-version || env.VSCODE_DEFAULT_VERSION }}
PYTHON_VERSION=${{ matrix.python-version || env.PYTHON_DEFAULT_VERSION }}
USER=${{ matrix.nb-user || env.NB_DEFAULT_USER }}
UID=${{ matrix.nb-uid || env.NB_DEFAULT_UID }}
GID=${{ matrix.nb-gid || env.NB_DEFAULT_GID }}
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache