Skip to content

Commit f031249

Browse files
committed
tcl/lua: remove useless SINGULARITY_COMMAND_ARGS var
1 parent 631bc88 commit f031249

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

shpc/main/modules/templates/singularity.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@ local MODULEPATH="{{ module_dir }}"
4646
setenv("SINGULARITY_SHELL", "{{ singularity_shell }}")
4747
setenv ("SINGULARITY_OPTS", "")
4848
setenv ("SINGULARITY_COMMAND_OPTS", "")
49-
setenv ("SINGULARITY_COMMAND_ARGS", "")
5049

5150
-- interactive shell to any container, plus exec for aliases
5251
local containerPath = '{{ container_sif }}'
5352
local shellCmd = "singularity ${SINGULARITY_OPTS} shell ${SINGULARITY_COMMAND_OPTS} -s {{ singularity_shell }} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} " .. containerPath
5453
local execCmd = "singularity ${SINGULARITY_OPTS} exec ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} "
55-
local runCmd = "singularity ${SINGULARITY_OPTS} run ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} " .. containerPath .. " ${SINGULARITY_COMMAND_ARGS}"
54+
local runCmd = "singularity ${SINGULARITY_OPTS} run ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} " .. containerPath
5655
local inspectCmd = "singularity ${SINGULARITY_OPTS} inspect ${SINGULARITY_COMMAND_OPTS} "
5756

5857
-- set_shell_function takes bashStr and cshStr
@@ -73,7 +72,7 @@ if (myShellName() == "bash") then
7372
end{% endif %}
7473

7574
-- A customizable exec function
76-
set_shell_function("{|module_name|}-exec", execCmd .. containerPath .. " ${SINGULARITY_COMMAND_ARGS} $@", execCmd .. containerPath .. " ${SINGULARITY_COMMAND_ARGS}")
75+
set_shell_function("{|module_name|}-exec", execCmd .. containerPath .. " $@", execCmd .. containerPath)
7776

7877
-- Always provide a container run
7978
set_shell_function("{|module_name|}-run", runCmd .. " $@", runCmd)

shpc/main/modules/templates/singularity.tcl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ proc ModulesHelp { } {
4242
# Environment
4343
setenv SINGULARITY_OPTS ""
4444
setenv SINGULARITY_COMMAND_OPTS ""
45-
setenv SINGULARITY_COMMAND_ARGS ""
4645

4746
# Variables
4847

@@ -69,7 +68,7 @@ setenv SINGULARITY_SHELL {{ singularity_shell }}
6968
# interactive shell to any container, plus exec for aliases
7069
set shellCmd "singularity \${SINGULARITY_OPTS} shell \${SINGULARITY_COMMAND_OPTS} -s {{ singularity_shell }} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} ${containerPath}"
7170
set execCmd "singularity \${SINGULARITY_OPTS} exec \${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} "
72-
set runCmd "singularity \${SINGULARITY_OPTS} run \${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} ${containerPath} \${SINGULARITY_COMMAND_ARGS}"
71+
set runCmd "singularity \${SINGULARITY_OPTS} run \${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} ${containerPath}"
7372
set inspectCmd "singularity \${SINGULARITY_OPTS} inspect \${SINGULARITY_COMMAND_OPTS} "
7473

7574
# set_shell_function takes bashStr and cshStr
@@ -82,7 +81,7 @@ set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options }
8281
{% endfor %}{% endif %}
8382

8483
# A customizable exec function
85-
set-alias {|module_name|}-exec "${execCmd} ${containerPath} \${SINGULARITY_COMMAND_ARGS}"
84+
set-alias {|module_name|}-exec "${execCmd} ${containerPath}"
8685

8786
# Always provide a container run
8887
set-alias {|module_name|}-run "${runCmd}"

0 commit comments

Comments
 (0)