Skip to content

Commit b183507

Browse files
committed
Update Dockerfile
1 parent 40b6ec3 commit b183507

13 files changed

Lines changed: 49 additions & 74 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Add your description here"
55
authors = [{ name = "nguu0123", email = "nguu0123@gmail.com" }]
66
dependencies = []
77
readme = "README.md"
8-
requires-python = ">= 3.10"
8+
requires-python = "== 3.10.18"
99

1010
[tool.uv.sources]
1111
util = { workspace = true }

‎src/ensemble/Dockerfile‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1+
# This's run from root dir
12
FROM debian:stable-slim
23

3-
WORKDIR /ensemble
4+
WORKDIR /workspace
45

56
COPY --from=ghcr.io/astral-sh/uv:0.9.0 /uv /uvx /bin/
67

7-
COPY ./ensemble/*.toml ./
8+
COPY pyproject.toml uv.lock /workspace/
89

9-
COPY ./ensemble/run_server.sh ./ensemble/run_server.sh
10+
RUN uv sync --frozen --no-install-workspace --package=ensemble --no-cache --compile-bytecode
1011

11-
RUN uv python pin 3.10.18
12+
COPY src/ensemble /workspace/src/ensemble
1213

13-
RUN uv sync --compile-bytecode --no-cache
14+
COPY src/util /workspace/src/util
1415

15-
COPY ./ensemble/*.py ./ensemble/
16-
17-
COPY ./ensemble/*.yaml ./ensemble/
18-
19-
COPY ./util/ ./util
16+
RUN uv sync --frozen --package=ensemble --no-cache --compile-bytecode
2017

2118
EXPOSE 5011
2219

23-
WORKDIR /ensemble/ensemble
20+
ENV PATH="/workspace/.venv/bin:$PATH"
2421

25-
ENV PATH="/ensemble/.venv/bin:$PATH"
22+
WORKDIR /workspace/src/ensemble
2623

2724
ENTRYPOINT [ "./run_server.sh" ]
25+

‎src/ensemble/docker_build.sh‎

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

‎src/ensemble/docker_run.sh‎

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

‎src/ensemble/pyproject.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ dependencies = [
1111
"opentelemetry-instrumentation-aiohttp-client>=0.48b0",
1212
"aio-pika>=9.5.5",
1313
"opentelemetry-instrumentation-aio-pika>=0.54b1",
14+
"util",
1415
]
1516

1617
name = "ensemble"
1718
version = "0.1.0"
1819
requires-python = "== 3.10.18"
20+
21+
[tool.uv.sources]
22+
util = { workspace = true }

‎src/inference/Dockerfile.cpu‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
FROM rdsea/debian-slim-opencv:latest
22

3-
WORKDIR /object_classification
4-
5-
COPY ./inference/onnx_model/ ./inference/onnx_model/
3+
WORKDIR /workspace
64

75
COPY --from=ghcr.io/astral-sh/uv:0.9.0 /uv /uvx /bin/
86

9-
COPY ./inference/*.toml ./
10-
11-
RUN uv python pin 3.10.18
7+
COPY pyproject.toml uv.lock /workspace/
128

13-
RUN uv sync --compile-bytecode --no-cache --extra cpu
9+
RUN uv sync --frozen --no-install-workspace --package=inference --no-cache --compile-bytecode
1410

15-
COPY ./inference/*.py ./inference/
11+
COPY src/inference /workspace/src/inference
1612

17-
COPY ./inference/*.yaml ./inference/
13+
COPY src/util /workspace/src/util
1814

19-
COPY ./util/ ./util
20-
21-
COPY ./inference/run_server.sh ./inference/run_server.sh
15+
RUN uv sync --frozen --package=inference --no-cache --compile-bytecode
2216

2317
EXPOSE 5012
2418

25-
WORKDIR /object_classification/inference
19+
ENV PATH="/workspace/.venv/bin:$PATH"
2620

27-
ENV PATH="/object_classification/.venv/bin:$PATH"
21+
WORKDIR /workspace/src/inference
2822

2923
ENTRYPOINT [ "./run_server.sh" ]
24+

‎src/inference/Dockerfile.gpu‎

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,18 @@ RUN apt-get install -y ffmpeg libsm6 libxext6 wget
88

99
COPY --from=ghcr.io/astral-sh/uv:0.9.0 /uv /uvx /bin/
1010

11-
COPY ./inference/onnx_model/ ./inference/onnx_model/
11+
COPY src/inference /workspace/src/inference
1212

13-
COPY ./inference/run_server.sh ./inference/run_server.sh
13+
COPY src/util /workspace/src/util
1414

15-
COPY ./inference/*.toml ./
16-
17-
RUN uv python pin 3.10.18
18-
19-
RUN uv sync --compile-bytecode --no-cache
15+
RUN uv sync --frozen --package=inference --no-cache --compile-bytecode
2016

2117
RUN wget https://pypi.jetson-ai-lab.io/jp6/cu126/+f/e1e/9e3dc2f4d5551/onnxruntime_gpu-1.23.0-cp310-cp310-linux_aarch64.whl#sha256=e1e9e3dc2f4d5551c5f0b5554cf490d141cd0d339a5a7f4826ac0e04f20a35fc
2218

23-
RUN uv pip install ./onnxruntime_gpu-1.23.0-cp310-cp310-linux_aarch64.whl
24-
25-
COPY ./inference/*.py ./inference/
26-
27-
COPY ./inference/*.yaml ./inference/
28-
29-
COPY ./util/ ./util
30-
31-
EXPOSE 8050-8065
19+
RUN uv pip install ./onnxruntime_gpu-1.23.0-cp310-cp310-linux_aarch64.whl && rm ./onnxruntime_gpu-1.23.0-cp310-cp310-linux_aarch64.whl
3220

33-
WORKDIR /object_classification/inference
21+
WORKDIR /workspace/src/inference
3422

35-
ENV PATH="/object_classification/.venv/bin:$PATH"
23+
ENV PATH="/workspace/.venv/bin:$PATH"
3624

3725
ENTRYPOINT [ "./run_server.sh" ]

‎src/inference/pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies = [
1010
"opentelemetry-exporter-otlp-proto-http>=1.27.0",
1111
"opentelemetry-exporter-otlp>=1.27.0",
1212
"opentelemetry-instrumentation-aiohttp-client>=0.48b0",
13+
"util",
1314
]
1415

1516
optional-dependencies.cpu = ["onnxruntime"]

‎src/preprocessing/Dockerfile‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
1+
# This's run from root dir
12
FROM rdsea/debian-slim-opencv:latest
23

3-
WORKDIR /image_preprocessing/preprocessing
4+
WORKDIR /workspace
45

56
COPY --from=ghcr.io/astral-sh/uv:0.9.0 /uv /uvx /bin/
67

7-
COPY ./preprocessing/*.toml ./
8+
COPY pyproject.toml uv.lock /workspace/
89

9-
RUN uv python pin 3.10.18
10+
RUN uv sync --frozen --no-install-workspace --package=preprocessing --no-cache --compile-bytecode
1011

11-
RUN uv sync --compile-bytecode --no-cache
12+
COPY src/preprocessing /workspace/src/preprocessing
1213

13-
WORKDIR /image_preprocessing
14+
COPY src/util /workspace/src/util
1415

15-
COPY ./preprocessing/run_server.sh ./preprocessing/run_server.sh
16-
17-
COPY ./preprocessing/*.yaml ./preprocessing/
18-
19-
COPY ./preprocessing/*.py ./preprocessing/
20-
21-
COPY ./util/ ./util
16+
RUN uv sync --frozen --package=preprocessing --no-cache --compile-bytecode
2217

2318
EXPOSE 5010
2419

25-
WORKDIR /image_preprocessing/preprocessing
20+
ENV PATH="/workspace/.venv/bin:$PATH"
2621

27-
ENV PATH="/image_preprocessing/preprocessing/.venv/bin:$PATH"
22+
WORKDIR /workspace/src/preprocessing
2823

2924
ENTRYPOINT [ "./run_server.sh" ]
3025

‎src/preprocessing/docker_build.sh‎

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

0 commit comments

Comments
 (0)