From 34f373a14d85b1e9ad0e3220d861d5cc4dc395a1 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 | 35 +++++++++++-------- .../gatkbase/stage_docker_base_in_cloud.sh | 20 +++++++++++ 3 files changed, 44 insertions(+), 17 deletions(-) create mode 100755 scripts/docker/gatkbase/stage_docker_base_in_cloud.sh diff --git a/Dockerfile b/Dockerfile index a513863128d..31bb4192c6a 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.0rc2 # 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..692d1d44efe 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 && \ @@ -54,17 +58,20 @@ CMD ["bash"] 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_MD5 = "32d73e1bc33fda089d7cd9ef4c1be542616bd8e437d1f77afeeaf7afdb019787" -ENV CONDA_PATH /opt/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 -RUN mkdir $DOWNLOAD_DIR && \ - wget -nv -O $DOWNLOAD_DIR/miniconda.sh $CONDA_URL && \ - test "`md5sum $DOWNLOAD_DIR/miniconda.sh | awk -v FS=' ' '{print $1}'` = $CONDA_MD5" && \ - bash $DOWNLOAD_DIR/miniconda.sh -p $CONDA_PATH -b && \ - rm $DOWNLOAD_DIR/miniconda.sh && \ - 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 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