feat(workspace): setup uv workspace con 2 member (multi-swarm-core + strategy-crypto)
- Root pyproject.toml come workspace coordinator (no codice, dev deps + tool config) - src/multi_swarm_core/pyproject.toml: package core con dipendenze (pandas, openai, pydantic, ...) - src/strategy_crypto/pyproject.toml: package strategia con multi-swarm-core come workspace dep - Aggiunte env var GA_DB_PATH, STRATEGY_CRYPTO_DB_PATH, DASHBOARD_ROOT_PATH in .env.example - Patch Dockerfile (commento, label, healthcheck per workspace) - .gitignore: aggiunto .omc/ + state/*.db generico - Rigenerato uv.lock dal workspace uv tree mostra: strategy-crypto v0.1.0 ├── multi-swarm-core v0.1.0 ├── nicegui v3.12.0 └── ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+13
-11
@@ -1,13 +1,15 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
#
|
||||
# Multi-Swarm Coevolutive — immagine unica usata da due servizi:
|
||||
# * paper-trading runner (scripts/run_paper_trading.py)
|
||||
# * Streamlit dashboard (src/multi_swarm/dashboard/streamlit_app.py)
|
||||
# Multi-Swarm Coevolutive — immagine unica usata da due servizi del compose:
|
||||
# * paper-trading runner (scripts/run_paper_trading.py)
|
||||
# * NiceGUI dashboard (strategy_crypto.frontend.nicegui_app)
|
||||
#
|
||||
# Builder stage: risolve uv.lock con `uv sync --frozen --no-dev` e produce
|
||||
# un venv in /app/.venv. Runtime stage: copia solo /app + scripts/ e gira
|
||||
# come utente non-root. data/, series/, strategies/, state/ sono bind
|
||||
# mount dal compose, quindi non finiscono nell'immagine.
|
||||
# uv workspace: pyproject root coordina due member packages
|
||||
# (multi-swarm-core + strategy-crypto). Il `uv sync --frozen` installa
|
||||
# entrambi come editable nella venv del builder.
|
||||
# Runtime stage: copia solo /app + scripts/ e gira come utente non-root.
|
||||
# data/, series/, state/ sono bind mount dal compose; strategies/ è
|
||||
# bind-mounted dal path src/strategy_crypto/strategy_crypto/strategies.
|
||||
|
||||
FROM python:3.13-slim AS builder
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
@@ -21,7 +23,7 @@ RUN uv sync --frozen --no-dev
|
||||
|
||||
|
||||
FROM python:3.13-slim AS runtime
|
||||
LABEL org.opencontainers.image.title="multi-swarm" \
|
||||
LABEL org.opencontainers.image.title="multi-swarm-coevolutive" \
|
||||
org.opencontainers.image.version="0.1.0" \
|
||||
org.opencontainers.image.source="https://git.tielogic.xyz/Adriano/Multi_Swarm_Coevolutive"
|
||||
|
||||
@@ -43,10 +45,10 @@ RUN useradd -m -u 1000 app \
|
||||
&& chown -R app:app /app
|
||||
USER app
|
||||
|
||||
# Healthcheck di default: import del package — i servizi reali lo
|
||||
# sovrascrivono nel compose (streamlit /_stcore/health).
|
||||
# Healthcheck di default: import dei due package del workspace.
|
||||
# I servizi reali lo sovrascrivono nel compose (es. NiceGUI HTTP).
|
||||
HEALTHCHECK --interval=60s --timeout=5s --retries=3 --start-period=10s \
|
||||
CMD python -c "import multi_swarm" || exit 1
|
||||
CMD python -c "import multi_swarm_core, strategy_crypto" || exit 1
|
||||
|
||||
# Nessun CMD di default: il compose specifica entrypoint/command
|
||||
# per ognuno dei due servizi.
|
||||
|
||||
Reference in New Issue
Block a user