Skip to content

Commit

Permalink
Merge pull request #28 from medema-group/feature/docker
Browse files Browse the repository at this point in the history
Feature/docker
  • Loading branch information
CatarinaCarolina authored Mar 13, 2023
2 parents dd6c511 + a8ea841 commit 2739a64
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create and publish a Docker image

on:
push:
branches:
- master

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ide stuff
.vscode/

# python stuff
*.pyc

# documentation build
site/

# test coverage report and svg
.coverage
coverage.svg
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ WORKDIR /usr/src
RUN git clone https://github.com/medema-group/BiG-SCAPE.git

# Create conda environment
RUN conda env create -f /usr/src/BiG-SCAPE/environment.yml
RUN conda env create -f /usr/src/BiG-SCAPE/bigscape_dependencies.yml
RUN echo "source activate bigscape" > ~/.bashrc
ENV PATH /usr/local/envs/bigscape/bin:$PATH
ENV PATH /usr/src/BiG-SCAPE:$PATH

RUN cd BiG-SCAPE \
&& wget ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam34.0/Pfam-A.hmm.gz \
&& wget https://ftp.ebi.ac.uk/pub/databases/Pfam/current_release/Pfam-A.hmm.gz \
&& gunzip Pfam-A.hmm.gz \
&& source activate bigscape \
&& hmmpress Pfam-A.hmm \
Expand Down
6 changes: 4 additions & 2 deletions run_bigscape
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash

if [[ $# -eq 0 || $1 == "-h" || $1 == "--help" || $1 == "--version" ]]; then
docker pull ghcr.io/medema-group/big-scape
docker run \
--detach=false \
--rm \
--user=$(id -u):$(id -g) \
docker-registry.wur.nl/medema-group/big-scape:1.1.2 \
ghcr.io/medema-group/big-scape \
$@
else
set -o errexit
Expand Down Expand Up @@ -45,13 +46,14 @@ else
#if [ ${INPUT_FILE} ${OUTPUT_FILE} ]; then
if [ ! -z ${INPUT_FILE} ] && [ ! -z ${OUTPUT_FILE} ]; then
echo Running BiG-SCAPE
docker pull ghcr.io/medema-group/big-scape
docker run \
--volume ${INPUT_DIR}:${CONTAINER_SRC_DIR}:ro \
--volume ${OUTPUT_DIR}:${CONTAINER_DST_DIR}:rw \
--detach=false \
--rm \
--user=$(id -u):$(id -g) \
docker-registry.wur.nl/medema-group/big-scape:1.1.2 \
ghcr.io/medema-group/big-scape \
-i ${CONTAINER_SRC_DIR}/${INPUT_FILE} \
-o ${CONTAINER_DST_DIR}/${OUTPUT_FILE}\
$@
Expand Down

0 comments on commit 2739a64

Please sign in to comment.