Skip to content

Commit

Permalink
Merge pull request #13 from hmgu-itg/singularity-deploy
Browse files Browse the repository at this point in the history
Added singularity-deploy related files
  • Loading branch information
youngchanpark committed Jun 2, 2021
2 parents b412a26 + 0225aca commit 0beb02c
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 3 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: singularity-deploy

on:
push:
branches:
- "stable"

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get Latest Tag
run: |
# Get the latest tag, we won't build if it's the current
git fetch --tags
latest_tag=$(git tag | tail -1)
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
- name: Define Repository Name and Release Version
run: |
repo=$(echo "${GITHUB_REPOSITORY/\//-}")
release=$(cat VERSION)
echo "reponame=$repo" >> $GITHUB_ENV
echo "release_tag=$release" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
if: ${{ env.release_tag != env.latest_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.release_tag }}
release_name: Release ${{ env.release_tag }}
draft: false
prerelease: false
- uses: eWaterCycle/setup-singularity@v6
if: ${{ env.release_tag != env.latest_tag }}
with:
singularity-version: 3.6.4
- name: Build the singularity container
if: ${{ env.release_tag != env.latest_tag }}
run: |
repo=$(echo "${GITHUB_REPOSITORY/\//-}")
# For each Singularity* container, build based on the prefix (tag)
for recipe in $(ls Singularity*); do
echo "Building $recipe"
tag=$(echo "${recipe/Singularity\./}")
# If we find empty, use latest
if [ "$tag" == "Singularity" ]; then
tag=latest
fi
# Build the container and name by tag
echo "Tag is $tag."
container="$repo:$tag.sif"
singularity build --fakeroot container.sif "$recipe"
if [ "$?" == "0" ]; then
echo "Successfully built container $container."
mv container.sif "$container"
else
echo "There was an issue building $container."
fi
done
- name: Upload Release Assets
if: ${{ env.release_tag != env.latest_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag_name: ${{ env.release_tag }}
run: |
hub release edit $(find . -type f -name "*.sif" -printf "-a %p ") -m "" "$tag_name"
6 changes: 3 additions & 3 deletions Singularity
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ From: ubuntu:18.04
cd bcftools
make bcftools && cp bcftools /usr/bin

Rscript --vanilla -e "install.packages(c(\"reshape2\",\"R.utils\", \"parallel\", \"Hmisc\", \"argparser\", \"data.table\", \"BiocManager\"),repos = \"http://cran.us.r-project.org\");BiocManager::install(c(\"SeqArray\", \"SeqVarTools\"));install.packages(\"GMMAT\", repos = \"http://cran.us.r-project.org\")"
Rscript --vanilla -e "install.packages(c(\"reshape2\",\"R.utils\", \"parallel\", \"Hmisc\", \"argparser\", \"data.table\", \"BiocManager\", \"doMC\"),repos = \"http://cran.us.r-project.org\");BiocManager::install(c(\"SeqArray\", \"SeqVarTools\"));install.packages(\"GMMAT\", repos = \"http://cran.us.r-project.org\")"
perl -MCPAN -e 'foreach (@ARGV) { CPAN::Shell->rematein("notest", "install", $_) }' Module::Build DBI Try::Tiny JSON Data::Dumper File::Basename Getopt::Long Data::Types File::Path

cd /usr/local/bin
Expand Down Expand Up @@ -75,8 +75,8 @@ From: ubuntu:18.04
echo "This container was created: $CREATIONDATE"

%labels
Author Arthur Gilly, Andrei Barysenka, Daniel Suveges
Version v1.5
Author Arthur Gilly, Andrei Barysenka, Daniel Suveges, Young-Chan Park
Version v1.5.1

%help
This container allows you to run rare variant aggregation tests using MONSTER and SMMAT; for more information run this container with the help command line option.
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.1

0 comments on commit 0beb02c

Please sign in to comment.