-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.arm64
More file actions
83 lines (66 loc) · 2.87 KB
/
Dockerfile.arm64
File metadata and controls
83 lines (66 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Polysome Generic Workflow Runner Container (ARM64 CPU-only)
# Simplified version for ARM64 without GPU dependencies
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
# Set container metadata
LABEL org.opencontainers.image.source="https://github.com/computationalpathologygroup/Polysome"
LABEL org.opencontainers.image.description="Polysome Generic Workflow Runner (ARM64 CPU-only)"
LABEL org.opencontainers.image.version="1.0.0"
LABEL org.opencontainers.image.architecture="arm64"
# Install Python 3.11 and runtime dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
git \
git-lfs \
build-essential \
cmake \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update && apt-get install -y \
python3.11 \
python3.11-venv \
python3.11-dev \
python3.11-distutils \
&& rm -rf /var/lib/apt/lists/*
# Install pip for Python 3.11 using get-pip.py
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
# Install uv for faster package management
RUN python3.11 -m pip install --no-cache-dir uv
# Create symbolic links for python (force overwrite existing links)
RUN ln -sf /usr/bin/python3.11 /usr/bin/python \
&& ln -sf /usr/bin/python3.11 /usr/bin/python3
# Create required directories for standardized mounting
RUN mkdir -p /opt/algorithm /models /data /output /workflows /prompts /tmp
# Set working directory
WORKDIR /opt/algorithm
# Copy source code
COPY src/ ./src/
COPY inference.py .
COPY pyproject.toml .
# Install the package with CPU dependencies using UV
RUN uv pip install --system -e .[cpu]
# Model weights placeholder - these will be mounted at runtime
# The actual models will be available at /models/ when the container runs
# Expected model files example:
# /models/gemma-3-12b-it-q4_0.gguf
# /models/gemma-3-27b-it-q4_0.gguf
RUN echo "Model weights will be mounted at runtime at /models/" > /models/README.txt
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV WORKFLOW_PATH=/workflows/default.json
# Set Python path to include the source directory
ENV PYTHONPATH=/opt/algorithm/src
# Set the entrypoint to the generic inference script
ENTRYPOINT ["python", "inference.py"]
# Health check to verify the container is working
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD python -c "import sys; sys.path.insert(0, '/opt/algorithm/src'); import polysome; print('Container is healthy')" || exit 1
# Add helpful metadata for the generic runner
LABEL algorithm.mount_points="/models,/data,/output,/workflows"
LABEL algorithm.environment_variables="WORKFLOW_PATH"
LABEL algorithm.model_requirements="LLaMA/Gemma compatible models mounted at /models/ (CPU-only)"
LABEL algorithm.description="Generic Polysome workflow runner for ARM64 - configure via WORKFLOW_PATH"
LABEL algorithm.gpu_support="false"
LABEL algorithm.architecture="arm64"