Skip to content

Commit cc275d2

Browse files
committed
Add docker build ci
1 parent 42c5c5a commit cc275d2

File tree

5 files changed

+143
-3
lines changed

5 files changed

+143
-3
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build Docker Images
2+
3+
permissions:
4+
contents: read
5+
packages: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
paths-ignore:
12+
- 'assets/'
13+
- '**/*.md'
14+
- 'LICENSE'
15+
- '.gitignore'
16+
17+
concurrency:
18+
group: docker-build-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
discover:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
matrix: ${{ steps.set-matrix.outputs.matrix }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Discover Dockerfiles in docker/
31+
id: set-matrix
32+
shell: bash
33+
run: |
34+
set -euo pipefail
35+
files=(docker/*)
36+
include=()
37+
for file in "${files[@]}"; do
38+
if [[ -f "$file" ]]; then
39+
name="$(basename "$file" | tr '.' '-')"
40+
filename="$(basename "$file")"
41+
if [[ "$filename" == "Dockerfile" ]]; then
42+
tag="latest"
43+
else
44+
tag="${filename#Dockerfile.}"
45+
fi
46+
include+=("{\"name\":\"$name\",\"file\":\"$file\",\"tag\":\"$tag\"}")
47+
fi
48+
done
49+
50+
if [[ ${#include[@]} -eq 0 ]]; then
51+
echo "No files found in docker/" >&2
52+
exit 1
53+
fi
54+
55+
matrix="{\"include\":[$(IFS=,; echo "${include[*]}")]}"
56+
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
57+
58+
build:
59+
runs-on: ubuntu-latest
60+
needs: discover
61+
strategy:
62+
fail-fast: false
63+
matrix: ${{ fromJson(needs.discover.outputs.matrix) }}
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Set up QEMU
69+
uses: docker/setup-qemu-action@v3
70+
71+
- name: Set up Docker Buildx
72+
uses: docker/setup-buildx-action@v3
73+
74+
- name: Log in to GHCR
75+
uses: docker/login-action@v3
76+
with:
77+
registry: ghcr.io
78+
username: ${{ github.actor }}
79+
password: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- name: Build and publish ${{ matrix.file }} (amd64 + arm64)
82+
uses: docker/build-push-action@v6
83+
with:
84+
context: .
85+
file: ${{ matrix.file }}
86+
push: true
87+
tags: ghcr.io/${{ github.repository }}:${{ matrix.tag }}
88+
platforms: linux/amd64,linux/arm64
89+
cache-from: type=gha
90+
cache-to: type=gha,mode=max

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RUN python3 -m venv /opt/venv
3838

3939
ENV VIRTUAL_ENV=/opt/venv
4040
ENV PATH="/opt/venv/bin:$PATH"
41-
ENV TORCH_CUDA_ARCH_LIST="8.0;8.6;8.7;8.9;9.0;10.0;12.0"
41+
ENV TORCH_CUDA_ARCH_LIST="8.0 8.6 8.7 8.9 9.0 10.0 12.0"
4242

4343
COPY requirements.txt .
4444

docker/Dockerfile.chat-cu130

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
ARG CUDA_VERSION=13.0.2
2+
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04
3+
4+
LABEL org.opencontainers.image.source=https://github.com/z-lab/paroquant
5+
LABEL org.opencontainers.image.description="Container for vLLM inference"
6+
LABEL org.opencontainers.image.licenses=MIT
7+
8+
ARG PYTHON_VERSION=3.12
9+
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
WORKDIR /app
12+
13+
RUN apt-get update && apt-get install -y --no-install-recommends \
14+
software-properties-common \
15+
build-essential \
16+
git \
17+
curl \
18+
ca-certificates \
19+
libibverbs-dev \
20+
libnuma-dev \
21+
ffmpeg \
22+
libsm6 \
23+
libxext6 \
24+
libgl1 \
25+
&& add-apt-repository -y ppa:deadsnakes/ppa \
26+
&& apt-get update \
27+
&& apt-get install -y --no-install-recommends \
28+
python${PYTHON_VERSION} \
29+
python${PYTHON_VERSION}-dev \
30+
python${PYTHON_VERSION}-venv \
31+
python3-pip \
32+
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
33+
&& update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \
34+
&& rm -rf /var/lib/apt/lists/*
35+
36+
RUN python3 -m venv /opt/venv
37+
38+
ENV VIRTUAL_ENV=/opt/venv
39+
ENV PATH="/opt/venv/bin:$PATH"
40+
ENV TORCH_CUDA_ARCH_LIST="8.0 8.6 8.7 8.9 9.0 10.0 12.0 12.1"
41+
42+
RUN pip install vllm==0.15.1 accelerate --no-cache-dir --extra-index-url https://wheels.vllm.ai/0.15.1/cu130 --extra-index-url https://download.pytorch.org/whl/cu130
43+
44+
COPY ./kernels ./kernels
45+
RUN pip install ./kernels --no-cache-dir --no-build-isolation
46+
47+
COPY . .
48+
49+
ENV TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas
50+
ENTRYPOINT ["python", "scripts/interactive_gen.py"]

docker/Dockerfile.eval-reasoning

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN python3 -m venv /opt/venv
3737

3838
ENV VIRTUAL_ENV=/opt/venv
3939
ENV PATH="/opt/venv/bin:$PATH"
40-
ENV TORCH_CUDA_ARCH_LIST="8.0;8.6;8.7;8.9;9.0;10.0;12.0"
40+
ENV TORCH_CUDA_ARCH_LIST="8.0 8.6 8.7 8.9 9.0 10.0 12.0"
4141

4242
COPY experiments/tasks/reasoning/requirements.txt .
4343

kernels/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import torch
77

88
# Supported NVIDIA GPU architectures.
9-
SUPPORTED_ARCHS = {"8.0", "8.6", "8.7", "8.9", "9.0", "10.0", "12.0"}
9+
SUPPORTED_ARCHS = {"8.0", "8.6", "8.7", "8.9", "9.0", "10.0", "12.0", "12.1"}
1010

1111

1212
def get_torch_arch_list() -> Set[str]:

0 commit comments

Comments
 (0)