Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
- name: Setup uv
uses: astral-sh/setup-uv@v4

- name: Install libpq runtime
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libpq5

- name: Show versions
run: |
uv --version
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,17 @@ jobs:
context: .
file: server/Dockerfile
platforms: linux/amd64
load: ${{ github.event_name == 'pull_request' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Smoke test psycopg runtime
if: github.event_name == 'pull_request'
env:
IMAGE_TAGS: ${{ steps.meta.outputs.tags }}
run: |
image="$(printf '%s\n' "$IMAGE_TAGS" | head -n 1)"
docker run --rm --entrypoint python "$image" -c 'import os; import psycopg; from psycopg import pq; assert os.environ["PSYCOPG_IMPL"] == "python"; assert pq.version() > 0; print(f"psycopg {psycopg.__version__}, libpq {pq.version()}")'
5 changes: 5 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim

WORKDIR /app

RUN apt-get update \
&& apt-get install -y --no-install-recommends libpq5 \
&& rm -rf /var/lib/apt/lists/*

# Configure uv environment variables
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
Expand Down Expand Up @@ -75,6 +79,7 @@ ENV PATH="/app/.venv/bin:$PATH"
# Set default environment variables
ENV AGENT_CONTROL_HOST=0.0.0.0
ENV AGENT_CONTROL_PORT=8000
ENV PSYCOPG_IMPL=python

# Expose the port
EXPOSE 8000
Expand Down
10 changes: 10 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ agent-control-migrate current
agent-control-migrate upgrade head
```

## PostgreSQL driver runtime

`agent-control-server` depends on plain `psycopg`. The published Docker image
installs Debian `libpq5` and sets `PSYCOPG_IMPL=python` so the server uses
psycopg's Python implementation with the OS libpq library.

For wheel-based deployments outside Docker, either install the OS libpq runtime
package for your platform, or install `agent-control-server[binary]` if you want
psycopg's bundled binary package.

## Configuration

Server configuration is driven by environment variables (database, auth, observability, evaluators). For the full list and examples, see the docs.
Expand Down
4 changes: 3 additions & 1 deletion server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [
"pydantic>=2.5.0",
"pydantic-settings>=2.1.0",
"SQLAlchemy>=2.0.0",
"psycopg[binary]>=3.1",
"psycopg>=3.1",
"asyncpg>=0.29.0",
"greenlet>=3.0",
"alembic>=1.13.0",
Expand All @@ -34,6 +34,8 @@ license = {text = "Apache-2.0"}

[project.optional-dependencies]
galileo = ["agent-control-evaluator-galileo>=7.5.0"]
binary = ["psycopg[binary]>=3.1"]
c = ["psycopg[c]>=3.1"]

[dependency-groups]
dev = [
Expand Down
Loading