Project

General

Profile

Feature #22875

Advertise if a Glidein can use privileged or unprivileged Singularity

Added by Marco Mambelli about 1 month ago. Updated 7 days ago.

Status:
New
Priority:
High
Category:
-
Target version:
Start date:
07/09/2019
Due date:
% Done:

0%

Estimated time:
Stakeholders:
Duration:

Description

The Glidein is advertising if it can use Singularity: if the VO (Frontend/group) is OK, if the Factory/entry are OK, if the binary and default image are available and additional tests passed.
This is advertised with the HAS_SINGULARITY attribute (NOTE: HTCondor uses the different HASSINGULARITY, no underscore).
The tests should check also if Singularity is used in privileged or unprivileged mode and advertise that.

History

#1 Updated by Marco Mambelli 7 days ago

  • Target version changed from v3_5_1 to v3_4_7

SINGULARITY_AVAILABLE {NO, PRIVILEGED, UNPRIVILEGED}

This is testing for singularity in singularity_lib

function singularity_is_inside {
    # Return true (0) if in Singularity false (1) otherwise
    # In Singularity SINGULARITY_NAME and SINGULARITY_CONTAINER are defined
    # In the default GWMS wrapper GWMS_SINGULARITY_REEXEC=1
    # The process 1 in singularity is called init-shim (v>=2.6), not init
    # If the parent is 1 and is not init (very likely - on most Unix 1 is init)
    [[ -n "$SINGULARITY_NAME" ]] && { true; return; }
    [[ -n "$GWMS_SINGULARITY_REEXEC" ]] && { true; return; }
    [[ "x`ps -p1 -ocomm=`" = "xshim-init" ]] && { true; return; }
    [[ "x$PPID" = x1 ]] && [[ "x`ps -p1 -ocomm=`" != "xinit" ]] && { true; return; }
    false
    return
}



Also available in: Atom PDF