Project

General

Profile

Bug #24953

Use quote option when advertizing GWMS_SINGULARITY_PATH in singularity_setup.sh

Added by Marco Mascheroni about 1 month ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Start date:
09/11/2020
Due date:
% Done:

0%

Estimated time:
First Occurred:
Occurs In:
Stakeholders:
Duration:

Description

Since 3.6.3 the GWMS_SINGULARITY_PATH attribute is not present in the .machine condor classad file. Either these are failing:

https://github.com/glideinWMS/glideinwms/blob/master/creation/web_base/singularity_setup.sh#L289-L290

or they are putting something condor does not eventually like in condor.vars

I went through all the "six stages of debugging" (you should google for that if you don't know what I am talking about, that's a fun meme), turned out that just using the quote flag when advertizing the classads is fixing things (i.e.: using "S" instead of "C"). I am however at the "How did that ever work" stage, now.

With the 3.6.2 factory "C" was still working, Marco Mambelli, do you know why it stopped working in 3.6.3?

History

#1 Updated by Marco Mascheroni about 1 month ago

Fix in v36/24953

#2 Updated by Marco Mambelli about 1 month ago

I just changed that upon suggestion of TJ and to make the var abailable for Edgar that is using these variables to make condor invoke singularity.

git: 391c6094de654dbf262e8b1d3ecd5f8beb364dcf
Fri Aug 14 2020 12:00:01 GMT-0500 (CDT)

Changing singularity paths to be condor expressions. TJ from HTCondor recommended not to quote file paths in condor configuration or classads

#3 Updated by Marco Mambelli about 1 month ago

  • Assignee changed from Marco Mambelli to Marco Mascheroni
  • Status changed from Feedback to Resolved

Merged.

The error visible in the condor log and preventing the startd from starting was:

CONFIGURATION PROBLEM: Failed to insert ClassAd attribute SINGULARITY_PATH = /cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity.  The most common reason for this is that you forgot to quote a string value in the list of attributes being added to the STARTD ad.

For completeness here I'm adding the email thread that recommended to "unquote" the paths in the HTCondor configuration.
It seems it is better to keep the quotes and use $F() when needed.

Re: [HTCondor-users] Are file paths in the config macros strings or expressions?

Thanks TJ, 
that helped moving forward but now the startd seems to want some quotes.

This was reported by Edgar after using 
SINGULARITY_PATH = "/my path that can have spaces/singularity" 
SINGULARITY = $F(SINGULARITY_PATH)

08/05/20 06:41:26 (pid:13786) slot1: Changing state and activity: Claimed/Idle -> Preempting/Vacating
08/05/20 06:41:26 (pid:13786) slot1: State change: No preempting claim, returning to owner
08/05/20 06:41:26 (pid:13786) CONFIGURATION PROBLEM: Failed to insert ClassAd attribute SINGULARITY = /cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity.  The most common reason for this is that you forgot to quote a string value in the list of attributes being added to the STARTD ad.
08/05/20 06:41:26 (pid:13786) slot1: CONFIGURATION PROBLEM: Failed to insert ClassAd attribute SINGULARITY = /cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity.  The most common reason for this is that you forgot to quote a string value in the list of attributes being added to the slot1 ad.
08/05/20 06:41:26 (pid:13786) slot1: Changing state and activity: Preempting/Vacating -> Owner/Idle
08/05/20 06:41:26 (pid:13786) slot1: State change: IS_OWNER is false

Is SINGULARITY something special?
Should we add back the quotes in some other way?

Thanks,
Marco

On Aug 5, 2020, at 9:06 AM, John M Knoeller <johnkn@cs.wisc.edu> wrote:

In HTCondor config files, you would leave the path unquoted.    The config parser will remove leading and trailing whitespace from values, but it will not remove internal spaces or change any other character 

If you have a config value that is quoted and you want to remove the quotes,  the $F() macro expansion will do that

 SINGULARITY_PATH = "/my path that can have spaces/singularity" 
 SINGLULARITY = $F(SINGULARITY_PATH)

In the above configuration fragment SINGULARITY_PATH is quoted, but SINGULARITY is not. 

-tj

-----Original Message-----
From: HTCondor-users <htcondor-users-bounces@cs.wisc.edu> On Behalf Of Marco Mambelli
Sent: Tuesday, August 4, 2020 10:40 PM
To: HTCondor-Users Mail List <htcondor-users@cs.wisc.edu>
Cc: Edgar Fajardo <emfajard@ucsd.edu>
Subject: [HTCondor-users] Are file paths in the config macros strings or expressions?

Greetings,
I'm not sure what is the correct way to handle file paths (e.g. the one to the singularity binary) in the condor config macros
Should they be strings (quoted) or expressions (left unquoted)?

In a specific case I have a variable, SINGULARITY_PATH that contains the path to the singularity binary.
So I'd like to define SINGULARITY using that variable:
SINGULARITY = $(SINGULARITY_PATH)

Should it be:
SINGULARITY_PATH = "/my path that can have spaces/singularity" 
or
SINGULARITY_PATH = /my path that can have spaces/singularity
?

It seems that the quotes are causing problems, are interpreted literally:
'"/cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity" --version' did not exit successfully (code 11018); the first line of output was ''

But I'm not sure the path w/o quotes would be protected against corner cases in the file path (spaces, unusual characters)

Any advice?

Thanks,
Marco

#4 Updated by Marco Mambelli about 1 month ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF