Deployment Guide

Step-by-step guide to deploying a new version of Vector Inference on Vector clusters

Development Setup

Prerequisites

Setting Up Development Environment

  1. Clone the repository:

    git clone https://github.com/VectorInstitute/vector-inference.git
    cd vector-inference
    
  2. Install development dependencies:

    uv sync --all-extras --group dev
    
  3. Install pre-commit hooks:

    pre-commit install
    

NOTE If you prefer using virtual environments, step 2 creates a virtual environment by default, run the following to activate:

source .venv/bin/activate

Development Workflow

Development Workflow

  1. Branch off of main, name your branch with the following convention: f/$FEATURE_NAME, b/$BUG_FIX or r/RELEASE_TAG.
  2. Make new changes in your branch, and add/modify relevant unit tests in tests. Please follow the styling guide in the next section.
  3. Test your changes, once ready, open a PR for review. See below for detailed testing guide.
  4. The PR will trigger pre-commit hooks and run GitHub actions that would check code style and linting, run unit tests, build documentation and Docker images. All GitHub actions need to pass (along with 2 approvements) to merge the PR.

Code Style and Linting

We use several tools to ensure code quality:

You can run these tools with:

# Linting
uv run ruff check .

# Type checking
uv run mypy

# Format code
uv run ruff format .

!!! note "Pre-commit Hooks" The pre-commit hooks will automatically run these checks before each commit. If the hooks fail, you will need to fix the issues before you can commit.

Testing

Testing new changes involves 2 major steps: unit tests and integration tests.

Unit Tests

All new features and bug fixes should include tests. We use pytest for testing:

# Change to test directory
cd tests

# Run all tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=vec_inf

Integration Tests

Integration tests are stored in a different repository: vec-inf-maintenance

  1. Clone the repository and run cd vec-inf-maintenance/deployment
  2. Follow the README to test model launch and inference

Release Guide

Release PR

  1. Update version in pyproject.toml.
  2. Run uv lock --upgrade to update the lock file.
  3. Pull new images on the cluster if inference engine version is updated, more details in next section.
  4. Update model tracking information and configs accordingly, more details below.

Update images

If the inference engine version is updated, the Docker GitHub action will build new images tagged by the inference engine version and pushed to DockerHub:

  1. Go to vec-inf-maintenance/maintenance.
  2. Run pull_image.sh $ENGINE_NAME $VERSION, e.g. pull_image.sh vllm 0.14.0. This will pull the new image to /model-weights/vec-inf-shared, and update the symlink accordingly.
  3. Go to vec-inf-maintenance/deployment.
  4. Run model launch and inference tests to ensure the new images are working properly.

Update model tracking information and configs

For any new release, always sync the latest cached configs (models.yaml and environment.yaml) on Killarney cluster (/model-weights/vec-inf-shared) to the repository:

Create a new release on GitHub

  1. Create a new tag and release on GitHub
  2. Add description for the new release
  3. Documentation for the new version will be automatically deployed

Maintenance

Cached Configs and Apptainer Images

In the /model-weights folder, the following files exists:

Model weights tracking

Use MODEL_TRACKING.md in the vec-inf-maintenance repo to keep track of cached model weights.