Skip to content

Commit 5e2b88a

Browse files
committed
adding back PODMAN_OPTS and restoring conflict of alias.name to tcl
Signed-off-by: vsoch <[email protected]>
1 parent e94498f commit 5e2b88a

File tree

6 files changed

+23
-21
lines changed

6 files changed

+23
-21
lines changed

shpc/main/modules/templates/docker.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,31 @@ Commands include:
3030
3131
For each of the above, you can export:
3232
33-
- DOCKER_OPTS: to define custom options for {{ command }}
34-
- DOCKER_COMMAND_OPTS: to define custom options for the command
33+
- PODMAN_OPTS: to define custom options for {{ command }}
34+
- PODMAN_COMMAND_OPTS: to define custom options for the command
3535
]])
3636

3737
{% if podman_module %}load("{{ podman_module }}"){% endif %}
38-
setenv ("DOCKER_OPTS", "")
39-
setenv ("DOCKER_COMMAND_OPTS", "")
38+
setenv ("PODMAN_OPTS", "")
39+
setenv ("PODMAN_COMMAND_OPTS", "")
4040

4141
-- we probably don't need this
4242
local MODULEPATH="{{ module_dir }}"
4343

4444
-- interactive shell to any container, plus exec for aliases
4545
local containerPath = '{{ image }}'
4646

47-
local shellCmd = "{{ command }} ${DOCKER_OPTS} run -i{% if tty %}t{% endif %} ${DOCKER_COMMAND_OPTS} -u `id -u`:`id -g` --rm --entrypoint {{ shell }} {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v ${PWD} -w ${PWD} " .. containerPath
47+
local shellCmd = "{{ command }} ${PODMAN_OPTS} run -i{% if tty %}t{% endif %} ${PODMAN_COMMAND_OPTS} -u `id -u`:`id -g` --rm --entrypoint {{ shell }} {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v ${PWD} -w ${PWD} " .. containerPath
4848
-- execCmd needs entrypoint to be the executor
49-
local execCmd = "{{ command }} ${DOCKER_OPTS} run ${DOCKER_COMMAND_OPTS} -i{% if tty %}t{% endif %} -u `id -u`:`id -g` --rm {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v ${PWD} -w ${PWD} "
50-
local runCmd = "{{ command }} ${DOCKER_OPTS} run ${DOCKER_COMMAND_OPTS} -i{% if tty %}t{% endif %} -u `id -u`:`id -g` --rm {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v ${PWD} -w ${PWD} " .. containerPath
51-
local inspectCmd = "{{ command }} ${DOCKER_OPTS} inspect ${DOCKER_COMMAND_OPTS} " .. containerPath
49+
local execCmd = "{{ command }} ${PODMAN_OPTS} run ${PODMAN_COMMAND_OPTS} -i{% if tty %}t{% endif %} -u `id -u`:`id -g` --rm {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v ${PWD} -w ${PWD} "
50+
local runCmd = "{{ command }} ${PODMAN_OPTS} run ${PODMAN_COMMAND_OPTS} -i{% if tty %}t{% endif %} -u `id -u`:`id -g` --rm {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v ${PWD} -w ${PWD} " .. containerPath
51+
local inspectCmd = "{{ command }} ${PODMAN_OPTS} inspect ${PODMAN_COMMAND_OPTS} " .. containerPath
5252

5353
-- set_shell_function takes bashStr and cshStr
5454
set_shell_function("{|module_name|}-shell", shellCmd, shellCmd)
5555

5656
-- conflict with modules with the same name
57-
conflict(myModuleName(){% if aliases %}{% for alias in aliases %},"{{ alias.name }}"{% endfor %}{% endif %})
57+
conflict(myModuleName(){% if aliases %}{% for alias in aliases %}{% if alias.name != name %},"{{ alias.name }}"{% endif %}{% endfor %}{% endif %})
5858

5959
-- exec functions to provide "alias" to module commands
6060
{% if aliases %}{% for alias in aliases %}

shpc/main/modules/templates/docker.tcl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ proc ModulesHelp { } {
2727
{% endfor %}{% endif %}
2828

2929
puts stderr "For each of the above, you can export:"
30-
puts stderr " - DOCKER_OPTS: to define custom options for {{ command }}"
31-
puts stderr " - DOCKER_COMMAND_OPTS: to define custom options for the command"
30+
puts stderr " - PODMAN_OPTS: to define custom options for {{ command }}"
31+
puts stderr " - PODMAN_COMMAND_OPTS: to define custom options for the command"
3232

3333
}
3434

3535
# Environment
36-
setenv DOCKER_OPTS ""
37-
setenv DOCKER_COMMAND_OPTS ""
36+
setenv PODMAN_OPTS ""
37+
setenv PODMAN_COMMAND_OPTS ""
3838

3939
# Variables
4040

@@ -51,16 +51,17 @@ set helpcommand "This module is a {{ docker }} container wrapper for {{ name }}
5151
{% endfor %}{% endif %}
5252

5353
# conflict with modules with the same alias name
54+
conflict {{ name }}
5455
{% if aliases %}{% for alias in aliases %}{% if alias.name != name %}conflict {{ alias.name }}{% endif %}
5556
{% endfor %}{% endif %}
5657

5758
# interactive shell to any container, plus exec for aliases
58-
set shellCmd "{{ command }} \${DOCKER_OPTS} run \${DOCKER_COMMAND_OPTS} -u `id -u`:`id -g` --rm -i{% if tty %}t{% endif %} --entrypoint {{ shell }} {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v $workdir -w $workdir ${containerPath}"
59+
set shellCmd "{{ command }} \${PODMAN_OPTS} run \${PODMAN_COMMAND_OPTS} -u `id -u`:`id -g` --rm -i{% if tty %}t{% endif %} --entrypoint {{ shell }} {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v $workdir -w $workdir ${containerPath}"
5960

6061
# execCmd needs entrypoint to be the executor
61-
set execCmd "{{ command }} \${DOCKER_OPTS} run -i{% if tty %}t{% endif %} \${DOCKER_COMMAND_OPTS} -u `id -u`:`id -g` --rm {% if envfile %} --env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} -v $workdir -w $workdir {% endif %} "
62-
set runCmd "{{ command }} \${DOCKER_OPTS} run -i{% if tty %}t{% endif %} \${DOCKER_COMMAND_OPTS} -u `id -u`:`id -g` --rm {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v $workdir -w $workdir ${containerPath}"
63-
set inspectCmd "{{ command }} \${DOCKER_OPTS} inspect ${containerPath}"
62+
set execCmd "{{ command }} \${PODMAN_OPTS} run -i{% if tty %}t{% endif %} \${PODMAN_COMMAND_OPTS} -u `id -u`:`id -g` --rm {% if envfile %} --env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} -v $workdir -w $workdir {% endif %} "
63+
set runCmd "{{ command }} \${PODMAN_OPTS} run -i{% if tty %}t{% endif %} \${PODMAN_COMMAND_OPTS} -u `id -u`:`id -g` --rm {% if envfile %}--env-file {{ module_dir }}/{{ envfile }}{% endif %} {% if bindpaths %}-v {{ bindpaths }} {% endif %} -v $workdir -w $workdir ${containerPath}"
64+
set inspectCmd "{{ command }} \${PODMAN_OPTS} inspect ${containerPath}"
6465

6566
# set_shell_function takes bashStr and cshStr
6667
set-alias {|module_name|}-shell "${shellCmd}"

shpc/main/modules/templates/docs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ inspect aliases. For anycommands above, you can export:
122122
123123
- SINGULARITY_OPTS: to define custom options for singularity (e.g., --debug)
124124
- SINGULARITY_COMMAND_OPTS: to define custom options for the command (e.g., -b)
125-
- DOCKER_OPTS: to define custom options for podman or docker
126-
- DOCKER_COMMAND_OPTS: to define custom options for the command
125+
- PODMAN_OPTS: to define custom options for podman or docker
126+
- PODMAN_COMMAND_OPTS: to define custom options for the command
127127
128128
<br>
129129

shpc/main/modules/templates/singularity.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ local inspectCmd = "singularity ${SINGULARITY_OPTS} inspect ${SINGULARITY_COMMAN
5858
set_shell_function("{|module_name|}-shell", shellCmd, shellCmd)
5959

6060
-- conflict with modules with the same name
61-
conflict(myModuleName(){% if aliases %}{% for alias in aliases %},"{{ alias.name }}"{% endfor %}{% endif %})
61+
conflict(myModuleName(){% if aliases %}{% for alias in aliases %}{% if alias.name != name %},"{{ alias.name }}"{% endif %}{% endfor %}{% endif %})
6262

6363
-- exec functions to provide "alias" to module commands
6464
{% if aliases %}{% for alias in aliases %}

shpc/main/modules/templates/singularity.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ set helpcommand "This module is a singularity container wrapper for {{ name }} v
5757
{% endfor %}{% endif %}
5858

5959
# conflict with modules with the same alias name
60+
conflict {{ name }}
6061
{% if aliases %}{% for alias in aliases %}{% if alias != name %}conflict {{ alias.name }}{% endif %}
6162
{% endfor %}{% endif %}
6263

shpc/settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ registry: $root_dir/registry
2121
module_base: $root_dir/modules
2222

2323
# Format string for module commands exec,run,shell (not aliases) (can also include:
24-
# {{registry}} , {{ namespace }}, {{tool}}, {{version}}
24+
# {{registry}} , {{ repository }}, {{tool}}, {{version}}
2525
# This is where you might add a prefix to your module names, if desired.
2626
module_name: '{{ tool }}'
2727

0 commit comments

Comments
 (0)