-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Definition file for an Apptainer container
- Loading branch information
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Bootstrap: docker | ||
From: ubuntu:22.04 | ||
Stage: devel | ||
|
||
%arguments | ||
# Branch to build | ||
treeish=HEAD | ||
|
||
%setup | ||
mkdir -p ${APPTAINER_ROOTFS}/usr/local/src/jellyfish | ||
git archive {{ treeish }} | tar -x -C ${APPTAINER_ROOTFS}/usr/local/src/jellyfish | ||
|
||
%post | ||
# System installations | ||
apt update | ||
apt install -y --no-install-recommends yaggo build-essential autoconf automake libtool gettext pkg-config swig python3-dev libperl-dev ruby-dev | ||
|
||
# Build and install | ||
cd /usr/local/src/jellyfish | ||
autoreconf -fi | ||
PVERSION=$(python3 -V | grep -Po '\b[\d.]+\b' | cut -d. -f1-2) | ||
./configure --enable-swig --enable-all-binding PYTHON_VERSION="$PVERSION" | ||
make -j`nproc` | ||
make install DESTDIR=$(pwd)/inst | ||
|
||
|
||
Bootstrap: docker | ||
From: ubuntu:22.04 | ||
Stage: final | ||
|
||
%help | ||
By default runs the jellyfish command. See --help for help. | ||
If the first argument is "python", "perl", "ruby" or "irb", run | ||
these commands. The Jellyfish module (called "jellyfish" for Perl | ||
and Ruby, but "dna_jellyfish" for Python) is available to import/use/require. | ||
|
||
%files from devel | ||
/usr/local/src/jellyfish/inst/* / | ||
|
||
%post | ||
ldconfig | ||
apt update | ||
apt install -y --no-install-recommends python3 perl ruby | ||
apt-get clean | ||
|
||
%test | ||
set -e | ||
echo -n "Jellyfish cmd: "; jellyfish --help > /dev/null && echo "Good" | ||
echo -n "Python import: "; python3 -c 'import dna_jellyfish; print("Good")' | ||
echo -n "Perl use: "; perl -mjellyfish -e 'print("Good\n")' | ||
echo -n "Ruby require: "; ruby -rjellyfish -e 'puts("Good")' | ||
|
||
%runscript | ||
#! /bin/bash | ||
CMD=("jellyfish") | ||
case "$1" in | ||
(python) CMD=("python3"); shift ;; | ||
(python3) CMD=("python3"); shift ;; | ||
(perl) CMD=("perl" "-mjellyfish"); shift ;; | ||
(ruby) CMD=("ruby" "-rjellyfish"); shift ;; | ||
(irb) CMD=("irb" "-rjellyfish"); shift ;; | ||
(jellyfish) shift ;; | ||
esac | ||
exec "${CMD[@]}" "$@" |