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

PD-2365: Build docker distributed STAR + samtools #105

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
59 changes: 59 additions & 0 deletions .github/workflows/build-samtools-dist-star.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Samtools Dist STAR Mem 2 Ubuntu CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "develop" and "master" branch
pull_request:
branches: [ "develop", "master" ]
paths:
- '3rd-party-tools/samtools-dist-star/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
image_tag:
description: 'Docker Image Tag (default: branch_name)'

env:
PROJECT_NAME: WARP 3rd Party Tools
# Github repo name
REPOSITORY_NAME: ${{ github.event.repository.name }}
# Region-specific Google Docker repository where GOOGLE_PROJECT/REPOSITORY_NAME can be found
DOCKER_REGISTRY: us.gcr.io
GCR_PATH: broad-gotc-prod/samtools-dist-star
TAG: ${{ github.event.inputs.image_tag || github.head_ref || github.ref_name }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# The job that builds our container
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 3rd-party-tools/samtools-dist-star
# Map a step output to a job output
outputs:
imagePath: ${{ steps.saveImagePath.outputs.url }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${DOCKER_REGISTRY}/${GCR_PATH}:${TAG}
- name: Check working directory'
run: |
echo "Current directory: "
pwd
ls -lht
# Save the image path to an output
- id: 'saveImagePath'
run: echo "url=${DOCKER_REGISTRY}/${GCR_PATH}:${TAG}" >> $GITHUB_OUTPUT
# Log into the Google Docker registry
- id: 'Auth'
name: Login to GCR
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: _json_key
password: ${{ secrets.GCR_CI_KEY }}
# Push the image to the Google Docker registry
- name: Push image
run: "docker push ${DOCKER_REGISTRY}/${GCR_PATH}:${TAG}"
41 changes: 41 additions & 0 deletions 3rd-party-tools/samtools-dist-star/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Adding a platform tag to ensure that images built on ARM-based machines doesn't break pipelines
FROM --platform="linux/amd64" ubuntu:22.04

ENV TERM=xterm-256color

LABEL MAINTAINER="Broad Institute DSDE <dsde-engineering@broadinstitute.org>"

WORKDIR /usr

# Install dependencies
RUN set -eux; \
apt update; \
apt-get install -y autoconf automake bash bzip2 gcc wget make libncurses5-dev zlib1g-dev libbz2-dev liblzma-dev numactl; \
apt-get install -y build-essential git; \

# Install open omics acceleration framework
mkdir temp; \
ls; \
pwd; \
cd temp; \
# clone fork of Open-Omics-Acceleration-Framework with changes added for input/output for star
git clone --recursive https://github.com/aawdeh/Open-Omics-Acceleration-Framework.git; \

# install packages
cd Open-Omics-Acceleration-Framework; \
git checkout aa-optimus; \


cd pipelines/optimus_starsolo; \
./install.sh; \

# Tini
cd /usr/temp; \
wget https://github.com/krallin/tini/releases/download/v0.19.0/tini -O /usr/bin/tini; \
chmod +x /usr/bin/tini; \

# Clean up cached files
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set tini as default entrypoint
ENTRYPOINT [ "/usr/bin/tini", "--" ]
Loading