-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpathbench-gpu.Dockerfile
More file actions
64 lines (51 loc) · 1.98 KB
/
pathbench-gpu.Dockerfile
File metadata and controls
64 lines (51 loc) · 1.98 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
# Use an NVIDIA CUDA base image for GPU support.
# When running the container, use the NVIDIA runtime (e.g., --gpus all).
FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04
# Prevent interactive dialogs during build
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies, Python 3.9, and Git.
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
git && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y \
python3.9 \
python3.9-venv \
python3.9-dev && \
# Install pip for Python 3.9
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.9 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Set the working directory inside the container
WORKDIR /app
# --------------------------------------------------
# Build steps for PathBench-MIL
# --------------------------------------------------
COPY . /app/PathBench-MIL
WORKDIR /app/PathBench-MIL
# Run setup_pathbench.py to create the virtual environment and install base tools.
RUN python3.9 setup_pathbench.py
# "Activate" the virtual environment for subsequent commands:
ENV VIRTUAL_ENV=/app/PathBench-MIL/pathbench_env
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# --------------------------------------------------
# Install the slideflow fork package
# --------------------------------------------------
WORKDIR /app/PathBench-MIL/slideflow_fork
RUN pip install -e .
# --------------------------------------------------
# Install the PathBench-MIL package
# --------------------------------------------------
WORKDIR /app/PathBench-MIL
RUN pip install -e .
# Ensure run_pathbench.sh is executable
RUN chmod +x run_pathbench.sh
# Set backend environment variables (can also be overridden at runtime)
ENV SF_SLIDE_BACKEND=cucim
ENV SF_BACKEND=torch
# Unbuffer Python stdout/stderr so logs appear immediately
ENV PYTHONUNBUFFERED=1
# Set the default command.
# In interactive mode, you can override this to run bash instead.
CMD ["bash", "run_pathbench.sh"]