Skip to content

Commit

Permalink
#548 Initial attempt at docker CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Cameron committed Dec 23, 2021
1 parent 67a7aad commit 4f0cfeb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 9 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: docker-ci

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: gridss/gridss:latest
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG UBUNTU_VERSION=20.04
# Use the closest mirror so apt-get doesnt take ages
FROM ubuntu:$UBUNTU_VERSION AS gridss_base_closest_mirror
# Use the closest mirror so apt-get doesnt take ages
RUN sed -i -e 's/http:\/\/archive\.ubuntu\.com\/ubuntu\//mirror:\/\/mirrors\.ubuntu\.com\/mirrors\.txt/' /etc/apt/sources.list
# compile GRIDSS C code

# Set up a C build environment for gridsstools, samtools, and R packages
FROM gridss_base_closest_mirror AS gridss_c_build_environment
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libssl-dev \
Expand All @@ -12,7 +13,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libbz2-dev \
liblzma-dev \
libdeflate-dev \
libncurses5-dev \
build-essential \
autotools-dev \
autoconf \
Expand All @@ -22,26 +22,26 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libomp-dev \
&& rm -rf /var/lib/apt/lists/*

# compile gridsstools
FROM gridss_c_build_environment AS gridss_builder_c
RUN mkdir /opt/gridss/
ARG GRIDSS_VERSION
# compile gridsstools
COPY src/main/c /opt/gridss/src/main/c
COPY src/test/resources /opt/gridss/src/test/resources
RUN cd /opt/gridss/src/main/c/gridsstools/htslib && \
autoreconf -i && ./configure && make -j 8 && \
cd .. && \
autoreconf -i && ./configure && make -j 8 && \
cp gridsstools /opt/gridss/

# compile GRIDSS Java code
FROM maven:3.6.3-jdk-8 AS gridss_builder_java
RUN mkdir /opt/gridss/
WORKDIR /opt/gridss/
# Download maven dependencies first so docker can cache them
COPY pom.xml /opt/gridss/
COPY repo /opt/gridss/repo
#RUN mvn -Dmaven.artifact.threads=8 dependency:go-offline
# run all stages so all dependencies are
# run all stages so all dependencies are cached
RUN mvn -Dmaven.artifact.threads=8 verify && rm -rf target
# Build GRIDSS jar
ARG GRIDSS_VERSION
Expand Down
3 changes: 0 additions & 3 deletions scripts/dev/create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ mv src/main/c/gridsstools-src-$version.tar.gz release/
cp LICENSE release/ # https://bioconda.github.io/contributor/linting.html#gpl-requires-license-distributed
docker build --build-arg GRIDSS_VERSION=$version --target gridss_export_build_artefacts --output type=local,dest=release . # --progress=plain
docker build --build-arg GRIDSS_VERSION=$version --target gridss -t gridss/gridss:$version -t gridss/gridss:latest .
docker build --build-arg GRIDSS_VERSION=$version --target gridss_minimal -t gridss/gridss_minimal:$version -t gridss/gridss_minimal:latest .
docker build --build-arg GRIDSS_VERSION=$version --target gridss -t gridss/virusbreakend:$version -t gridss/virusbreakend:latest .
cd release
chmod +x *
chmod -x *.R *.jar
tar czf gridss-$version.tar.gz *
echo docker push gridss/gridss:$version
echo docker push gridss/gridss:latest
echo docker push gridss/gridss_minimal:$version
echo docker push gridss/gridss_minimal:latest
echo docker push gridss/virusbreakend:$version
echo docker push gridss/virusbreakend:latest

Expand Down

0 comments on commit 4f0cfeb

Please sign in to comment.