You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
867 B
40 lines
867 B
2 years ago
|
#!/bin/bash
|
||
|
#
|
||
|
# Tool to dump info about the installed Python and Conda
|
||
|
# stuff insided a singularity image.
|
||
|
# This tool does not require root privilege.
|
||
|
#
|
||
|
# This does not depend on the OS distro flavor.
|
||
|
#
|
||
|
# Usage:
|
||
|
# simg-python-dump-info.sh INFO_DIR CONT_NAME [CRUN_NAME]
|
||
|
#
|
||
|
# INFO_DIR is the location to dump the info files
|
||
|
# CONT_NAME is the name of the container (to be used as the basenames)
|
||
|
#
|
||
|
# Info dumped so far:
|
||
|
|
||
|
|
||
|
set -e
|
||
|
|
||
|
MYSELF=$0
|
||
|
MYDIR=$(dirname "$MYSELF")
|
||
|
|
||
|
INFO_DIR=${1:?INFO_DIR required as arg 1}
|
||
|
CONT_NAME=${2:?CONT_NAME required as arg 2}
|
||
|
CRUN_NAME=$3
|
||
|
|
||
|
if [ -z "$CRUN_NAME" ]; then
|
||
|
CRUN_NAME=crun.$CONT_NAME
|
||
|
fi
|
||
|
|
||
|
_crun () {
|
||
|
"$CRUN_NAME" "$@"
|
||
|
}
|
||
|
|
||
|
_crun which python > "${INFO_DIR}/python-exec"
|
||
|
_crun which python3 > "${INFO_DIR}/python3-exec"
|
||
|
_crun python --version > "${INFO_DIR}/python-version"
|
||
|
|
||
|
_crun conda list > "${INFO_DIR}/conda-list"
|