forked from llm-d/llm-d-router
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (121 loc) · 3.98 KB
/
Copy pathci-build-images.yaml
File metadata and controls
137 lines (121 loc) · 3.98 KB
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
127
128
129
130
131
132
133
134
135
name: Build and Push Container Images
on:
workflow_call:
inputs:
epp-image-name:
required: true
type: string
sidecar-image-name:
required: true
type: string
tag:
required: true
type: string
prerelease:
required: true
type: boolean
chart-suffix:
required: false
type: string
default: ''
epp-additional-tags:
required: false
type: string
default: ''
sidecar-additional-tags:
required: false
type: string
default: ''
permissions:
contents: read
packages: write
security-events: write
jobs:
build-epp:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v7
- name: Build AMD64 EPP image (no push)
uses: ./.github/actions/docker-build-and-push
with:
docker-file: Dockerfile.epp
tag: ${{ inputs.tag }}
image-name: ${{ inputs.epp-image-name }}
registry: ghcr.io/llm-d
push: 'false'
buildx-outputs: type=docker,dest=/tmp/epp-image.tar
# Gate the push on the scan: a HIGH/CRITICAL by default when not set but configurable
- name: Run Trivy scan for EPP on AMD64
uses: ./.github/actions/trivy-scan
with:
tarball: /tmp/epp-image.tar
# Re-run the build with push enabled with: cache-to/cache-from type=gha
- name: Push EPP image for both AMD64 and ARM64
uses: ./.github/actions/docker-build-and-push
with:
docker-file: Dockerfile.epp
tag: ${{ inputs.tag }}
image-name: ${{ inputs.epp-image-name }}
registry: ghcr.io/llm-d
github-token: ${{ github.token }}
prerelease: ${{ inputs.prerelease }}
commit-sha: ${{ github.sha }}
push: 'true'
additional-tags: ${{ inputs.epp-additional-tags }}
build-sidecar:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v7
- name: Build sidecar AMD64 image (no push)
uses: ./.github/actions/docker-build-and-push
with:
docker-file: Dockerfile.sidecar
tag: ${{ inputs.tag }}
image-name: ${{ inputs.sidecar-image-name }}
registry: ghcr.io/llm-d
push: 'false'
buildx-outputs: type=docker,dest=/tmp/sidecar-image.tar
- name: Run Trivy scan on sidecar image on AMD64
uses: ./.github/actions/trivy-scan
with:
tarball: /tmp/sidecar-image.tar
- name: Push sidecar image for both AMD64 and ARM64
uses: ./.github/actions/docker-build-and-push
with:
docker-file: Dockerfile.sidecar
tag: ${{ inputs.tag }}
image-name: ${{ inputs.sidecar-image-name }}
registry: ghcr.io/llm-d
github-token: ${{ github.token }}
prerelease: ${{ inputs.prerelease }}
commit-sha: ${{ github.sha }}
push: 'true'
additional-tags: ${{ inputs.sidecar-additional-tags }}
push-helm-charts:
needs: [build-epp, build-sidecar]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v7
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and Push Standalone Chart
uses: ./.github/actions/helm-build-and-push
with:
chart_name: llm-d-router-standalone
extra_tag: ${{ inputs.tag }}
chart_suffix: ${{ inputs.chart-suffix }}
epp_image_repository: ${{ inputs.epp-image-name }}
- name: Build and Push Gateway Chart
uses: ./.github/actions/helm-build-and-push
with:
chart_name: llm-d-router-gateway
extra_tag: ${{ inputs.tag }}
chart_suffix: ${{ inputs.chart-suffix }}
epp_image_repository: ${{ inputs.epp-image-name }}