Skip to content

Commit 898bd1c

Browse files
authored
Merge pull request #425 from singularityhub/fix/bug-with-envars-tcl
Fixing bug that envars need to be escaped for tcl
2 parents 060fe7a + 78c9f2a commit 898bd1c

File tree

10 files changed

+12
-11
lines changed

10 files changed

+12
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.scom/singularityhub/singularity-hpc/tree/master) (0.0.x)
17+
- Fixing bug with using variables in recipe options (0.0.31)
1718
- Removing un-used defaults and lmod_base (0.0.30)
1819
- Allow environment variables in settings (0.0.29)
1920
- User settings file creation and use with shpc config inituser

registry/jupyter/datascience-notebook/container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ tags:
1010
aliases:
1111
- name: run-notebook
1212
command: jupyter notebook --no-browser --port=$(shuf -i 2000-65000 -n 1) --ip 0.0.0.0
13-
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local
13+
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local --bind $(mktemp -d):/run/user

registry/jupyter/minimal-notebook/container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ tags:
1010
aliases:
1111
- name: run-notebook
1212
command: jupyter notebook --no-browser --port=$(shuf -i 2000-65000 -n 1) --ip 0.0.0.0
13-
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local
13+
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local --bind $(mktemp -d):/run/user

registry/jupyter/pyspark-notebook/container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ tags:
1010
aliases:
1111
- name: run-notebook
1212
command: jupyter notebook --no-browser --port=$(shuf -i 2000-65000 -n 1) --ip 0.0.0.0
13-
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local
13+
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local --bind $(mktemp -d):/run/user

registry/jupyter/r-notebook/container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ tags:
1010
aliases:
1111
- name: run-notebook
1212
command: jupyter notebook --no-browser --port=$(shuf -i 2000-65000 -n 1) --ip 0.0.0.0
13-
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local
13+
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local --bind $(mktemp -d):/run/user

registry/jupyter/scipy-notebook/container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ tags:
1010
aliases:
1111
- name: run-notebook
1212
command: jupyter notebook --no-browser --port=$(shuf -i 2000-65000 -n 1) --ip 0.0.0.0
13-
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local
13+
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local --bind $(mktemp -d):/run/user

registry/jupyter/tensorflow-notebook/container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ filter:
1212
aliases:
1313
- name: run-notebook
1414
command: jupyter notebook --no-browser --port=$(shuf -i 2000-65000 -n 1) --ip 0.0.0.0
15-
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local
15+
options: --home ${HOME} --bind ${HOME}/.local:/home/joyvan/.local --bind $(mktemp -d):/run/user

shpc/main/modules/templates/docker.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ proc ModulesHelp { } {
2323
puts stderr " - {|module_name|}-inspect:"
2424
puts stderr " {{ command }} inspect <container>"
2525
{% if aliases %}{% for alias in aliases %} puts stderr " - {{ alias.name }}:"
26-
puts stderr " {{ command }} run -i{% if tty %}t{% endif %} --rm -u `id -u`:`id -g` --entrypoint {{ alias.entrypoint }} {% if envfile %}--envfile {{ module_dir }}/{{ envfile }} {% endif %}{% if bindpaths %}-v {{ bindpaths }} {% endif %}{% if alias.options %}{{ alias.options }} {% endif %} -v . -w . <container> {{ alias.args }}"
26+
puts stderr " {{ command }} run -i{% if tty %}t{% endif %} --rm -u `id -u`:`id -g` --entrypoint {{ alias.entrypoint | replace("$", "\$") }} {% if envfile %}--envfile {{ module_dir }}/{{ envfile }} {% endif %}{% if bindpaths %}-v {{ bindpaths }} {% endif %}{% if alias.options %}{{ alias.options | replace("$", "\$") }} {% endif %} -v . -w . <container> {{ alias.args | replace("$", "\$") }}"
2727
{% endfor %}{% endif %}
2828

2929
puts stderr "For each of the above, you can export:"
@@ -68,7 +68,7 @@ set-alias {|module_name|}-shell "${shellCmd}"
6868

6969
# exec functions to provide "alias" to module commands
7070
{% if aliases %}{% for alias in aliases %}
71-
set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options }} {% endif %} --entrypoint {{ alias.entrypoint }} ${containerPath} {{ alias.args }}"
71+
set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options | replace("$", "\$") }} {% endif %} --entrypoint {{ alias.entrypoint | replace("$", "\$") }} ${containerPath} {{ alias.args | replace("$", "\$") }}"
7272
{% endfor %}{% endif %}
7373

7474
# A customizable exec function

shpc/main/modules/templates/singularity.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ proc ModulesHelp { } {
2929
puts stderr " singularity inspect -d <container>"
3030
puts stderr ""
3131
{% if aliases %}{% for alias in aliases %} puts stderr " - {{ alias.name }}:"
32-
puts stderr " singularity exec {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}{% if alias.options %}{{ alias.options }} {% endif %}<container> {{ alias.command }}"
32+
puts stderr " singularity exec {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}{% if alias.options %}{{ alias.options | replace("$", "\$") }} {% endif %}<container> {{ alias.command | replace("$", "\$") }}"
3333
{% endfor %}{% else %} puts stderr " - {|module_name|}: singularity run {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %}<container>"{% endif %}
3434
puts stderr ""
3535
puts stderr "For each of the above, you can export:"
@@ -77,7 +77,7 @@ set-alias {|module_name|}-shell "${shellCmd}"
7777

7878
# exec functions to provide "alias" to module commands
7979
{% if aliases %}{% for alias in aliases %}
80-
set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options }} {% endif %} ${containerPath} {{ alias.command }}"
80+
set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options | replace("$", "\$") }} {% endif %} ${containerPath} {{ alias.command | replace("$", "\$") }}"
8181
{% endfor %}{% endif %}
8282

8383
# A customizable exec function

shpc/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright 2021, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

5-
__version__ = "0.0.30"
5+
__version__ = "0.0.31"
66
AUTHOR = "Vanessa Sochat"
77
NAME = "singularity-hpc"
88
PACKAGE_URL = "https://github.com/singularityhub/singularity-hpc"

0 commit comments

Comments
 (0)