Skip to content

Commit a3fbd77

Browse files
Merge pull request #2 from alex-sokolov2011/dev
Refactor: migrate project to uv package manager
2 parents 00afb85 + 67828f1 commit a3fbd77

File tree

7 files changed

+65
-35
lines changed

7 files changed

+65
-35
lines changed

Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
FROM python:3.12
22

3-
COPY requirements.txt /srv/requirements.txt
43
WORKDIR /srv
5-
RUN python -m pip install --upgrade pip && python -m pip install --no-cache-dir -r requirements.txt
4+
5+
# Install uv
6+
RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
7+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh -s --
8+
ENV PATH="/root/.local/bin:${PATH}"
9+
10+
# Install dependencies
11+
COPY requirements.txt /srv/requirements.txt
12+
RUN --mount=type=cache,target=/root/.cache/uv \
13+
uv pip install --system -r /srv/requirements.txt

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ Start by creating the required folder structure:
4747
```bash
4848
make prepare-dirs
4949
```
50-
Then, download the dataset using the automated script:
50+
51+
Then spin up the full development environment to make sure all required services (Postgres, MinIO, MLflow, Grafana, etc.) are up and running:
52+
53+
```bash
54+
make run-dev
55+
```
56+
57+
This will start the local stack defined in docker-compose.yml and ensure all components are available for the subsequent steps.
58+
Once the containers are running, you can proceed with downloading the dataset using the automated script.
5159

5260
```bash
5361
make download-data

services/ci/Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
FROM python:3.12
22

3-
COPY services/production/requirements.txt /srv/requirements.txt
3+
WORKDIR /srv
4+
5+
# Install uv
6+
RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
7+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh -s --
8+
ENV PATH="/root/.local/bin:${PATH}"
9+
10+
# Install dependencies
11+
COPY services/production/requirements.txt /srv/requirements.txt
12+
RUN --mount=type=cache,target=/root/.cache/uv \
13+
uv pip install --system -r /srv/requirements.txt
14+
415
COPY data_store/prod_model.cbm /srv/data/prod_model.cbm
516
COPY src/ /srv/src/
617

7-
WORKDIR /srv
8-
RUN python -m pip install --upgrade pip && python -m pip install --no-cache-dir -r requirements.txt
9-
1018
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8090", "--reload"]

services/ci/requirements.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

services/jupyter/Dockerfile

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@ FROM python:3.12-slim
22

33
WORKDIR /srv
44

5-
# Install system dependencies
6-
RUN apt-get update \
7-
&& apt-get install -y --no-install-recommends \
8-
build-essential \
9-
&& apt-get clean \
10-
&& rm -rf /var/lib/apt/lists/*
11-
12-
# Install uv for fast Python package installation
13-
RUN pip install --no-cache-dir uv
5+
# Install uv
6+
RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
7+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh -s --
8+
ENV PATH="/root/.local/bin:${PATH}"
149

1510
# Install base dependencies (cached layer)
16-
COPY base-requirements.txt /srv/base-requirements.txt
17-
RUN uv pip install --system --no-cache -r /srv/base-requirements.txt
11+
COPY services/jupyter/base-requirements.txt /srv/base-requirements.txt
12+
RUN --mount=type=cache,target=/root/.cache/uv \
13+
uv pip install --system -r /srv/base-requirements.txt
1814

1915
# Install project-specific dependencies
20-
COPY requirements.txt /srv/requirements.txt
21-
RUN uv pip install --system --no-cache -r /srv/requirements.txt
16+
COPY services/jupyter/requirements.txt /srv/requirements.txt
17+
RUN --mount=type=cache,target=/root/.cache/uv \
18+
uv pip install --system -r /srv/requirements.txt

services/mlflow/Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
FROM python:3.12
22

3-
COPY requirements.txt /srv/requirements.txt
43
WORKDIR /srv
5-
RUN python -m pip install --upgrade pip && python -m pip install --no-cache-dir -r requirements.txt
4+
5+
# Install uv
6+
RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
7+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh -s --
8+
ENV PATH="/root/.local/bin:${PATH}"
9+
10+
# Copy deps early to leverage layer cache
11+
COPY services/mlflow/requirements.txt /srv/requirements.txt
12+
13+
# Install dependencies
14+
RUN --mount=type=cache,target=/root/.cache/uv \
15+
uv pip install --system -r /srv/requirements.txt
616

717
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
818
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
919

10-
ENTRYPOINT ["docker-entrypoint.sh"]
20+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

services/production/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
FROM python:3.12
22

3+
WORKDIR /srv
4+
5+
# Install uv
6+
RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
7+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh -s --
8+
ENV PATH="/root/.local/bin:${PATH}"
9+
10+
# Install dependencies
311
COPY services/production/requirements.txt /srv/requirements.txt
12+
RUN --mount=type=cache,target=/root/.cache/uv \
13+
uv pip install --system -r /srv/requirements.txt
14+
415
COPY data_store/prod_model.cbm /srv/data/prod_model.cbm
516
COPY src/ /srv/src/
617

7-
WORKDIR /srv
8-
RUN python -m pip install --upgrade pip && python -m pip install --no-cache-dir -r requirements.txt
9-
1018
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8090", "--reload"]

0 commit comments

Comments
 (0)