Skip to content

Commit

Permalink
Merge pull request #3 from NCI-GDC/update_template
Browse files Browse the repository at this point in the history
Update template
  • Loading branch information
czyszCTDS authored Feb 5, 2025
2 parents 543bb0c + 1cb91ac commit 6ccf2f3
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 254 deletions.
8 changes: 4 additions & 4 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"template": "[email protected]:NCI-GDC/bio-software-template.git",
"commit": "edc121c807074808a30cbf77e29d89cb1320f16a",
"commit": "7a4a06c3072e31fe76e22beacb12991004410dba",
"context": {
"cookiecutter": {
"repository_name": "biobambam-docker",
"software_name": "biobambam",
"software_version": "1.0.0",
"commit": "edc121c807074808a30cbf77e29d89cb1320f16a",
"software_name": "biobambam2",
"software_version": "2.0.0",
"commit": "7a4a06c3072e31fe76e22beacb12991004410dba",
"_template": "[email protected]:NCI-GDC/bio-software-template.git"
}
},
Expand Down
5 changes: 4 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ include:
file:
- templates/global/full.yaml

variables:
DOCKER_VERSION: 27.4.0

build_dockers:
stage: build
services:
- docker:20.10.16-dind
- docker:${DOCKER_VERSION}-dind
tags:
- dind
before_script:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
default_stages: [commit, push]

repos:
- repo: git@github.com:Yelp/detect-secrets
rev: v1.2.0
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
exclude: ^(\.cruft\.json)$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: check-yaml
- id: check-toml
Expand Down
53 changes: 0 additions & 53 deletions 2.0.87/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions 2.0.87/justfile

This file was deleted.

51 changes: 0 additions & 51 deletions 2.0.95/Dockerfile

This file was deleted.

10 changes: 7 additions & 3 deletions 2.0.95/justfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
SOFTWARE := "biobambam"
DOCKERFILE := "./Dockerfile"
SOFTWARE := "biobambam2"
DOCKERFILE := "../Dockerfile.multi"
BASE_CONTAINER_REGISTRY := env_var_or_default("BASE_CONTAINER_REGISTRY", "docker.osdc.io")

VERSION := `basename $(pwd)`
VERSION := "2.0.95-release-20190320141403"

emit-dockerfile:
@echo {{DOCKERFILE}}

emit-version:
@echo {{VERSION}}

build-docker:
docker buildx build --compress --progress plain \
-t "{{SOFTWARE}}-{{VERSION}}" \
-f {{DOCKERFILE}} \
. \
--build-arg VERSION="{{VERSION}}" \
--build-arg REGISTRY="{{BASE_CONTAINER_REGISTRY}}"
48 changes: 0 additions & 48 deletions Dockerfile

This file was deleted.

134 changes: 61 additions & 73 deletions Dockerfile.multi
Original file line number Diff line number Diff line change
@@ -1,77 +1,65 @@
ARG REPOSITORY=docker.osdc.io
ARG BUILDER_TAG=2.2.0
FROM ${REPOSITORY}/ncigdc/base-u22.04-builder:${BUILDER_TAG} AS builder
ARG BUILDER_TAG=3.1.0

FROM scratch AS src

ENV LIBMAUS_VERSION=2.0.610-release-20190328154814
ARG VERSION
ENV BIOBAMBAM_VERSION=${VERSION}

ADD https://gitlab.com/german.tischler/libmaus2/-/archive/$LIBMAUS_VERSION/libmaus2-$LIBMAUS_VERSION.tar.gz /libmaus2.tar.gz
ADD https://gitlab.com/german.tischler/biobambam2/-/archive/$BIOBAMBAM_VERSION/biobambam2-$BIOBAMBAM_VERSION.tar.gz /biobambam2.tar.gz

FROM ${REPOSITORY}/ncigdc/amzn2023-builder:${BUILDER_TAG} AS builder

ENV LIBMAUS_VERSION=2.0.610-release-20190328154814
ARG VERSION
ENV BIOBAMBAM_VERSION=${VERSION}

RUN --mount=from=src,target=/src <<EOF
mkdir -p /libmaus2
tar -oxzf /src/libmaus2.tar.gz -C /libmaus2
EOF

RUN --mount=from=src,target=/src <<EOF
mkdir -p /biobambam2
tar -oxzf /src/biobambam2.tar.gz -C /biobambam2
EOF

RUN dnf install -y \
autoconf \
g++ \
libtool \
zlib-devel \
boost-devel \
automake

ENV INSTALLDIR=/biobambam

RUN mkdir -p ${INSTALLDIR}

WORKDIR /libmaus2/libmaus2-$LIBMAUS_VERSION

RUN <<EOF
JOBS=$(cat /proc/cpuinfo | egrep "^processor" | wc -l)
libtoolize
aclocal
autoreconf -i -f
./configure --prefix=${INSTALLDIR}
make -j ${JOBS}
make -j ${JOBS} install
EOF

WORKDIR /biobambam2/biobambam2-$BIOBAMBAM_VERSION

RUN <<EOF
JOBS=$(cat /proc/cpuinfo | egrep "^processor" | wc -l)
autoreconf -i -f
LDFLAGS="-Wl,-rpath=$INSTALLDIR/lib -Wl,-z -Wl,origin" ./configure --with-libmaus2=${INSTALLDIR} --prefix=${INSTALLDIR}
make -j ${JOBS}
make -j ${JOBS} install
EOF

ENV PATH=/biobambam/bin:$PATH

ENV URL=https://path/to/file/$VERSION/software-$VERSION.tar.gz
&& curl --silent https://gitlab.com/german.tischler/libmaus2/repository/archive.tar.gz\?ref\=2.0.610-release-20190328154814 -o libmaus2.tar.gz \
&& curl --silent https://gitlab.com/german.tischler/biobambam2/repository/archive.tar.gz\?ref\=2.0.95-release-20190320141403 -o biobambam2.tar.gz \

RUN apt-get update \
&& apt-get install -y \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Example download and compile step
RUN wget $URL \
&& tar xf software-${VERSION}.tar.gz \
&& cd software-${VERSION} \
&& make \
&& mv bin/* /usr/local/bin \
&& cd .. \
&& rm -rf software-${VERSION}

# For a multi-stage build

FROM ${REPOSITORY}/ncigdc/base-u22.04:${BUILDER_TAG}

COPY --from=builder /usr/local/* /usr/local/
FROM ubuntu:disco-20190310

MAINTAINER Jeremiah H. Savage <[email protected]>

ENV LD_LIBRARY_PATH /usr/local/lib

RUN apt-get update \
&& apt-get install -y \
autoconf \
curl \
g++ \
libtool \
pkg-config \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /usr/local/* \

&& libmaus2files=$(tar -axvf libmaus2.tar.gz) \
&& libmaus2dir=$(echo ${libmaus2files} | cut -f1 -d" ") \
&& cd ${libmaus2dir} \
&& libtoolize \
&& aclocal \
&& autoreconf -i -f \
&& ./configure \
&& make -j4 \
&& make install \
&& cd ../ \
&& rm -rf ${libmaus2dir} libmaus2.tar.gz \
&& biobambam2files=$(tar -axvf biobambam2.tar.gz) \
&& biobambam2dir=$(echo ${biobambam2files} | cut -f1 -d" ") \
&& cd ${biobambam2dir} \
&& export LIBMAUSPREFIX=/usr/local \
&& autoreconf -i -f \
&& ./configure --with-libmaus2=${LIBMAUSPREFIX} \
&& make -j4 \
&& make install \
&& cd ../ \
&& rm -rf ${biobambam2dir} biobambam2.tar.gz \
&& apt-get remove --purge -y \
autoconf \
curl \
g++ \
libtool \
pkg-config \
zlib1g-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
Loading

0 comments on commit 6ccf2f3

Please sign in to comment.