Skip to content

Commit fbcfa1e

Browse files
authored
Added an option to define the path of the singularity executable (#689)
* Added an option to configure the path to singularity directly * Bumped the version number and updated the changelog
1 parent 1f3a318 commit fbcfa1e

File tree

10 files changed

+16
-6
lines changed

10 files changed

+16
-6
lines changed

CHANGELOG.md

+1
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.com/singularityhub/singularity-hpc/tree/main) (0.0.x)
17+
- Added an option (`singularity_path`) to control the path to the Singularity executable (0.1.31)
1718
- Fix `module-info shell` Tcl test for Lmod<=8.7.55 (0.1.30)
1819
- Allow import of LooseVersion from packaging (bug) (0.1.29)
1920
- use quay.io api to list tags since does not conform to oci (0.1.28)

docs/getting_started/user-guide.rst

+5
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ variable replacement. A summary table of variables is included below, and then f
203203
* - singularity_module
204204
- if defined, add to module script to load this Singularity module first
205205
- null
206+
* - podman_module
207+
- if defined, add to module script to load this Podman module first
208+
- null
209+
* - singularity_path
210+
- path to (or name of) the `singularity` executable to use in wrapper scripts. Can be used instead of / with `singularity_module`
206211
* - module_name
207212
- Format string for module commands exec,shell,run (not aliases) can include ``{{ registry }}``, ``{{ repository }}``, ``{{ tool }}`` and ``{{ version }}``
208213
- ``'{{ tool }}'``

shpc/main/schemas.py

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
"namespace": {"type": ["string", "null"]},
144144
"singularity_module": {"type": ["string", "null"]},
145145
"podman_module": {"type": ["string", "null"]},
146+
"singularity_path": {"type": ["string"]},
146147
"bindpaths": {"type": ["string", "null"]},
147148
"updated_at": {"type": "string"},
148149
"module_name": {"type": "string"},
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{% extends "bases/shell-script-base.sh" %}
22

3-
{% block content %}singularity ${SINGULARITY_OPTS} exec ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home }} --home {{ features.home }} {% endif %}{% if features.x11 %}-B {{ features.x11 }} {% endif %}{% if settings.environment_file %}-B $wrapperDir/{{ settings.environment_file }}:/.singularity.d/env/{{ settings.environment_file }}{% endif %} {% if settings.bindpaths %}-B {{ settings.bindpaths }}{% endif %} {% if alias.singularity_options %} {{ alias.singularity_options }} {% endif %} {{ image }} {% if '/sh' in settings.wrapper_shell or '/bash' in settings.wrapper_shell %}"$@"{% elif '/csh' in settings.wrapper_shell %}$argv:q{% endif %}
3+
{% block content %}{{ settings.singularity_path }} ${SINGULARITY_OPTS} exec ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home }} --home {{ features.home }} {% endif %}{% if features.x11 %}-B {{ features.x11 }} {% endif %}{% if settings.environment_file %}-B $wrapperDir/{{ settings.environment_file }}:/.singularity.d/env/{{ settings.environment_file }}{% endif %} {% if settings.bindpaths %}-B {{ settings.bindpaths }}{% endif %} {% if alias.singularity_options %} {{ alias.singularity_options }} {% endif %} {{ image }} {% if '/sh' in settings.wrapper_shell or '/bash' in settings.wrapper_shell %}"$@"{% elif '/csh' in settings.wrapper_shell %}$argv:q{% endif %}
44
{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{% extends "bases/shell-script-base.sh" %}
22

3-
{% block content %}singularity ${SINGULARITY_OPTS} inspect ${SINGULARITY_COMMAND_OPTS} -d {{ image }}{% endblock %}
3+
{% block content %}{{ settings.singularity_path }} ${SINGULARITY_OPTS} inspect ${SINGULARITY_COMMAND_OPTS} -d {{ image }}{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{% extends "bases/shell-script-base.sh" %}
22

3-
{% block content %}singularity ${SINGULARITY_OPTS} inspect ${SINGULARITY_COMMAND_OPTS} -r {{ image }}{% endblock %}
3+
{% block content %}{{ settings.singularity_path }} ${SINGULARITY_OPTS} inspect ${SINGULARITY_COMMAND_OPTS} -r {{ image }}{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{% extends "bases/shell-script-base.sh" %}
22

3-
{% block content %}singularity ${SINGULARITY_OPTS} run ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home }} --home {{ features.home }} {% endif %}{% if features.x11 %}-B {{ features.x11 }} {% endif %}{% if settings.environment_file %}-B $wrapperDir/{{ settings.environment_file }}:/.singularity.d/env/{{ settings.environment_file }}{% endif %} {% if settings.bindpaths %}-B {{ settings.bindpaths }}{% endif %} {% if alias.singularity_options %} {{ alias.singularity_options }} {% endif %} {{ image }} {% if '/sh' in settings.wrapper_shell or '/bash' in settings.wrapper_shell %}"$@"{% elif '/csh' in settings.wrapper_shell %}$argv:q{% endif %}
3+
{% block content %}{{ settings.singularity_path }} ${SINGULARITY_OPTS} run ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home }} --home {{ features.home }} {% endif %}{% if features.x11 %}-B {{ features.x11 }} {% endif %}{% if settings.environment_file %}-B $wrapperDir/{{ settings.environment_file }}:/.singularity.d/env/{{ settings.environment_file }}{% endif %} {% if settings.bindpaths %}-B {{ settings.bindpaths }}{% endif %} {% if alias.singularity_options %} {{ alias.singularity_options }} {% endif %} {{ image }} {% if '/sh' in settings.wrapper_shell or '/bash' in settings.wrapper_shell %}"$@"{% elif '/csh' in settings.wrapper_shell %}$argv:q{% endif %}
44
{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{% extends "bases/shell-script-base.sh" %}
22

3-
{% block content %}singularity ${SINGULARITY_OPTS} shell ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home }} --home {{ features.home }} {% endif %}{% if features.x11 %}-B {{ features.x11 }} {% endif %}{% if settings.environment_file %}-B $wrapperDir/{{ settings.environment_file }}:/.singularity.d/env/{{ settings.environment_file }}{% endif %} {% if settings.bindpaths %}-B {{ settings.bindpaths }}{% endif %} -s {{ settings.wrapper_shell }} {{ image }}
3+
{% block content %}{{ settings.singularity_path }} ${SINGULARITY_OPTS} shell ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home }} --home {{ features.home }} {% endif %}{% if features.x11 %}-B {{ features.x11 }} {% endif %}{% if settings.environment_file %}-B $wrapperDir/{{ settings.environment_file }}:/.singularity.d/env/{{ settings.environment_file }}{% endif %} {% if settings.bindpaths %}-B {{ settings.bindpaths }}{% endif %} -s {{ settings.wrapper_shell }} {{ image }}
44
{% endblock %}

shpc/settings.yml

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ default_view:
5757
singularity_module:
5858
podman_module:
5959

60+
# Path to (or name of) the singularity executable to use in wrapper scripts. Can be used instead of / with singularity_module
61+
singularity_path: singularity
62+
6063
# string with comma separated list of paths to binds. If set, expored to SINGULARITY_BINDPATH
6164
bindpaths:
6265

shpc/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

5-
__version__ = "0.1.30"
5+
__version__ = "0.1.31"
66
AUTHOR = "Vanessa Sochat"
77
88
NAME = "singularity-hpc"

0 commit comments

Comments
 (0)