Skip to content
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

fix: Somalier container #1471

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 42 additions & 16 deletions BALSAMIC/containers/somalier/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

ENV CFLAGS="-fPIC -O3"

RUN apk add --no-cache wget git autoconf tar xz xz-dev bzip2-dev curl curl-dev bash libzip-dev cmake openblas-dev build-base
RUN apk update && apk upgrade && apk add wget git xz bzip2-static musl m4 autoconf tar xz-dev bzip2-dev build-base libpthread-stubs libzip-dev gfortran \

Check notice on line 13 in BALSAMIC/containers/somalier/Dockerfile

View check run for this annotation

codefactor.io / CodeFactor

BALSAMIC/containers/somalier/Dockerfile#L13

Use the `--no-cache` switch to avoid the need to use `--update` and remove `/var/cache/apk/*` when done installing packages. (DL3019)
openssl-libs-static openblas-static pcre-dev curl llvm-dev curl-static bash procps curl-dev clang-static nghttp2-static zlib-static cmake

Check notice

Code scanning / SonarCloud

Arguments in long RUN instructions should be sorted Low

Sort these package names alphanumerically. See more on SonarCloud

RUN mkdir -p /usr/local/include && \
git clone --depth 1 https://github.com/ebiggers/libdeflate.git && \
cd libdeflate && cmake -B build && cmake --build build && \
cp /libdeflate/build/libdeflate.a /usr/local/lib && cp /libdeflate/libdeflate.h /usr/local/include && \
git clone -b v1.18 --depth 1 https://github.com/ebiggers/libdeflate.git && \
cd libdeflate && cmake -B build && cmake --build build && cmake --install build && \
ln -s /usr/local/lib64/* /usr/local/lib && \
cd .. && rm -rf libdeflate

RUN cd / && \
Expand All @@ -26,34 +27,59 @@
echo 'PATH=/nim-${nim_version}/bin:$PATH' >> /etc/environment && \
rm -f nim-${nim_version}-linux_x64.tar.xz

ENV PATH=/nim-${nim_version}/bin/:$PATH
RUN apk add cmake openssl-dev && \

Check notice on line 30 in BALSAMIC/containers/somalier/Dockerfile

View check run for this annotation

codefactor.io / CodeFactor

BALSAMIC/containers/somalier/Dockerfile#L30

Avoid use of wget without progress bar. Use `wget --progress=dot:giga <url>`. Or consider using `-q` or `-nv` (shorthands for `--quiet` or `--no-verbose`). (DL3047)

Check notice on line 30 in BALSAMIC/containers/somalier/Dockerfile

View check run for this annotation

codefactor.io / CodeFactor

BALSAMIC/containers/somalier/Dockerfile#L30

Use the `--no-cache` switch to avoid the need to use `--update` and remove `/var/cache/apk/*` when done installing packages. (DL3019)
wget https://libzip.org/download/libzip-1.6.1.tar.gz && \
tar xzvf libzip-1.6.1.tar.gz && \
cd libzip-1.6.1 && \
mkdir build && cd build && \
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/ ../ && \
make -j4 CFLAGS="-fPIC -O3" install && \
cd ../../ && rm -rf libzip-1.6.1*

RUN cd / && \
git clone --depth 1 -b 1.15 --recursive https://github.com/samtools/htslib && \
ENV PATH=:/root/.nimble/bin:/nim-${nim_version}/bin/:$PATH

RUN git clone --depth 1 -b 1.19.1 --recursive https://github.com/samtools/htslib && \
cd htslib && autoheader && autoconf && \
./configure --enable-s3 --enable-gcs --enable-libcurl --with-libdeflate && \
make -j4 CFLAGS="-fPIC -O3" install && \
cd ../ && \
git clone --depth 1 -b 1.15 --recursive https://github.com/samtools/bcftools && \
git clone --depth 1 -b 1.18 --recursive https://github.com/samtools/bcftools && \
cd bcftools && autoheader && autoconf && \
./configure --enable-s3 --enable-libcurl --with-libdeflate && \
make -j4 CFLAGS="-fPIC -O3" install && \
cd ../ && rm -rf htslib bcftools

RUN cd / && \
git clone -b v0.2.16 --depth 1 https://github.com/brentp/somalier.git && \
ENV RUSTFLAGS=-Ctarget-feature=-crt-static

RUN sh -c 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y' \
&& ~/.cargo/bin/rustup target add x86_64-unknown-linux-musl \
&& git clone https://github.com/38/d4-format \
&& cd d4-format \
&& ln -s /usr/bin/gcc /usr/bin/musl-gcc \
&& ~/.cargo/bin/cargo build --package=d4binding --release && cd .. \
&& install -m 644 d4-format/target/release/libd4binding.a /usr/lib \
&& install -m 644 d4-format/d4binding/include/d4.h /usr/include \
&& rm -rf d4-format/target/ \
&& rm -rf /root/.rustup/ \
&& rm -rf ~/.cargo

ADD . /src/
Fixed Show fixed Hide fixed
RUN cat /src/docker/docker.nim.cfg >> /nim-${nim_version}/config/nim.cfg && \
cd /src/ && nimble install -y && \
nimble install -y c2nim docopt && \
nimble install -y websocket@#head && \
nim c -o:/usr/local/bin/nsb /src/docker/nsb.nim && \
rm -rf /src/

RUN cd / && \
git clone -b master --depth 5 https://github.com/brentp/somalier.git && \
cd somalier && \
nimble install -y nimble && \
/root/.nimble/bin/nimble install -d -y

RUN cd /somalier && \
RUN cd /somalier && \
nim c -d:danger -d:nsb_static -d:release -d:openmp -d:blas=openblas -d:lapack=openblas -o:/usr/bin/somalier src/somalier && \
cp scripts/ancestry-labels-1kg.tsv / && \
rm -rf /somalier && somalier --help

ENV somalier_ancestry_labels /ancestry_labels-1kg.tsv

RUN adduser -D defaultuser

USER defaultuser

1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Fixed:
* MSI table https://github.com/Clinical-Genomics/BALSAMIC/pull/1459
* Pin numpy version in CNVkit container https://github.com/Clinical-Genomics/BALSAMIC/pull/1457
* CNVkit incorrect version in the documentation https://github.com/Clinical-Genomics/BALSAMIC/pull/1457
* Somalier container https://github.com/Clinical-Genomics/BALSAMIC/pull/1471

[15.0.1]
--------
Expand Down
Loading