diff --git a/Dockerfile b/Dockerfile index adf458e..e8a2c65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM debian:bullseye-slim AS downloaded-deps SHELL ["/bin/bash", "-c"] # Install VCF2MAF +# - support VEP v107+ by patching vcf2maf to remove references to removed --af_esp option # TODO: I don't like /opt as a home for these WORKDIR /tmp/vcf2maf @@ -15,6 +16,7 @@ RUN apt-get update -y && \ mv "vcf2maf-${VCF2MAF_VERSION}" vcf2maf && \ mkdir -p /opt/data && \ cp vcf2maf/*.pl /opt && \ + sed -i '/ --af_esp/d' /opt/vcf2maf.pl && \ cp -r vcf2maf/data /opt/data && \ rm -rf vcf2maf @@ -30,8 +32,8 @@ RUN curl -L \ # Clone (but don't install yet) Ensembl-VEP -ENV VEP_ENSEMBL_RELEASE_VERSION=111.0 -RUN git clone --depth 1 -b "release/${VEP_ENSEMBL_RELEASE_VERSION}" https://github.com/Ensembl/ensembl-vep.git && \ +ENV VEP_ENSEMBL_GIT_VERSION=111.0 +RUN git clone --depth 1 -b "release/${VEP_ENSEMBL_GIT_VERSION}" https://github.com/Ensembl/ensembl-vep.git && \ chmod u+x ensembl-vep/*.pl # Clone ensembl-variation git repository @@ -47,7 +49,7 @@ RUN curl -L https://github.com/Ensembl/ensembl-xs/archive/2.3.2.zip -o ensembl-x WORKDIR / -FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.03.01 AS base-deps +FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.04.01 AS base-deps SHELL ["/bin/bash", "-c"] diff --git a/dev.Dockerfile b/dev.Dockerfile index 5f85aea..94ebaec 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -1,4 +1,55 @@ -FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.03.01 AS base-deps +FROM --platform=$BUILDPLATFORM debian:bullseye-slim AS downloaded-deps + +SHELL ["/bin/bash", "-c"] + +# Install VCF2MAF +# - support VEP v107+ by patching vcf2maf to remove references to removed --af_esp option +# TODO: I don't like /opt as a home for these + +WORKDIR /tmp/vcf2maf +ENV VCF2MAF_VERSION=1.6.21 +RUN apt-get update -y && \ + apt-get install -y curl git unzip wget && \ + echo "https://github.com/mskcc/vcf2maf/archive/refs/tags/v${VCF2MAF_VERSION}.zip" && \ + curl -L "https://github.com/mskcc/vcf2maf/archive/refs/tags/v${VCF2MAF_VERSION}.zip" -o vcf2maf.zip && \ + unzip vcf2maf.zip && \ + mv "vcf2maf-${VCF2MAF_VERSION}" vcf2maf && \ + mkdir -p /opt/data && \ + cp vcf2maf/*.pl /opt && \ + sed -i '/ --af_esp/d' /opt/vcf2maf.pl && \ + cp -r vcf2maf/data /opt/data && \ + rm -rf vcf2maf + +# Download Cromwell + WOMtool +ENV CROMWELL_VERSION=86 +WORKDIR / +RUN curl -L \ + https://github.com/broadinstitute/cromwell/releases/download/${CROMWELL_VERSION}/cromwell-${CROMWELL_VERSION}.jar \ + -o cromwell.jar && \ + curl -L \ + https://github.com/broadinstitute/cromwell/releases/download/${CROMWELL_VERSION}/womtool-${CROMWELL_VERSION}.jar \ + -o womtool.jar + + +# Clone (but don't install yet) Ensembl-VEP +ENV VEP_ENSEMBL_GIT_VERSION=111.0 +RUN git clone --depth 1 -b "release/${VEP_ENSEMBL_GIT_VERSION}" https://github.com/Ensembl/ensembl-vep.git && \ + chmod u+x ensembl-vep/*.pl + +# Clone ensembl-variation git repository +WORKDIR /ensembl-vep/ +RUN git clone --depth 1 https://github.com/Ensembl/ensembl-variation.git && \ + mkdir var_c_code && \ + cp ensembl-variation/C_code/*.c ensembl-variation/C_code/Makefile var_c_code/ +RUN git clone --depth 1 https://github.com/bioperl/bioperl-ext.git +RUN curl -L https://github.com/Ensembl/ensembl-xs/archive/2.3.2.zip -o ensembl-xs.zip && \ + unzip -q ensembl-xs.zip && \ + mv ensembl-xs-2.3.2 ensembl-xs && \ + rm -rf ensembl-xs.zip + +WORKDIR / + +FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.04.01 AS base-deps LABEL org.opencontainers.image.description="Local development image for Bento WES." LABEL devcontainer.metadata='[{ \ @@ -13,25 +64,46 @@ LABEL devcontainer.metadata='[{ \ SHELL ["/bin/bash", "-c"] +WORKDIR / + # Install system packages for HTSLib + SAMtools + curl and jq for workflows # OpenJDK is for running WOMtool/Cromwell + +RUN apt-get update -y && \ + apt-get install -y \ + samtools \ + tabix \ + bcftools \ + curl \ + jq \ + openjdk-17-jre \ + && \ + rm -rf /var/lib/apt/lists/* + +# Install system packages for VEP +# Perl/libdbi-perl/lib*-dev/cpanminus/unzip are for cBioPortal scripts / caches / utilities +RUN apt-get update -y && \ + apt-get install -y \ + curl \ + perl \ + libdbd-mysql-perl \ + libdbi-perl \ + libjson-perl \ + libwww-perl \ + libperl-dev \ + cpanminus \ + unzip \ + libbz2-dev \ + liblzma-dev \ + zlib1g-dev \ + && \ + rm -rf /var/lib/apt/lists/* + # Then, install dependencies for running the Python server + Python workflow dependencies COPY container.requirements.txt . -RUN apt-get update -y && \ - apt-get install -y samtools tabix bcftools curl jq openjdk-17-jre && \ - rm -rf /var/lib/apt/lists/* && \ - pip install --no-cache-dir -r /container.requirements.txt && \ +RUN pip install --no-cache-dir -r /container.requirements.txt && \ rm /container.requirements.txt -WORKDIR / -ENV CROMWELL_VERSION=86 -RUN curl -L \ - https://github.com/broadinstitute/cromwell/releases/download/${CROMWELL_VERSION}/cromwell-${CROMWELL_VERSION}.jar \ - -o cromwell.jar && \ - curl -L \ - https://github.com/broadinstitute/cromwell/releases/download/${CROMWELL_VERSION}/womtool-${CROMWELL_VERSION}.jar \ - -o womtool.jar - FROM base-deps AS install # Backwards-compatible with old BentoV2 container layout @@ -54,5 +126,18 @@ COPY run.dev.bash . # Tell the service that we're running a local development container ENV BENTO_CONTAINER_LOCAL=true +# Copy from other stages last, since it means the stages can be built in parallel + +# - Copy VCF2MAF +COPY --from=downloaded-deps /opt /opt + +# - Copy Cromwell + WOMtool +COPY --from=downloaded-deps /cromwell.jar /cromwell.jar +COPY --from=downloaded-deps /womtool.jar /womtool.jar + +# - Copy Ensembl-VEP +COPY --from=ensemblorg/ensembl-vep:release_111.0 /usr/share/perl/5.34.0/CPAN /opt/vep +COPY --from=ensemblorg/ensembl-vep:release_111.0 /opt/vep /opt/vep + ENTRYPOINT [ "bash", "./entrypoint.bash" ] CMD [ "bash", "./run.dev.bash" ] diff --git a/poetry.lock b/poetry.lock index 2da1993..40b6fb9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -858,13 +858,13 @@ referencing = ">=0.31.0" [[package]] name = "kombu" -version = "5.3.5" +version = "5.3.6" description = "Messaging library for Python." optional = false python-versions = ">=3.8" files = [ - {file = "kombu-5.3.5-py3-none-any.whl", hash = "sha256:0eac1bbb464afe6fb0924b21bf79460416d25d8abc52546d4f16cad94f789488"}, - {file = "kombu-5.3.5.tar.gz", hash = "sha256:30e470f1a6b49c70dc6f6d13c3e4cc4e178aa6c469ceb6bcd55645385fc84b93"}, + {file = "kombu-5.3.6-py3-none-any.whl", hash = "sha256:49f1e62b12369045de2662f62cc584e7df83481a513db83b01f87b5b9785e378"}, + {file = "kombu-5.3.6.tar.gz", hash = "sha256:f3da5b570a147a5da8280180aa80b03807283d63ea5081fcdb510d18242431d9"}, ] [package.dependencies] @@ -881,7 +881,7 @@ mongodb = ["pymongo (>=4.1.1)"] msgpack = ["msgpack"] pyro = ["pyro4"] qpid = ["qpid-python (>=0.26)", "qpid-tools (>=0.26)"] -redis = ["redis (>=4.5.2,!=4.5.5,<6.0.0)"] +redis = ["redis (>=4.5.2,!=4.5.5,!=5.0.2)"] slmq = ["softlayer-messaging (>=1.0.3)"] sqlalchemy = ["sqlalchemy (>=1.4.48,<2.1)"] sqs = ["boto3 (>=1.26.143)", "pycurl (>=7.43.0.5)", "urllib3 (>=1.26.16)"]