-
Notifications
You must be signed in to change notification settings - Fork 115
103 lines (92 loc) · 3.89 KB
/
build-model-server-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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Model-services build,test,push images
# Build image once the PR is merged to main branch.
on:
pull_request:
workflow_dispatch:
branches: [ main ]
push:
workflow_dispatch:
branches: [main]
permissions: write-all
jobs:
build_model_server:
runs-on: ubuntu-latest # windows-latest || macos-latest
env:
REGISTRY: quay.io/redhat-et
#GH_REGISTRY: ghcr.io
# github.repository as <account>/<repo>
MODEL_SERVICE_IMAGE: locallm-model-service
WHISPER_SERVICE_IMAGE: locallm-whisper-service
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed model-service files
id: changed-files-model-service
uses: tj-actions/changed-files@v42
with:
files: |
playground/**
- name: Get changed whisper-service files
id: changed-files-whisper-service
uses: tj-actions/changed-files@v42
with:
files: |
model_servers/whisper/**
- name: Install qemu dependency
if: steps.changed-files-model-service.outputs.any_changed == 'true' || steps.changed-files-whisper-service.outputs.any_changed == 'true'
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Login Quay Container registry
if: >
(steps.changed-files-model-service.outputs.any_changed == 'true' || steps.changed-files-whisper-service.outputs.any_changed == 'true') &&
(github.event_name == 'push' || github.event_name == 'schedule') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build model-service
if: steps.changed-files-model-service.outputs.any_changed == 'true'
id: build_model_service_multiplatform
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.MODEL_SERVICE_IMAGE }}
tags: latest ${{ github.sha }}
platforms: linux/amd64, linux/arm64
context: playground
containerfiles: ./playground/Containerfile
- name: Push model-service image
id: push_model_service
if: >
(steps.changed-files-model-service.outputs.any_changed == 'true') &&
(github.event_name == 'push' || github.event_name == 'schedule') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_model_service_multiplatform.outputs.image }}
tags: ${{ steps.build_model_service_multiplatform.outputs.tags }}
registry: ${{ env.REGISTRY }}
- name: Build whisper-service
if: steps.changed-files-whisper-service.outputs.any_changed == 'true'
id: build_model_service_multiplatform
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.WHISPER_SERVICE_IMAGE }}
tags: latest ${{ github.sha }}
platforms: linux/amd64, linux/arm64
context: playground
containerfiles: ./playground/Containerfile
- name: Push whisper-service image
id: push_whisper_service
if: >
(steps.changed-files-whisper-service.outputs.any_changed == 'true') &&
(github.event_name == 'push' || github.event_name == 'schedule') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_whisper_service_multiplatform.outputs.image }}
tags: ${{ steps.build_whisper_service_multiplatform.outputs.tags }}
registry: ${{ env.REGISTRY }}