Skip to content

Commit 76f4019

Browse files
pavanputhraclaude
andcommitted
Fix CI test failure: switch dev Dockerfile and test workflow from Poetry to uv
- docker/Dockerfile: replace Poetry with uv; install conserver + api + dev groups; fix PYTHONPATH to /app/common, /app/conserver, /app/api (server/ no longer exists) - docker-compose.yml: fix conserver command from server/main.py -> conserver/main.py - run-tests.yml: drop `poetry install` step (deps already installed in image by uv) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2f4467a commit 76f4019

3 files changed

Lines changed: 25 additions & 33 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ jobs:
3434
- name: Run tests inside Docker container
3535
run: |
3636
docker-compose run --rm conserver bash -c "
37-
# Install tests dependencies
38-
poetry install &&
39-
# Run the tests
4037
pytest --maxfail=5 --disable-warnings
4138
"
4239

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
dockerfile: ./docker/Dockerfile
1919
context: .
2020
# image: vcon-server-enterprise:latest
21-
command: "watchmedo auto-restart -p '*.py' -R -- opentelemetry-instrument python ./server/main.py"
21+
command: "watchmedo auto-restart -p '*.py' -R -- opentelemetry-instrument python ./conserver/main.py"
2222
volumes:
2323
- .:/app
2424
- ./config.yml:/app/config.yml

docker/Dockerfile

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
1-
FROM python:3.12.2
1+
# Dev / test image — installs all dependency groups (conserver + api + dev).
2+
# Used by docker-compose for local development and CI tests.
3+
FROM python:3.12-slim
24

3-
# Build arguments for version information (injected by CI/CD)
45
ARG VCON_SERVER_VERSION=dev
56
ARG VCON_SERVER_GIT_COMMIT=unknown
67
ARG VCON_SERVER_BUILD_TIME=unknown
78

8-
# Set version info as environment variables (available at runtime)
99
ENV VCON_SERVER_VERSION=${VCON_SERVER_VERSION}
1010
ENV VCON_SERVER_GIT_COMMIT=${VCON_SERVER_GIT_COMMIT}
1111
ENV VCON_SERVER_BUILD_TIME=${VCON_SERVER_BUILD_TIME}
1212

1313
RUN apt-get update && \
14-
apt-get install -y libavdevice-dev ffmpeg
15-
16-
# Install SoX dependency
17-
# https://pysox.readthedocs.io/en/latest/#installation
18-
RUN apt-get install -y libsox-fmt-all sox
19-
20-
# This is required in order to wait for Redis
21-
RUN apt-get install -y redis-tools
22-
RUN pip install --upgrade pip
23-
24-
# Install watchdog
25-
RUN pip install watchdog
14+
apt-get install -y --no-install-recommends \
15+
libavdevice-dev \
16+
ffmpeg \
17+
libsox-fmt-all \
18+
sox \
19+
libpq5 \
20+
redis-tools \
21+
&& rm -rf /var/lib/apt/lists/*
22+
23+
COPY --from=ghcr.io/astral-sh/uv:0.10.9 /uv /usr/local/bin/uv
24+
ENV UV_SYSTEM_PYTHON=1
2625

2726
WORKDIR /app
2827

29-
# Install Poetry
30-
RUN pip install poetry==2.1.3
31-
RUN poetry config virtualenvs.create false
28+
COPY pyproject.toml uv.lock /app/
3229

33-
# Copy dependency files first for better caching
34-
COPY pyproject.toml poetry.lock* /app/
30+
# Install all groups (conserver + api + dev) so the image works for both
31+
# running services and running pytest.
32+
# Venv at /opt/venv so docker-compose volume mounts don't wipe it.
33+
RUN uv venv --seed /opt/venv && \
34+
UV_PROJECT_ENVIRONMENT=/opt/venv uv sync --frozen --group conserver --group api --group dev
35+
ENV PATH="/opt/venv/bin:$PATH"
3536

36-
# Regenerate lock file if needed and install dependencies
37-
RUN poetry lock --no-update || poetry lock
38-
RUN poetry install --only=main --no-interaction
39-
40-
# Install OpenTelemetry instrumentation libraries for detected packages
37+
# Auto-install OTel instrumentation packages for the installed libraries.
4138
RUN opentelemetry-bootstrap -a install
4239

43-
# Copy the rest of the application
4440
COPY . /app
4541

46-
ENV PYTHONPATH "${PYTHONPATH}:/app/:/app/server/"
42+
ENV PYTHONPATH="/app:/app/common:/app/conserver:/app/api"
4743

4844
ENTRYPOINT ["/app/docker/wait_for_redis.sh"]
49-
50-
CMD [ "opentelemetry-instrument", "python", "./server/main.py" ]
45+
CMD ["opentelemetry-instrument", "python", "/app/conserver/main.py"]

0 commit comments

Comments
 (0)