From d8fe231da8beef4d979a12fe0027496534d4f6bf Mon Sep 17 00:00:00 2001 From: David Roazen Date: Fri, 8 Dec 2023 15:47:19 -0500 Subject: [PATCH] Update the GATK base image to a newer LTS ubuntu release --- Dockerfile | 6 ++-- scripts/docker/gatkbase/Dockerfile | 29 +++++++++++++++++-- .../gatkbase/stage_docker_base_in_cloud.sh | 20 +++++++++++++ 3 files changed, 49 insertions(+), 6 deletions(-) create mode 100755 scripts/docker/gatkbase/stage_docker_base_in_cloud.sh diff --git a/Dockerfile b/Dockerfile index a513863128d..253dd82c33d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_DOCKER=broadinstitute/gatk:gatkbase-3.1.0 +ARG BASE_DOCKER=us.gcr.io/broad-dsde-methods/gatk-base-image-staging-area:3.2.0rc3 # stage 1 for constructing the GATK zip FROM ${BASE_DOCKER} AS gradleBuild @@ -93,8 +93,8 @@ RUN conda env create -n gatk -f /gatk/gatkcondaenv.yml && \ echo "source activate gatk" >> /gatk/gatkenv.rc && \ echo "source /gatk/gatk-completion.sh" >> /gatk/gatkenv.rc && \ conda clean -afy && \ - find /opt/miniconda/ -follow -type f -name '*.a' -delete && \ - find /opt/miniconda/ -follow -type f -name '*.pyc' -delete && \ + find $CONDA_PATH -follow -type f -name '*.a' -delete && \ + find $CONDA_PATH -follow -type f -name '*.pyc' -delete && \ rm -rf /root/.cache/pip CMD ["bash", "--init-file", "/gatk/gatkenv.rc"] diff --git a/scripts/docker/gatkbase/Dockerfile b/scripts/docker/gatkbase/Dockerfile index 7f4d8cb6a7b..da062cdc173 100644 --- a/scripts/docker/gatkbase/Dockerfile +++ b/scripts/docker/gatkbase/Dockerfile @@ -1,12 +1,13 @@ # Using OpenJDK 17 # This Dockerfile does not require any files that are in the GATK4 repo. -FROM ubuntu:18.04 +FROM ubuntu:22.04 #### Basic image utilities RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ python3 \ + python3-pip \ wget \ curl \ bc \ @@ -15,10 +16,13 @@ RUN apt-get update && \ less \ bedtools \ samtools \ + bcftools \ tabix \ + git \ gpg-agent \ build-essential \ openjdk-17-jdk \ + vim \ software-properties-common && \ apt-get -y clean && \ apt-get -y autoclean && \ @@ -55,7 +59,7 @@ ENV JAVA_LIBRARY_PATH /usr/lib/jni # Install miniconda ENV DOWNLOAD_DIR /downloads -ENV CONDA_URL https://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh +ENV CONDA_URL https://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh ENV CONDA_MD5 = "32d73e1bc33fda089d7cd9ef4c1be542616bd8e437d1f77afeeaf7afdb019787" ENV CONDA_PATH /opt/miniconda ENV PATH $CONDA_PATH/bin:$PATH @@ -67,4 +71,23 @@ RUN mkdir $DOWNLOAD_DIR && \ conda clean -afy && \ find /opt/miniconda/ -follow -type f -name '*.a' -delete && \ find /opt/miniconda/ -follow -type f -name '*.pyc' -delete && \ - rm -rf /root/.cache/pip + rm -rf /root/.cache/pip + +# Install miniconda +# Following the instructions from https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html +# Note that this *does* install just miniconda, despite the package being named "conda" +# RUN curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > /tmp/conda.gpg && \ +# install -o root -g root -m 644 /tmp/conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \ +# gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 && \ +# rm /tmp/conda.gpg && \ +# echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list && \ +# apt update && \ +# apt install conda && \ +# apt -y clean && \ +# apt -y autoclean && \ +# apt -y autoremove && \ +# . /opt/conda/etc/profile.d/conda.sh && \ +# conda -V +# +# ENV CONDA_PATH /opt/conda +# ENV PATH $CONDA_PATH/bin:$PATH diff --git a/scripts/docker/gatkbase/stage_docker_base_in_cloud.sh b/scripts/docker/gatkbase/stage_docker_base_in_cloud.sh new file mode 100755 index 00000000000..5a2b6fefe40 --- /dev/null +++ b/scripts/docker/gatkbase/stage_docker_base_in_cloud.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if [ $# -ne 1 ]; then + echo "Usage: $0 docker_image_version" + exit 1 +fi + +IMAGE_VERSION=$1 +IMAGE_NAME="us.gcr.io/broad-dsde-methods/gatk-base-image-staging-area" +DOCKER_IMAGE_TAG="${IMAGE_NAME}:${IMAGE_VERSION}" + +gcloud builds submit --tag ${DOCKER_IMAGE_TAG} --timeout=24h --machine-type n1_highcpu_32 + +if [ $? -ne 0 ]; then + echo "gcloud builds submit failed" + exit 1 +fi + +echo "Successfully published image to staging area at ${DOCKER_IMAGE_TAG}" +exit 0 \ No newline at end of file