[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[HTCondor-users] Singularity version string parsing - 2.6 vs 3.2



The 3.2 version of Singularity from EPEL shows its “—version” string as “singularity version 3.2.1-1.el7” as distinct from the “2.6.0-dist” version:

 

$ condor_status -af SingularityVersion

singularity version 3.2.1-1.el7

2.6.0-dist

undefined

 

If you are applying requirements for SingularityVersion, you need an _expression_ that’s able to parse both versions, like so:

 

$ condor_status -af 'regexps("\D*([\d].*-.+)", SingularityVersion, "\1")'

3.2.1-1.el7

2.6.0-dist

undefined

2.6.0-dist

2.6.0-dist

2.6.0-dist

undefined

 

Handing off this string to “int()” will give you the major release as a numeric value that can be compared mathematically in a requirements _expression_:

 

Requirements = (int(regexps("\D*([\d].*-.+)", SingularityVersion, "\1")) >= 3)

 

This will match any machine having Singularity version 3.0 and up.

 

The “real()” function will give you the major and minor release as a real number, but wouldn’t necessarily work as expected in comparisons since in release numbers, but not in math, 3.10.0 is greater than 3.9.0

 

Michael V. Pelletier
Information Technology
Digital Transformation & Innovation
Integrated Defense Systems
Raytheon Company

michael.v.pelletier@xxxxxxxxxxxx
+1 339-293-9149   (cell)


366 Lowell Street

Andover, MA 01810 USA
www.raytheon.com

Follow Raytheon on
YouTube Facebook LinkedIn Instagram 

Raytheon Sustainability

This message contains information that may be confidential and privileged. Unless you are the addressee (or authorized to receive mail for the addressee), you should not use, copy or disclose to anyone this message or any information contained in this message. If you have received this message in error, please so advise the sender by reply e-mail and delete this message. Thank you for your cooperation.