* Containers: Added simplistic tool to dump info about Python
inside the container.
This commit is contained in:
39
containers/simg-python-dump-info.sh
Executable file
39
containers/simg-python-dump-info.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user