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
11 changes: 10 additions & 1 deletion .woodpecker/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ when:
steps:
lint:
image: python:3.12-slim
environment:
PIP_DEFAULT_TIMEOUT: "120"
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
commands:
- cd coding-agent
- python -m pip install -e '.[dev,redis]' ruff
- ruff check src/coding_agent/observability/ src/coding_agent/ui/http_server.py src/coding_agent/ui/session_manager.py tests/ui/test_server_compat_imports.py tests/coding_agent/test_agent_observability.py tests/coding_agent/test_bee_template_pack_smoke.py

smoke-tests:
image: python:3.12-slim
environment:
PIP_DEFAULT_TIMEOUT: "120"
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
commands:
- cd coding-agent
- python -m pip install -e '.[dev,redis]'
Expand All @@ -33,13 +39,16 @@ steps:
from_secret: proxy_url
HTTPS_PROXY:
from_secret: proxy_url
PIP_DEFAULT_TIMEOUT: "120"
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
UV_DEFAULT_INDEX: https://pypi.tuna.tsinghua.edu.cn/simple
no_proxy: git.mesh.kinaz.me,localhost,127.0.0.1,.svc,.cluster.local,10.0.0.0/8,192.168.0.0/16
NO_PROXY: git.mesh.kinaz.me,localhost,127.0.0.1,.svc,.cluster.local,10.0.0.0/8,192.168.0.0/16
commands:
- mkdir -p /kaniko/.docker
- auth="$(printf '%s:%s' "$REGISTRY_USERNAME" "$REGISTRY_PASSWORD" | base64 | tr -d '\n')"
- printf '{"auths":{"git.mesh.kinaz.me":{"auth":"%s"}}}\n' "$auth" > /kaniko/.docker/config.json
- /kaniko/executor --context "$CI_WORKSPACE/coding-agent" --dockerfile "$CI_WORKSPACE/coding-agent/Dockerfile" --build-arg PYTHON_BASE_IMAGE=git.mesh.kinaz.me/kina/python:3.12-slim --destination "git.mesh.kinaz.me/kina/coding-agent:${CI_COMMIT_SHA}" --destination "git.mesh.kinaz.me/kina/coding-agent:main"
- /kaniko/executor --context "$CI_WORKSPACE/coding-agent" --dockerfile "$CI_WORKSPACE/coding-agent/Dockerfile" --build-arg PYTHON_BASE_IMAGE=git.mesh.kinaz.me/kina/python:3.12-slim --build-arg PIP_DEFAULT_TIMEOUT="$PIP_DEFAULT_TIMEOUT" --build-arg PIP_INDEX_URL="$PIP_INDEX_URL" --build-arg UV_DEFAULT_INDEX="$UV_DEFAULT_INDEX" --destination "git.mesh.kinaz.me/kina/coding-agent:${CI_COMMIT_SHA}" --destination "git.mesh.kinaz.me/kina/coding-agent:main"
when:
- event:
- push
Expand Down
11 changes: 8 additions & 3 deletions coding-agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,24 @@ RUN pnpm build

FROM ${PYTHON_BASE_IMAGE} AS builder

ARG PIP_DEFAULT_TIMEOUT=120
ARG PIP_INDEX_URL=https://pypi.org/simple
ARG UV_DEFAULT_INDEX=https://pypi.org/simple

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_DEFAULT_TIMEOUT=${PIP_DEFAULT_TIMEOUT} \
UV_LINK_MODE=copy

WORKDIR /app

RUN pip install --no-cache-dir uv
RUN PIP_INDEX_URL="${PIP_INDEX_URL}" pip install --no-cache-dir uv

COPY pyproject.toml uv.lock README.md ./
COPY src ./src

RUN uv sync --frozen --no-dev
RUN uv pip install --python /app/.venv/bin/python redis
RUN UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX}" uv sync --frozen --no-dev
RUN UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX}" uv pip install --python /app/.venv/bin/python redis


FROM ${PYTHON_BASE_IMAGE} AS runtime
Expand Down
Loading