diff options
author | William PC <w_calandrini[at]hotmail[dot]com> | 2023-03-21 00:46:25 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-03-25 10:01:48 +0700 |
commit | b3db8ef7563a7ae31c33f0b1776a151a64cd8726 (patch) | |
tree | b7fc48e3cef0615ef403ff52f3ace49774dc59b6 /system/apptainer | |
parent | 946add11383f2bb7a2609d4f2211ec2f2759a669 (diff) |
system/apptainer: Added (open-source container for HP computing)
Signed-off-by: bedlam <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/apptainer')
-rw-r--r-- | system/apptainer/README | 28 | ||||
-rw-r--r-- | system/apptainer/apptainer.SlackBuild | 135 | ||||
-rw-r--r-- | system/apptainer/apptainer.info | 10 | ||||
-rw-r--r-- | system/apptainer/slack-desc | 19 |
4 files changed, 192 insertions, 0 deletions
diff --git a/system/apptainer/README b/system/apptainer/README new file mode 100644 index 000000000000..28182dbd80e4 --- /dev/null +++ b/system/apptainer/README @@ -0,0 +1,28 @@ + Apptainer is an open source container platform designed to be +simple, fast, and secure. Many container platforms are available, +but Apptainer is designed for ease-of-use on shared systems and in +high performance computing (HPC) environments. It features: + + An immutable single-file container image format, supporting +cryptographic signatures and encryption. + Integration over isolation by default. Easily make use of GPUs, +high speed networks, parallel filesystems on a cluster or server. + Mobility of compute. The single file SIF container format is easy +to transport and share. + A simple, effective security model. You are the same user inside a +container as outside, and cannot gain additional privilege on the +host system by default. + + Apptainer is open source software, distributed under the BSD +License. + + Apptainer was formerly known as Singularity and is now a part of +the Linux Foundation. When migrating from Singularity see the admin +migration documentation and user compatibility documentation. + + + You shall install fakeroot for all functionalities. + + Usage example: +apptainer build slackware.sif \ + /usr/share/apptainer/examples/slackware/slackware.def diff --git a/system/apptainer/apptainer.SlackBuild b/system/apptainer/apptainer.SlackBuild new file mode 100644 index 000000000000..7f60d6af736c --- /dev/null +++ b/system/apptainer/apptainer.SlackBuild @@ -0,0 +1,135 @@ +#!/bin/bash + +# Slackware build script for apptainer + +# Copyright 2023 William PC - Seattle, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=apptainer +VERSION=${VERSION:-1.1.6} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + + +# this sets the go path without the needs of logout +SBOGO=$(find /usr/lib${LIBDIRSUFFIX} -type f -name "go") +export GOROOT=$(dirname $(dirname $SBOGO)) +echo "Using GOROOT = $GOROOT" + +PATH=$GOROOT/bin:$PATH \ +./mconfig -b ./build \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +make -C build +make -C build install DESTDIR=$PKG + +install -d $PKG/usr/share/apptainer +cp -av examples $PKG/usr/share/apptainer + +mkdir -p $PKG/usr/share/apptainer/examples/slackware +cat > $PKG/usr/share/apptainer/examples/slackware/slackware.def <<EOF +Bootstrap: docker +From: vbatts/slackware:15.0 + +%runscript + echo "This is what happens when you run the container..." + +%post + echo "Hello from inside the container" +EOF + +# Don't ship .la files: +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md CONTRIBUTORS.md \ + LICENSE.md LICENSE_DEPENDENCIES.md LICENSE_THIRD_PARTY.md \ + RELEASE_PROCEDURE.md SUPPORT.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/apptainer/apptainer.info b/system/apptainer/apptainer.info new file mode 100644 index 000000000000..c1c96f3d85f5 --- /dev/null +++ b/system/apptainer/apptainer.info @@ -0,0 +1,10 @@ +PRGNAM="apptainer" +VERSION="1.1.6" +HOMEPAGE="https://apptainer.org" +DOWNLOAD="https://github.com/apptainer/apptainer/releases/download/v1.1.6/apptainer-1.1.6.tar.gz" +MD5SUM="64aa25ce9c24847f4304661be53df467" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="google-go-lang" +MAINTAINER="William PC" +EMAIL="w_calandrini[at]hotmail[dot]com" diff --git a/system/apptainer/slack-desc b/system/apptainer/slack-desc new file mode 100644 index 000000000000..a0253771a8aa --- /dev/null +++ b/system/apptainer/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +apptainer: apptainer (open-source container for high performance computing) +apptainer: +apptainer: +apptainer: Apptainer is an open source container platform designed to be +apptainer: simple, fast, and secure. Many container platforms are available, +apptainer: but Apptainer is designed for ease-of-use on shared systems and in +apptainer: high performance computing (HPC) environments. +apptainer: +apptainer: +apptainer: +apptainer: |