forked from SeldonIO/MLServer
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (123 loc) · 3.84 KB
/
release.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
115
116
117
118
119
120
121
122
123
124
125
126
name: MLServer Release
on:
workflow_dispatch:
inputs:
version:
description: "MLServer Version to Release"
required: true
jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update Version
run: |
./hack/update-version.sh ${{ github.event.inputs.version }}
- name: Commiting & Pushing Updated Version Tag
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Bump version to ${{ github.event.inputs.version }}
tagging_message: ${{ github.event.inputs.version }}
- name: Draft Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
draft: true
tag_name: ${{ github.event.inputs.version }}
mlserver:
needs: draft-release
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: "true"
remove-haskell: "true"
remove-android: "true"
root-reserve-mb: "40960"
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.version }}
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r ./requirements/dev.txt
- name: Build Python wheel
run: |
python setup.py \
sdist -d ./dist \
bdist_wheel -d ./dist
twine upload dist/*
env:
TWINE_NON_INTERACTIVE: 1
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
run: |
DOCKER_BUILDKIT=1 docker build . \
--build-arg RUNTIMES="" \
-t $MLSERVER_IMAGE-slim
docker push $MLSERVER_IMAGE-slim
DOCKER_BUILDKIT=1 docker build . \
--build-arg RUNTIMES=all \
-t $MLSERVER_IMAGE
docker push $MLSERVER_IMAGE
env:
MLSERVER_IMAGE: seldonio/mlserver:${{ github.event.inputs.version }}
runtimes:
needs: draft-release
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
- alibi-detect
- alibi-explain
- huggingface
- lightgbm
- mlflow
- mllib
- sklearn
- xgboost
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.version }}
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r ./requirements/dev.txt
- name: Build Python wheel
working-directory: ./runtimes/${{ matrix.runtime }}
run: |
python setup.py \
sdist -d ./dist \
bdist_wheel -d ./dist
twine upload ./dist/*
env:
TWINE_NON_INTERACTIVE: 1
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
run: |
DOCKER_BUILDKIT=1 docker build . \
--build-arg RUNTIMES=mlserver-${{ matrix.runtime }} \
-t $RUNTIME_IMAGE
docker push $RUNTIME_IMAGE
env:
RUNTIME_IMAGE: seldonio/mlserver:${{ github.event.inputs.version }}-${{ matrix.runtime }}