Skip to content

Commit 7f8d67d

Browse files
authored
Add Makefile to run unit tests of tools/dynamic-lora-sidecar locally (#1021)
* Add Makefile to run unit tests locally * Fix test target to use Python 3.10 consistently
1 parent 17f056e commit 7f8d67d

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed

tools/dynamic-lora-sidecar/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim-buster AS test
1+
FROM python:3.10-slim-buster AS test
22

33
WORKDIR /dynamic-lora-reconciler-test
44
COPY requirements.txt .

tools/dynamic-lora-sidecar/Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Makefile for dynamic-lora-sidecar
2+
3+
PYTHON_VERSION := 3.10
4+
VENV_DIR := venv
5+
PYTHON := $(VENV_DIR)/bin/python
6+
PIP := $(VENV_DIR)/bin/pip
7+
8+
.PHONY: help venv install test clean
9+
10+
help: ## Show available targets
11+
@echo "Available targets:"
12+
@echo " venv - Create virtual environment"
13+
@echo " install - Install dependencies"
14+
@echo " test - Run unit tests"
15+
@echo " clean - Clean up virtual environment"
16+
17+
venv: $(VENV_DIR)/bin/activate ## Create virtual environment
18+
19+
$(VENV_DIR)/bin/activate:
20+
python$(PYTHON_VERSION) -m venv $(VENV_DIR)
21+
22+
install: venv ## Install dependencies
23+
$(PIP) install --upgrade pip
24+
$(PIP) install -r requirements.txt
25+
26+
test: install ## Run unit tests
27+
$(PYTHON) -m unittest discover -v -s sidecar
28+
29+
clean: ## Clean up virtual environment
30+
rm -rf $(VENV_DIR)
31+
rm -rf .pytest_cache
32+
find . -name "*.pyc" -delete
33+
find . -name "__pycache__" -type d -exec rm -rf {} +

tools/dynamic-lora-sidecar/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dynamic LORA Adapter Sidecar for vLLM
22

3-
This is a sidecar-based tool to help rolling out new LoRA adapters to a set of running vLLM model servers. The user deploys the sidecar with a vLLM server, and using a ConfigMap, the user can express their intent as to which LoRA adapters they want to have the running vLLM servers to be configure with. The sidecar watches the ConfigMap and sends load/unload requests to the vLLM container to actuate on the user intent.
3+
This is a sidecar-based tool to help rolling out new LoRA adapters to a set of running vLLM model servers. The user deploys the sidecar with a vLLM server, and using a ConfigMap, the user can express their intent as to which LoRA adapters they want to have the running vLLM servers to be configure with. The sidecar watches the ConfigMap and sends load/unload requests to the vLLM container to actuate on the user intent.
44

55
## Overview
66

@@ -48,6 +48,17 @@ The sidecar uses the vLLM server's API to load or unload adapters based on the c
4848
```
4949
Do not use subPath, since configmap updates are not reflected in the file
5050
51+
## Development
52+
53+
For local development and testing, use the provided Makefile:
54+
55+
```bash
56+
make venv # Create Python 3.10 virtual environment
57+
make install # Install dependencies
58+
make test # Run unit tests
59+
make clean # Clean up
60+
```
61+
5162
## Command Line Arguments
5263

5364
The sidecar supports the following command-line arguments:
@@ -59,7 +70,7 @@ The sidecar supports the following command-line arguments:
5970
- `--config-validation`: Enable config validation (default: True)
6071

6172
## Configuration Fields
62-
- `vLLMLoRAConfig`[**required**] base key
73+
- `vLLMLoRAConfig`[**required**] base key
6374
- `host` [*optional*] Model server's host. defaults to localhost
6475
- `port` [*optional*] Model server's port. defaults to 8000
6576
- `name` [*optional*] Name of this config

0 commit comments

Comments
 (0)