File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ ROOT=$( dirname $( dirname $( realpath $BASH_SOURCE [0]) ) )
4+ CONTAINER_TAG=$( cat ${ROOT} /bin/.container-tag)
5+ CONTAINER_PATH=${ROOT} /.singularity/image-${CONTAINER_TAG} .sif
6+ HOME_OPT=" --bind ${ROOT} /.home:${HOME} "
7+
8+ # Create virtual environment using absolute path
9+ echo " Creating virtual environment..."
10+ singularity exec ${HOME_OPT} ${CONTAINER_PATH} /usr/bin/python3 -m venv ${ROOT} /.home/.venv
11+
12+ # Install packages
13+ echo " Installing packages..."
14+ singularity exec ${HOME_OPT} ${CONTAINER_PATH} bash -c " source ${ROOT} /.home/.venv/bin/activate && pip install pyyaml"
Original file line number Diff line number Diff line change @@ -86,9 +86,16 @@ if [ ! -d ${ROOT}/node_modules ]; then
8686 singularity run ${HOME_OPT} ${CONTAINER_PATH} npm i
8787fi
8888
89+ if [ ! -d ${ROOT} /.home/.venv ]; then
90+ singularity run ${HOME_OPT} ${CONTAINER_PATH} python3 -m venv ${ROOT} /.home/.venv
91+ singularity run ${HOME_OPT} ${CONTAINER_PATH} bash -c " source ${ROOT} /.home/.venv/bin/activate && pip install pyyaml"
92+ fi
93+
8994BUNDLE=" singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle"
9095RUBY=" singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec ruby"
9196RAKE=" singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec rake"
9297NPM=" singularity run ${HOME_OPT} ${CONTAINER_PATH} npm"
9398NPX=" singularity run ${HOME_OPT} ${CONTAINER_PATH} npx"
9499NODE=" singularity run ${HOME_OPT} ${CONTAINER_PATH} node"
100+ PYTHON=" singularity run ${HOME_OPT} ${CONTAINER_PATH} bash -c 'source ${ROOT} /.home/.venv/bin/activate && python'"
101+
You can’t perform that action at this time.
0 commit comments