#!/bin/sh # # Create a Apptainer container from an existing image of the built software # environment, but with the source, data and build (analysis) directories # directly within the host file system. This script is assumed to be run in # the top project source directory (that has 'README.md' and # 'paper.tex'). If not, use the '--source-dir' option to specify where the # Maneage'd project source is located. # # Usage: # # - When you are at the top Maneage'd project directory, you can run this # script like the example below. Just set all the '/PATH/TO/...' # directories. See the items below for optional values. # # ./reproduce/software/containers/apptainer.sh \ # --build-dir=/PATH/TO/BUILD/DIRECTORY \ # --software-dir=/PATH/TO/SOFTWARE/TARBALLS # # - Non-mandatory options: # # - If you already have the input data that is necessary for your # project's, use the '--input-dir' option to specify its location # on your host file system. Otherwise the necessary analysis # files will be downloaded directly into the build # directory. Note that this is only necessary when '--build-only' # is not given. # # - The '--software-dir' is only useful if you want to build a # container. Even in that case, it is not mandatory: if not # given, the software tarballs will be downloaded (thus requiring # internet). # # - To avoid having to set them every time you want to start the # apptainer environment, you can put this command (with the proper # directories) into a 'run.sh' script in the top Maneage'd project # source directory and simply execute that. The special name 'run.sh' # is in Maneage's '.gitignore', so it will not be included in your # git history by mistake. # # Known problems: # # Copyright (C) 2025-2025 Mohammad Akhlaghi # Copyright (C) 2025-2025 Giacomo Lorenzetti # # This script is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This script is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this script. If not, see . # Script settings # --------------- # Stop the script if there are any errors. set -e # Default option values jobs= quiet=0 source_dir= build_only= base_name="" shm_size=20gb scriptname="$0" project_name="" project_shell=0 container_shell=0 base_os=debian:stable-slim print_help() { # Print the output. cat <