Skip to content

Commit 9bce124

Browse files
authored
bugfix for singularity pull (repeated output) and wrapper scripts template (#506)
* bugfix for singularity pull (repeated output) and wrapper scripts template check Signed-off-by: vsoch <[email protected]>
1 parent fc4f684 commit 9bce124

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
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.com/singularityhub/singularity-hpc/tree/main) (0.0.x)
17+
- fixing but with stream command repeating output (0.0.46)
1718
- Adding support for wrapper scripts for global and container.yaml (0.0.45)
1819
- Lua and tcl module file bug fixes for shell functions and aliases (0.0.44)
1920
- restoring -B for Singularity bindpaths over using envar

shpc/main/container/singularity.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,12 @@ def _pull_regular(self, uri, dest):
310310
"""
311311
pull_folder = os.path.dirname(dest)
312312
name = os.path.basename(dest)
313-
return self.client.pull(uri, name=name, pull_folder=pull_folder)
313+
image, lines = self.client.pull(
314+
uri, name=name, pull_folder=pull_folder, stream=True
315+
)
316+
for line in lines:
317+
print(line, end="")
318+
return image
314319

315320
def inspect(self, image):
316321
"""

shpc/main/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ def parse_null(self, value):
195195
"""
196196
if isinstance(value, str) and value.lower() in ["none", "null"]:
197197
return None
198+
199+
# Ensure we strip strings
200+
if isinstance(value, str):
201+
value = value.strip()
198202
return value
199203

200204
def set(self, key, value):

shpc/main/wrappers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def load_template(self):
9191
template_paths = [os.path.dirname(template_file), templates]
9292

9393
# Do we have a custom template path directory?
94-
if "templates" in self.settings.wrapper_scripts:
94+
if self.settings.wrapper_scripts.get("templates"):
9595
path = self.settings.wrapper_scripts["templates"]
9696
if not os.path.exists(path):
9797
logger.exit(

shpc/settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ wrapper_scripts:
6969
podman: docker.sh
7070

7171
# use for singularity aliases (set to null to disable)
72-
singularity: singularity.sh
72+
singularity: singularity.sh
7373

7474
# Add an extra custom template directory (searched first)
7575
templates: null
7676

7777
# the module namespace you want to install from. E.g., if you have ghcr.io/autamus/clingo
7878
# and you set the namespace to ghcr.io/autamus, you can just do: shpc install clingo.
79-
namespace:
79+
namespace: null
8080

8181
# THe name of the environment file to bind to the container.
8282
# This determines order of load

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-2022, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

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

0 commit comments

Comments
 (0)