#!/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, run this script # like the example below. Just set the build directory location on your # system. See the items below for optional values to optimize the # process (avoid downloading for exmaple). # # ./reproduce/software/shell/apptainer.sh \ # --build-dir=/PATH/TO/BUILD/DIRECTORY # # - Non-mandatory options: # # - If you already have the input data that is necessary for your # project, 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. # # - If you already have the necessary software tarballs that are # necessary for your project, use the '--software-dir' option to # specify its location on your host file system only when # building the container. No problem if you don't have them, they # will be downloaded during the configuration phase. # # - 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=0 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 <