Bug Spec: DeepISLES Path Conflict in Docker Build
Status: Root Cause Found β Fix Ready
Priority: P0 (Blocks inference)
Branch: fix/deepisles-docker-path
Date: 2025-12-08
Executive Summary
Our Dockerfile was overwriting DeepISLES modules by copying our app to /app/src/, which is where the base image stores DeepISLES code. The fix is to install our app at /home/user/demo instead.
Root Cause
The isleschallenge/deepisles:latest Docker image has this structure:
/app/
βββ main.py
βββ requirements.txt
βββ src/ β DeepISLES Python modules
β βββ isles22_ensemble.py
βββ weights/ β Model weights (~GB)
Our original Dockerfile:
FROM isleschallenge/deepisles:latest
WORKDIR /app
COPY src/ /app/src/ β OVERWRITES DeepISLES modules!
This replaced /app/src/isles22_ensemble.py (DeepISLES) with /app/src/stroke_deepisles_demo/ (our app).
The Fix
- Changed app directory from
/appto/home/user/demo - Added
DEEPISLES_PATH=/appenvironment variable - Updated
direct.pyto checkDEEPISLES_PATHfirst
Dockerfile Changes
# Before: WORKDIR /app
# After:
WORKDIR /home/user/demo
# Before: COPY src/ /app/src/
# After:
COPY src/ /home/user/demo/src/
# New:
ENV DEEPISLES_PATH=/app
direct.py Changes
def _get_deepisles_search_paths() -> list[str]:
paths = []
# Check environment variable first (set in Dockerfile)
env_path = os.environ.get("DEEPISLES_PATH")
if env_path:
paths.append(env_path)
# Add common installation locations
paths.extend(["/app", "/DeepIsles", ...])
return paths
Investigation Process
- Pulled
isleschallenge/deepisles:latestlocally - Inspected WORKDIR:
/app - Listed
/appcontents: foundsrc/,weights/,main.py - Realized our
COPY src/ /app/src/was overwriting DeepISLES
Files Changed
Dockerfile- Use/home/user/demo, addDEEPISLES_PATHsrc/stroke_deepisles_demo/inference/direct.py- Dynamic search paths
Testing
- All 125 unit tests pass
- Need to test on HF Spaces to verify inference works