From c400698737f57541731b55cbfb21b63724a06b16 Mon Sep 17 00:00:00 2001 From: Sergey Serebryakov Date: Tue, 1 Aug 2023 22:44:19 -0700 Subject: [PATCH] Correct version parsing for singularity-ce. (#326) Community edition of singularity starting version 3.8.0 (https://github.com/sylabs/singularity/releases?page=4) changes its name to `singularity-ce`. This commit adds support for version strings that looks like `singularity-ce version 3.10.0`. --- .../mlcube_singularity/singularity_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runners/mlcube_singularity/mlcube_singularity/singularity_client.py b/runners/mlcube_singularity/mlcube_singularity/singularity_client.py index 40ce13d..4f141d4 100644 --- a/runners/mlcube_singularity/mlcube_singularity/singularity_client.py +++ b/runners/mlcube_singularity/mlcube_singularity/singularity_client.py @@ -142,6 +142,11 @@ def init(self, force: bool = False) -> None: Runtime.SINGULARITY, version_string[20:].strip(), ) + elif version_string.startswith("singularity-ce version "): + runtime, version_string = ( + Runtime.SINGULARITY, + version_string[23:].strip(), + ) elif version_string.startswith("apptainer version "): runtime, version_string = Runtime.APPTAINER, version_string[18:].strip() elif "/" in version_string: # Handle old stuff like "x.y.z-pull/123-0a5d"