Skip to content

Commit 45ef380

Browse files
authored
Merge pull request #78 from VectorInstitute/develop
v0.5.0
2 parents 5ace55e + 4933fa6 commit 45ef380

28 files changed

+5040
-1422
lines changed

.github/workflows/code_checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
- uses: actions/[email protected]
3232
- name: Install uv
33-
uses: astral-sh/setup-uv@v5.2.2
33+
uses: astral-sh/setup-uv@v5.3.1
3434
with:
3535
# Install a specific version of uv.
3636
version: "0.5.21"
@@ -46,6 +46,6 @@ jobs:
4646
source .venv/bin/activate
4747
pre-commit run --all-files
4848
- name: pip-audit (gh-action-pip-audit)
49-
uses: pypa/gh-action-pip-audit@v1.0.8
49+
uses: pypa/gh-action-pip-audit@v1.1.0
5050
with:
5151
virtual-environment: .venv/

.github/workflows/docker.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: docker
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- Dockerfile
11+
- .github/workflows/docker.yml
12+
pull_request:
13+
branches:
14+
- main
15+
- develop
16+
paths:
17+
- Dockerfile
18+
- .github/workflows/docker.yml
19+
20+
jobs:
21+
push_to_registry:
22+
name: Push Docker image to Docker Hub
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/[email protected]
27+
28+
- name: Extract vLLM version
29+
id: vllm-version
30+
run: |
31+
VERSION=$(grep -A 1 'name = "vllm"' uv.lock | grep version | cut -d '"' -f 2)
32+
echo "version=$VERSION" >> $GITHUB_OUTPUT
33+
34+
- name: Log in to Docker Hub
35+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
36+
with:
37+
username: ${{ secrets.DOCKER_USERNAME }}
38+
password: ${{ secrets.DOCKER_PASSWORD }}
39+
40+
- name: Extract metadata (tags, labels) for Docker
41+
id: meta
42+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804
43+
with:
44+
images: vectorinstitute/vector-inference
45+
46+
- name: Build and push Docker image
47+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
48+
with:
49+
context: .
50+
file: ./Dockerfile
51+
push: true
52+
tags: |
53+
${{ steps.meta.outputs.tags }}
54+
vectorinstitute/vector-inference:${{ steps.vllm-version.outputs.version }}
55+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/docs_build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ jobs:
2727
- uses: actions/[email protected]
2828

2929
- name: Install uv
30-
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
30+
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231
3131
with:
3232
version: "0.5.21"
3333
enable-cache: true
3434

3535
- name: "Set up Python"
36-
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
36+
uses: actions/setup-python@8039c45ed9a312fba91f3399cd0605ba2ebfe93c
3737
with:
3838
python-version-file: ".python-version"
3939

4040
- name: Install the project
41-
run: uv sync --all-extras --all-groups
41+
run: uv sync --dev --group docs
4242

4343
- name: Build docs
4444
run: cd docs && rm -rf source/reference/api/_autosummary && uv run make html

.github/workflows/docs_deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ jobs:
3131
submodules: 'true'
3232

3333
- name: Install uv
34-
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
34+
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231
3535
with:
3636
# Install a specific version of uv.
3737
version: "0.5.21"
3838
enable-cache: true
3939

4040
- name: "Set up Python"
41-
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
41+
uses: actions/setup-python@8039c45ed9a312fba91f3399cd0605ba2ebfe93c
4242
with:
4343
python-version-file: ".python-version"
4444

4545
- name: Install the project
46-
run: uv sync --all-extras --all-groups
46+
run: uv sync --dev --group docs
4747

4848
- name: Build docs
4949
run: |
@@ -53,7 +53,7 @@ jobs:
5353
touch build/html/.nojekyll
5454
5555
- name: Deploy to Github pages
56-
uses: JamesIves/github-pages-deploy-action@15de0f09300eea763baee31dff6c6184995c5f6a
56+
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8
5757
with:
5858
branch: github_pages
5959
folder: docs/build/html

.github/workflows/publish.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ jobs:
1212
run: |
1313
sudo apt-get update
1414
sudo apt-get install libcurl4-openssl-dev libssl-dev
15-
- uses: actions/[email protected]
16-
- name: Install poetry
17-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
18-
- uses: actions/[email protected]
15+
16+
- uses: actions/[email protected]
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v5
20+
with:
21+
version: "0.6.6"
22+
enable-cache: true
23+
24+
- uses: actions/[email protected]
1925
with:
2026
python-version: '3.10'
27+
2128
- name: Build package
22-
run: poetry build
29+
run: uv build
30+
2331
- name: Publish package
24-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
25-
with:
26-
user: __token__
27-
password: ${{ secrets.PYPI_API_TOKEN }}
32+
run: uv publish --token ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/unit_tests.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,43 @@ on:
3939
jobs:
4040
unit-tests:
4141
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
python-version: ["3.10", "3.11", "3.12"]
4245
steps:
4346
- uses: actions/[email protected]
4447

4548
- name: Install uv
46-
uses: astral-sh/setup-uv@v5.2.2
49+
uses: astral-sh/setup-uv@v5.3.1
4750
with:
4851
# Install a specific version of uv.
4952
version: "0.5.21"
5053
enable-cache: true
5154

52-
- name: "Set up Python"
55+
- name: "Set up Python ${{ matrix.python-version }}"
5356
uses: actions/[email protected]
5457
with:
55-
python-version-file: ".python-version"
58+
python-version: ${{ matrix.python-version }}
5659

5760
- name: Install the project
58-
run: uv sync --all-extras --dev
61+
run: uv sync --dev
5962

6063
- name: Install dependencies and check code
6164
run: |
6265
uv run pytest -m "not integration_test" --cov vec_inf --cov-report=xml tests
6366
64-
# Uncomment this once this repo is configured on Codecov
67+
- name: Install the core package only
68+
run: uv sync --no-dev
69+
70+
- name: Run package import tests
71+
run: |
72+
uv run pytest tests/test_imports.py
73+
6574
- name: Upload coverage to Codecov
66-
uses: codecov/codecov-action@v5.3.1
75+
uses: codecov/codecov-action@v5.4.0
6776
with:
6877
token: ${{ secrets.CODECOV_TOKEN }}
69-
slug: VectorInstitute/vec-inf
78+
file: ./coverage.xml
79+
name: codecov-umbrella
7080
fail_ci_if_error: true
7181
verbose: true

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: check-toml
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: 'v0.9.6'
19+
rev: 'v0.11.0'
2020
hooks:
2121
- id: ruff
2222
args: [--fix, --exit-non-zero-on-fix]

Dockerfile

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,14 @@ ARG TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6+PTX"
1212
# Set the Python version
1313
ARG PYTHON_VERSION=3.10.12
1414

15-
# Install dependencies for building Python
15+
# Install system dependencies
1616
RUN apt-get update && apt-get install -y \
17-
wget \
18-
build-essential \
19-
libssl-dev \
20-
zlib1g-dev \
21-
libbz2-dev \
22-
libreadline-dev \
23-
libsqlite3-dev \
24-
libffi-dev \
25-
libncursesw5-dev \
26-
xz-utils \
27-
tk-dev \
28-
libxml2-dev \
29-
libxmlsec1-dev \
30-
liblzma-dev \
31-
git \
32-
vim \
17+
wget build-essential libssl-dev zlib1g-dev libbz2-dev \
18+
libreadline-dev libsqlite3-dev libffi-dev libncursesw5-dev \
19+
xz-utils tk-dev libxml2-dev libxmlsec1-dev liblzma-dev git vim \
3320
&& rm -rf /var/lib/apt/lists/*
3421

35-
# Download and install Python from precompiled binaries
22+
# Install Python
3623
RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz && \
3724
tar -xzf Python-$PYTHON_VERSION.tgz && \
3825
cd Python-$PYTHON_VERSION && \
@@ -42,38 +29,24 @@ RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSIO
4229
cd .. && \
4330
rm -rf Python-$PYTHON_VERSION.tgz Python-$PYTHON_VERSION
4431

45-
# Download and install pip using get-pip.py
32+
# Install pip and core Python tools
4633
RUN wget https://bootstrap.pypa.io/get-pip.py && \
4734
python3.10 get-pip.py && \
48-
rm get-pip.py
35+
rm get-pip.py && \
36+
python3.10 -m pip install --upgrade pip setuptools wheel uv
4937

50-
# Ensure pip for Python 3.10 is used
51-
RUN python3.10 -m pip install --upgrade pip setuptools wheel
52-
53-
# Install Poetry using Python 3.10
54-
RUN python3.10 -m pip install poetry
55-
56-
# Don't create venv
57-
RUN poetry config virtualenvs.create false
58-
59-
# Set working directory
38+
# Set up project
6039
WORKDIR /vec-inf
61-
62-
# Copy current directory
6340
COPY . /vec-inf
6441

65-
# Update Poetry lock file if necessary
66-
RUN poetry lock
67-
68-
# Install vec-inf
69-
RUN poetry install --extras "dev"
70-
71-
# Install Flash Attention 2 backend
42+
# Install project dependencies with build requirements
43+
RUN PIP_INDEX_URL="https://download.pytorch.org/whl/cu121" uv pip install --system -e .[dev]
44+
# Install Flash Attention
7245
RUN python3.10 -m pip install flash-attn --no-build-isolation
7346

74-
# Move nccl to accessible location
75-
RUN mkdir -p /vec-inf/nccl
76-
RUN mv /root/.config/vllm/nccl/cu12/libnccl.so.2.18.1 /vec-inf/nccl/libnccl.so.2.18.1;
47+
# Final configuration
48+
RUN mkdir -p /vec-inf/nccl && \
49+
mv /root/.config/vllm/nccl/cu12/libnccl.so.2.18.1 /vec-inf/nccl/libnccl.so.2.18.1
7750

7851
# Set the default command to start an interactive shell
7952
CMD ["bash"]

0 commit comments

Comments
 (0)