parent
ce695cd672
commit
4af174ea34
1 changed files with 39 additions and 0 deletions
@ -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" |
Loading…
Reference in new issue