|
| 1 | +# .devcontainer/Dockerfile - Custom development container for WARP |
| 2 | +FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 |
| 3 | + |
| 4 | +LABEL maintainer="WARP Development" |
| 5 | +LABEL description="Development container for WARP WDL pipelines" |
| 6 | + |
| 7 | +# Avoid interactive prompts during package installation |
| 8 | +ENV DEBIAN_FRONTEND=noninteractive |
| 9 | +ENV WARP_HOME=/workspace |
| 10 | + |
| 11 | +# Update and install system dependencies |
| 12 | +RUN apt-get update && apt-get upgrade -y && \ |
| 13 | + apt-get install -y --no-install-recommends \ |
| 14 | + curl \ |
| 15 | + wget \ |
| 16 | + git \ |
| 17 | + build-essential \ |
| 18 | + ca-certificates \ |
| 19 | + openjdk-17-jdk-headless \ |
| 20 | + python3 \ |
| 21 | + python3-pip \ |
| 22 | + python3-venv \ |
| 23 | + python3-dev && \ |
| 24 | + apt-get clean && rm -rf /var/lib/apt/lists/* |
| 25 | + |
| 26 | +# Setup womtool for WDL validation |
| 27 | +RUN mkdir -p /opt/womtool && \ |
| 28 | + cd /opt/womtool && \ |
| 29 | + WOMTOOL_VERSION="90" && \ |
| 30 | + wget -q "https://github.com/broadinstitute/cromwell/releases/download/${WOMTOOL_VERSION}/womtool-${WOMTOOL_VERSION}.jar" 2>/dev/null || \ |
| 31 | + echo "Note: womtool will be downloaded on first use" && \ |
| 32 | + ln -sf "womtool-${WOMTOOL_VERSION}.jar" womtool.jar 2>/dev/null || true |
| 33 | + |
| 34 | +# Create wrapper script for womtool |
| 35 | +RUN cat > /usr/local/bin/womtool << 'EOF' && chmod +x /usr/local/bin/womtool |
| 36 | +#!/bin/bash |
| 37 | +java -jar /opt/womtool/womtool.jar "$@" |
| 38 | +EOF |
| 39 | + |
| 40 | +# Upgrade pip and install core Python packages |
| 41 | +RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel && \ |
| 42 | + python3 -m pip install --no-cache-dir \ |
| 43 | + miniwdl==1.9.1 \ |
| 44 | + pytest==7.4.3 \ |
| 45 | + pytest-xdist==3.5.0 \ |
| 46 | + pytest-timeout==2.2.0 \ |
| 47 | + pytest-cov==4.1.0 \ |
| 48 | + pyyaml==6.0.1 \ |
| 49 | + jinja2==3.1.6 \ |
| 50 | + jsonschema==4.20.0 \ |
| 51 | + black==23.12.0 \ |
| 52 | + pylint==3.0.3 \ |
| 53 | + mypy==1.8.0 \ |
| 54 | + ruff==0.1.11 \ |
| 55 | + ipython \ |
| 56 | + jupyter \ |
| 57 | + jupyterlab |
| 58 | + |
| 59 | +# Set working directory |
| 60 | +WORKDIR /workspace |
| 61 | + |
| 62 | +# Display versions on container startup |
| 63 | +RUN cat > /usr/local/bin/show-versions << 'EOF' && chmod +x /usr/local/bin/show-versions |
| 64 | +#!/bin/bash |
| 65 | +echo "WARP Development Environment Versions:" |
| 66 | +echo "======================================" |
| 67 | +echo "Java: $(java -version 2>&1 | head -n1)" |
| 68 | +echo "Python: $(python3 --version)" |
| 69 | +echo "Pip: $(python3 -m pip --version | cut -d' ' -f1-2)" |
| 70 | +echo "Git: $(git --version)" |
| 71 | +echo "" |
| 72 | +echo "Python Packages:" |
| 73 | +python3 -m pip list | grep -E "miniwdl|pytest|black|mypy|ruff" |
| 74 | +EOF |
| 75 | + |
| 76 | +# Default command |
| 77 | +CMD ["/bin/bash"] |
0 commit comments