-
Notifications
You must be signed in to change notification settings - Fork 13
85 lines (77 loc) · 2.52 KB
/
docker.yml
File metadata and controls
85 lines (77 loc) · 2.52 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
name: docker
on:
release:
types: [published]
push:
branches:
- main
paths:
- vllm.Dockerfile
- sglang.Dockerfile
- .github/workflows/docker.yml
- uv.lock
pull_request:
branches:
- main
- f/sglang-support
paths:
- vllm.Dockerfile
- sglang.Dockerfile
- .github/workflows/docker.yml
- uv.lock
jobs:
push_to_registry:
name: Build and push Docker images
runs-on:
- ubuntu-latest
strategy:
matrix:
backend: [vllm, sglang]
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
- name: Extract backend version
id: backend-version
run: |
VERSION=$(grep -A 1 "name = \"${{ matrix.backend }}\"" uv.lock | grep version | cut -d '"' -f 2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Maximize build space
run: |
echo "Disk space before cleanup:"
df -h
# Remove unnecessary pre-installed software
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# Clean apt cache
sudo apt-get clean
# Remove docker images
docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
echo "Disk space after cleanup:"
df -h
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf
with:
images: vectorinstitute/vector-inference-${{ matrix.backend }}
- name: Build and push Docker image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
context: .
file: ./${{ matrix.backend }}.Dockerfile
push: true
tags: |
${{ steps.meta.outputs.tags }}
vectorinstitute/vector-inference-${{ matrix.backend }}:${{ steps.backend-version.outputs.version }}
vectorinstitute/vector-inference-${{ matrix.backend }}:latest
labels: ${{ steps.meta.outputs.labels }}