Skip to content

Commit

Permalink
feat: BLAST Dockerfile and GitHub CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
alubbock committed Oct 2, 2024
1 parent d61ea9b commit 820a188
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build BLAST container push to quay.io

on:
push:
branches:
- main
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Source
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: rosalindfranklininstitute+github_blast
password: ${{ secrets.QUAYIO_TOKEN }}

- name: Set BLAST version
run: |
echo BLAST_VERSION=$([ "$GITHUB_REF_TYPE" = "tag" ] && echo $GITHUB_REF_NAME || curl https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/VERSION 2>/dev/null) >> $GITHUB_ENV
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
quay.io/rosalindfranklininstitute/blast
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
labels: |
blast-version=${{ env.BLAST_VERSION }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
BLAST_VERSION=${{ env.BLAST_VERSION }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.12-slim-bookworm AS blast

ARG BLAST_VERSION

RUN apt update && apt install -y wget g++ make liblmdb-dev libsqlite3-dev
RUN mkdir /blast
RUN wget -qO- https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${BLAST_VERSION}/ncbi-blast-${BLAST_VERSION}+-src.tar.gz \
| tar xz --strip-components 2 -C /blast
WORKDIR /blast
RUN ./configure --with-projects=scripts/projects/blast/project.lst
RUN cd ReleaseMT/build && make all_p

ENV PATH="$PATH:/blast/ReleaseMT/bin"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# NCBI Blast+ tools

Containerised build of [BLAST+](https://blast.ncbi.nlm.nih.gov/doc/blast-help/downloadblastdata.html).

Work in progress!

0 comments on commit 820a188

Please sign in to comment.