Skip to content

Commit d20fd63

Browse files
authored
Merge branch 'main' into feature/decouple_from_v
2 parents 22c4cd9 + 05221b2 commit d20fd63

33 files changed

+1197
-1447
lines changed

.github/workflows/docs.yml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: docs
2+
permissions:
3+
contents: write
4+
pull-requests: write
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .pre-commit-config.yaml
12+
- .github/workflows/docs.yml
13+
- '**.py'
14+
- '**.ipynb'
15+
- '**.html'
16+
- '**.js'
17+
- '**.md'
18+
- uv.lock
19+
- pyproject.toml
20+
- mkdocs.yml
21+
- '**.png'
22+
- '**.svg'
23+
pull_request:
24+
branches:
25+
- main
26+
paths:
27+
- .pre-commit-config.yaml
28+
- .github/workflows/docs.yml
29+
- '**.py'
30+
- '**.ipynb'
31+
- '**.js'
32+
- '**.html'
33+
- uv.lock
34+
- pyproject.toml
35+
- '**.md'
36+
- mkdocs.yml
37+
- '**.png'
38+
- '**.svg'
39+
release:
40+
types: [published]
41+
# Allow manual trigger
42+
workflow_dispatch:
43+
inputs:
44+
version:
45+
description: 'Version to deploy (e.g., 0.5.0, latest)'
46+
required: true
47+
default: 'latest'
48+
49+
jobs:
50+
build:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4.2.2
55+
with:
56+
fetch-depth: 0 # Fetch all history for proper versioning
57+
58+
- name: Install uv
59+
uses: astral-sh/setup-uv@v5
60+
with:
61+
version: "0.5.21"
62+
enable-cache: true
63+
64+
- name: Set up Python
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version-file: ".python-version"
68+
69+
- name: Install the project
70+
run: uv sync --all-extras --group docs
71+
72+
- name: Build docs
73+
run: uv run mkdocs build
74+
75+
- name: Create .nojekyll file
76+
run: touch site/.nojekyll
77+
78+
- name: Upload artifact
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: docs-site
82+
path: site/
83+
retention-days: 1
84+
85+
deploy:
86+
needs: build
87+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' || github.event_name == 'release'
88+
runs-on: ubuntu-latest
89+
steps:
90+
- name: Checkout code
91+
uses: actions/checkout@v4.2.2
92+
with:
93+
fetch-depth: 0 # Fetch all history for proper versioning
94+
95+
- name: Install uv
96+
uses: astral-sh/setup-uv@v5
97+
with:
98+
version: "0.5.21"
99+
enable-cache: true
100+
101+
- name: Set up Python
102+
uses: actions/setup-python@v5
103+
with:
104+
python-version-file: ".python-version"
105+
106+
- name: Install the project
107+
run: uv sync --all-extras --group docs
108+
109+
- name: Configure Git Credentials
110+
run: |
111+
git config user.name github-actions[bot]
112+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
113+
114+
- name: Download artifact
115+
uses: actions/download-artifact@v4
116+
with:
117+
name: docs-site
118+
path: site
119+
120+
- name: Ensure .nojekyll exists
121+
run: touch site/.nojekyll
122+
123+
- name: Determine version
124+
id: version
125+
run: |
126+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
127+
# Use the version provided in the workflow dispatch
128+
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
129+
echo "VERSION_ALIAS=latest" >> $GITHUB_OUTPUT
130+
elif [[ "${{ github.event_name }}" == "release" ]]; then
131+
# Use the tag from the release
132+
VERSION="${{ github.ref_name }}"
133+
# Remove 'v' prefix if present
134+
VERSION="${VERSION#v}"
135+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
136+
echo "VERSION_ALIAS=latest" >> $GITHUB_OUTPUT
137+
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
138+
# For pushes to main, tag as "main"
139+
echo "VERSION=main" >> $GITHUB_OUTPUT
140+
# No alias for main
141+
echo "VERSION_ALIAS=" >> $GITHUB_OUTPUT
142+
else
143+
# Get version from pyproject.toml as fallback
144+
VERSION=$(grep -m 1 '^version = ' pyproject.toml | sed 's/^version = "\(.*\)"$/\1/')
145+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
146+
echo "VERSION_ALIAS=latest" >> $GITHUB_OUTPUT
147+
fi
148+
149+
- name: Deploy docs with mike
150+
run: |
151+
VERSION=${{ steps.version.outputs.VERSION }}
152+
ALIAS=${{ steps.version.outputs.VERSION_ALIAS }}
153+
154+
# Add a temporary remote to fetch gh-pages if it exists
155+
git remote add temp https://github.com/${{ github.repository }}.git || true
156+
git fetch temp gh-pages || true
157+
158+
DEPLOY_ARGS="--push --update-aliases $VERSION"
159+
160+
if [[ ! -z "$ALIAS" ]]; then
161+
DEPLOY_ARGS="$DEPLOY_ARGS $ALIAS"
162+
fi
163+
164+
# Activate the virtual environment
165+
source .venv/bin/activate
166+
167+
echo "Running: mike deploy $DEPLOY_ARGS"
168+
mike deploy $DEPLOY_ARGS
169+
170+
# Set default version to latest only if we're deploying a version with the latest alias
171+
if [[ ! -z "$ALIAS" && "$ALIAS" == "latest" ]]; then
172+
mike set-default --push latest
173+
fi
174+
175+
# Remove the temporary remote
176+
git remote remove temp || true

.github/workflows/docs_build.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/docs_deploy.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ repos:
1313
args: [--fix=lf]
1414
- id: requirements-txt-fixer
1515
- id: check-yaml
16+
args: [--unsafe]
1617
- id: check-toml
1718

1819
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: 'v0.11.4'
20+
rev: 'v0.11.6'
2021
hooks:
2122
- id: ruff
2223
args: [--fix, --exit-non-zero-on-fix]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
[![PyPI](https://img.shields.io/pypi/v/vec-inf)](https://pypi.org/project/vec-inf)
66
[![code checks](https://github.com/VectorInstitute/vector-inference/actions/workflows/code_checks.yml/badge.svg)](https://github.com/VectorInstitute/vector-inference/actions/workflows/code_checks.yml)
7-
[![docs](https://github.com/VectorInstitute/vector-inference/actions/workflows/docs_deploy.yml/badge.svg)](https://github.com/VectorInstitute/vector-inference/actions/workflows/docs_deploy.yml)
8-
[![codecov](https://codecov.io/github/VectorInstitute/vector-inference/branch/develop/graph/badge.svg?token=NI88QSIGAC)](https://app.codecov.io/github/VectorInstitute/vector-inference/tree/develop)
7+
[![docs](https://github.com/VectorInstitute/vector-inference/actions/workflows/docs.yml/badge.svg)](https://github.com/VectorInstitute/vector-inference/actions/workflows/docs.yml)
8+
[![codecov](https://codecov.io/github/VectorInstitute/vector-inference/branch/main/graph/badge.svg?token=NI88QSIGAC)](https://app.codecov.io/github/VectorInstitute/vector-inference/tree/main)
99
![GitHub License](https://img.shields.io/github/license/VectorInstitute/vector-inference)
1010

11-
This repository provides an easy-to-use solution to run inference servers on [Slurm](https://slurm.schedmd.com/overview.html)-managed computing clusters using [vLLM](https://docs.vllm.ai/en/latest/). **All scripts in this repository runs natively on the Vector Institute cluster environment**. To adapt to other environments, update the environment variables in [`shared/utils.py`](vec_inf/shared/utils.py), [`shared/config.py`](vec_inf/shared/config.py), [`vllm.slurm`](vec_inf/vllm.slurm), [`multinode_vllm.slurm`](vec_inf/multinode_vllm.slurm) and [`models.yaml`](vec_inf/config/models.yaml) accordingly.
11+
This repository provides an easy-to-use solution to run inference servers on [Slurm](https://slurm.schedmd.com/overview.html)-managed computing clusters using [vLLM](https://docs.vllm.ai/en/latest/). **All scripts in this repository runs natively on the Vector Institute cluster environment**. To adapt to other environments, update the environment variables in [`vec_inf/client/_vars.py`](vec_inf/client/_vars.py), [`vec_inf/client/_config.py`](vec_inf/client/_config.py), [`vllm.slurm`](vec_inf/vllm.slurm), [`multinode_vllm.slurm`](vec_inf/multinode_vllm.slurm) and [`models.yaml`](vec_inf/config/models.yaml) accordingly.
1212

1313
## Installation
1414
If you are using the Vector cluster environment, and you don't need any customization to the inference server environment, run the following to install package:

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
codecov:
2-
branch: develop
2+
branch: main
33
require_ci_to_pass: true
44
notify:
55
after_n_builds: 2

docs/api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Python API Reference
2+
3+
This section documents the Python API for vector-inference.
4+
5+
## Client Interface
6+
7+
::: vec_inf.client.api.VecInfClient
8+
options:
9+
show_root_heading: true
10+
show_root_full_path: true
11+
members: true
12+
13+
## Data Models
14+
15+
::: vec_inf.client._models
16+
options:
17+
show_root_heading: true
18+
members: true

docs/assets/favicon-48x48.svg

Lines changed: 9 additions & 0 deletions
Loading

docs/assets/favicon.ico

14.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)