-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a docker image to be used for creating Terra cloud environment #421
Open
SHuang-Broad
wants to merge
1
commit into
main
Choose a base branch
from
sh_terra_custom_env
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
############### stage 0: build samtools and bcftools from source | ||
FROM ubuntu:20.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG SAMTOOLS_VERSION=1.18 | ||
ARG BCFTOOLS_VERSION=1.18 | ||
RUN apt-get -qqy update --fix-missing && \ | ||
apt-get -qqy dist-upgrade && \ | ||
apt-get -qqy install --no-install-recommends \ | ||
ca-certificates \ | ||
libbz2-dev \ | ||
libcurl4-openssl-dev \ | ||
liblzma-dev \ | ||
libncurses5-dev \ | ||
autoconf \ | ||
automake \ | ||
bzip2 \ | ||
gcc \ | ||
make \ | ||
wget \ | ||
zlib1g-dev && \ | ||
wget https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VERSION}/samtools-${SAMTOOLS_VERSION}.tar.bz2 && \ | ||
tar xjf samtools-${SAMTOOLS_VERSION}.tar.bz2 && \ | ||
cd samtools-${SAMTOOLS_VERSION} && ./configure --without-curses --enable-libcurl && make -s all all-htslib && make install install-htslib && cd - && \ | ||
rm -rf samtools-${SAMTOOLS_VERSION}* && \ | ||
wget https://github.com/samtools/bcftools/releases/download/${BCFTOOLS_VERSION}/bcftools-${BCFTOOLS_VERSION}.tar.bz2 && \ | ||
tar xjf bcftools-${BCFTOOLS_VERSION}.tar.bz2 && \ | ||
cd bcftools-${BCFTOOLS_VERSION} && ./configure --without-curses && make -s && make install && cd - && \ | ||
rm -rf bcftools-${BCFTOOLS_VERSION}* && \ | ||
apt-get -qqy purge autoconf automake bzip2 gcc make wget && \ | ||
apt-get -qqy clean && \ | ||
rm -rf /tmp/* \ | ||
/var/tmp/* \ | ||
/var/cache/apt/* \ | ||
/var/lib/apt/lists/* \ | ||
/usr/share/man/?? \ | ||
/usr/share/man/??_* && \ | ||
samtools --help && \ | ||
bcftools --help | ||
|
||
############### stage 1: other commonly used bioinformatics utilities | ||
FROM us.gcr.io/broad-dsde-methods/terra-jupyter-minimal-base:0.0.1 | ||
|
||
USER root | ||
|
||
# copy from previous stage the binaries from samtools build | ||
COPY --from=0 /usr/local/bin/* /usr/local/bin/ | ||
|
||
ARG lrmaCU="https://github.com/broadinstitute/lrma-cloud-utils.git" | ||
ARG MINIMAP2_VERSION='2.26' | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get -qqy update --fix-missing && \ | ||
apt-get -qqy dist-upgrade && \ | ||
apt-get -qqy install --no-install-recommends \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
gnupg \ | ||
zlib1g-dev \ | ||
aria2 \ | ||
bc \ | ||
bedtools \ | ||
bzip2 \ | ||
cron \ | ||
curl \ | ||
datamash \ | ||
gawk \ | ||
less \ | ||
python3.10 \ | ||
python3-pip \ | ||
tabix \ | ||
tmux \ | ||
tree \ | ||
vcftools \ | ||
wget && \ | ||
gcloud components update --quiet && \ | ||
cd /tmp && \ | ||
curl -L https://github.com/lh3/minimap2/releases/download/v${MINIMAP2_VERSION}/minimap2-${MINIMAP2_VERSION}_x64-linux.tar.bz2 | tar -jxvf - && \ | ||
cd minimap2-${MINIMAP2_VERSION}_x64-linux && \ | ||
mv k8 minimap2 paftools.js /usr/local/bin/ && \ | ||
apt-get -qqy clean && \ | ||
rm -rf /tmp/* \ | ||
/var/tmp/* \ | ||
/var/cache/apt/* | ||
|
||
# key library | ||
RUN python3 -m pip install --upgrade pip setuptools ipynbname && \ | ||
python3 -m pip install --upgrade \ | ||
git+${lrmaCU} | ||
|
||
# terminal-customization | ||
RUN cd /home/jupyter/ && \ | ||
git clone \ | ||
--depth=1 \ | ||
https://github.com/Bash-it/bash-it.git /home/jupyter/.bash_it && \ | ||
cd /home/jupyter/.bash_it && \ | ||
bash install.sh --silent && \ | ||
cd - | ||
|
||
# cron-related | ||
RUN echo 'jupyter' >> /etc/cron.allow && \ | ||
echo 'jupyter' >> /etc/at.allow && \ | ||
chmod u+s /usr/sbin/cron | ||
|
||
# sendgrid for email notification | ||
RUN apt-get -qqy update --fix-missing && \ | ||
apt-get -qqy dist-upgrade && \ | ||
apt-get -qqy install --no-install-recommends \ | ||
postfix libsasl2-modules mailutils && \ | ||
apt-get -qqy clean && \ | ||
rm -rf /tmp/* \ | ||
/var/tmp/* \ | ||
/var/cache/apt/* | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
VERSION = 0.0.1 | ||
TAG1 = us.gcr.io/broad-dsp-lrma/lr-terra-base:$(VERSION) | ||
TAG2 = us.gcr.io/broad-dsp-lrma/lr-terra-base:latest | ||
|
||
all: build push | ||
|
||
build: | ||
docker build -t $(TAG1) -t $(TAG2) . | ||
|
||
push: | ||
docker push $(TAG1) | ||
docker push $(TAG2) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other common cloud utilities, such as
gsutil
? Does the terra base image include that?FYI, this is how I usually install it so crcmod works and parallel uploads/downloads are fast:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you're right. The base image I depend on handles the google cloud stuff.
I don't want to mess with that, other than that line which updates the google cloud cli.