diff --git a/Dockerfile b/Dockerfile index 813b348..82f9235 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,3 @@ -# ================================================== -# Global build arguments -# ================================================== -ARG TRADING_RUNTIME_COMMIT - - # ================================================== # Dependency + test stage # ================================================== @@ -26,12 +20,11 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Install Python dependencies first (maximizes Docker cache) -COPY requirements.txt . -COPY requirements-dev.txt . +COPY requirements.txt requirements-dev.txt . -RUN pip install --upgrade pip && \ - pip install --prefix=/install -r requirements.txt && \ - pip install --prefix=/install -r requirements-dev.txt +RUN pip install --upgrade pip \ + && pip install --prefix=/install -r requirements.txt \ + && pip install --prefix=/install-dev -r requirements-dev.txt # Copy project files COPY pyproject.toml . @@ -43,6 +36,7 @@ COPY tests/ tests/ RUN pip install --prefix=/install . # Run test & quality checks +ENV PYTHONPATH="/install/lib/python3.11/site-packages:/install-dev/lib/python3.11/site-packages" RUN chmod +x check.sh && ./check.sh @@ -72,8 +66,5 @@ RUN adduser --disabled-password --gecos '' appuser # Copy only installed Python artifacts from build stage COPY --from=build /install /usr/local -# Application directory (mostly symbolic now — no source code needed) -WORKDIR /app - # Drop privileges USER appuser diff --git a/argo/workflowtemplate-backtest.yaml b/argo/workflowtemplate-backtest.yaml index 8eaadc3..1be4b99 100644 --- a/argo/workflowtemplate-backtest.yaml +++ b/argo/workflowtemplate-backtest.yaml @@ -20,7 +20,7 @@ spec: - name: experiment-config description: "Path to experiment JSON inside the container" - value: /workspaces/trading-runtime/strategies/ + value: /usr/local/lib/python3.11/site-packages/trading_runtime/argo/argo.json - name: scratch-root description: "Scratch root inside the container" diff --git a/pyproject.toml b/pyproject.toml index 1b35126..fcc4f39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,15 @@ dev = [ [tool.setuptools.packages.find] include = ["trading_runtime*"] +# -------------------------------------------------- +# Include runtime assets +# -------------------------------------------------- +[tool.setuptools.package-data] +trading_runtime = ["**/*"] + +[tool.setuptools] +include-package-data = true + # -------------------------------------------------- # Pytest # --------------------------------------------------