diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..e4fba21 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/README.md b/README.md index b387d19..1c308e9 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ Kubeflow users often struggle to find relevant information across the extensive ## Prerequisites +- [uv](https://docs.astral.sh/uv/) (Python package manager) +- Python 3.9+ - Kubernetes cluster (1.20+) - Helm 3.x - Kubeflow Pipelines @@ -405,25 +407,47 @@ data: {"type": "done"} **Critical**: Both APIs require SSL certificates from a trusted Certificate Authority. Without proper SSL certificates, browsers will block WebSocket connections and HTTPS requests. +#### Dependency Management (uv Workspaces) + +The API servers (`server` and `server-https`) and pipelines are managed as members of a `uv` workspace defined in the root `pyproject.toml`. + +- **To add a dependency to the WebSocket Server**: + ```bash + uv add --package docs-agent-server + ``` +- **To add a dependency to the HTTPS Server**: + ```bash + uv add --package docs-agent-server-https + ``` +- **Local Development**: Because they are workspace members, running `uv sync --all-packages` at the root will install dependencies for all APIs into a shared `.venv`. +- **Building Docker Images**: The Dockerfiles use `uv` internally for blazing-fast installs. You build them from the root directory by passing the member folder as the build context: + ```bash + docker build -t docs-agent-server:latest server/ + docker build -t docs-agent-server-https:latest server-https/ + ``` + ## Usage ### Starting the Services 1. **Deploy Milvus and KServe** (as described above) -2. **Run the Pipeline**: +2. **Install dependencies and activate the virtual environment**: ```bash - python pipelines/kubeflow-pipeline.py + uv sync --all-packages + source .venv/bin/activate ``` -3. **Start the API Server**: +3. **Run the Pipeline and API Servers**: ```bash - # WebSocket API - python server/app.py + python pipelines/kubeflow-pipeline.py - # HTTPS API - python server-https/app.py + # API Servers + python server/app.py # WebSocket API + python server-https/app.py # HTTPS API ``` + + *(Note: You can also use `uv run python