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

Re: [HTCondor-users] JobTransform query



Hi Thomas,

How about the following - nice and simple. It uses the four-argument version of userMap(), which
is a default value to use if a mapping is not found. 


use feature:ScheddUserMapFile(prio_map,/etc/condor/maps/prio_map)
use feature:ScheddUserMapFile(vo_map,
/etc/condor/maps/vo_map)
JOB_TRANSFORM_NAMES = $(JOB_TRANSFORM_NAMES) AssignGroup
JOB_TRANSFORM_AssignGroup @=end
  EVALSET RalAcctGroup userMap("prio_map",Owner,"NotThere",userMap("vo_map",foo))
@end


regards,
Todd




On 2/21/2023 6:53 AM, Thomas Birkett - STFC UKRI via HTCondor-users wrote:

Hi all,

 

I hope you are all keeping well. Iâm looking at modernising some of our Job transform processes to help support future token work as well as removing large if statements. Currently we have the following [1] that selects an Accounting Group based on some Regex query. I have attempted to replicate and simplify this config [2] however I get the following error:

 

Parse_config if error: 'HighPrioAcctGroup == "group_HIGHPRIO" is not a valid if condition because complex conditionals are not supported'

 

I have separated the high priority job query and standard job priority query as they are being queried against different ClassAds (Owner and x509UserProxyVOName respectively)

 

I have attempted to also use EVALMACRO however I donât get much success and end up with RalAcctGroup being undefined. Also mapping form my mapfiles [3]

 

Any help would be very gratefully received.

 

 

[1]

RalAcctGroup = ifThenElse(regexp("ttcms048",Owner),         "group_HIGHPRIO", \

               ifThenElse(regexp("pcms060",Owner),          "group_HIGHPRIO", \

               ifThenElse(regexp("cmssgm",Owner),           "group_HIGHPRIO", \

               ifThenElse(regexp("plhcb024",Owner),         "group_HIGHPRIO", \

               ifThenElse(regexp("tatls016",Owner),         "group_HIGHPRIO", \

               ifThenElse(isPreemptable =?= true,           "group_PREEMPTABLE", \

               ifThenElse(x509UserProxyVOName =?= "alice",  "group_ALICE", \

               ifThenElse(x509UserProxyVOName =?= "atlas",  "group_ATLAS", \

               ifThenElse(x509UserProxyVOName =?= "cms",    "group_CMS", \

               ifThenElse(x509UserProxyVOName =?= "lhcb",   "group_LHCB", \

               ifThenElse(x509UserProxyVOName =?= "dteam",  "group_DTEAM_OPS", \

               ifThenElse(x509UserProxyVOName =?= "ops",    "group_DTEAM_OPS", \

               ifThenElse(regexp("nagios",Owner),           "group_OTHER", \

                                                            "group_NONLHC")))))))))))))

 

[2]

SCHEDD_CLASSAD_USER_MAP_NAMES = $(SCHEDD_CLASSAD_USER_MAP_NAMES) HighPrioAccountMap VOAcctGroupMap VOAcctSubGroupMap

CLASSAD_USER_MAPFILE_HighPrioAccountMap = /etc/condor/maps/high_prio_account_map

CLASSAD_USER_MAPFILE_VOAcctGroupMap = /etc/condor/maps/vo_map

CLASSAD_USER_MAPFILE_VOAcctSubGroupMap = /etc/condor/maps/vo_role_map

 

JOB_TRANSFORM_NAMES = $(JOB_TRANSFORM_NAMES) AssignGroup

 

JOB_TRANSFORM_AssignGroup @=end

    NAME AssignGroup

    # If job uses x509 authentication

    IF defined MY.x509UserProxyVOName

        # Start by mapping high priority users

        EVALSET HighPrioAcctGroup usermap("HighPrioAccountMap",Owner)

        IF HighPrioAcctGroup ==       "group_HIGHPRIO"

            SET RalAcctGroup HighPrioAcctGroup

        ELSE

            EVALSET RalAcctGroup usermap("VOAcctGroupMap",x509UserProxyVOName)

        ENDIF

    ENDIF

@end

 

[3]

/etc/condor/maps/high_prio_account_map

# Map data for high priority users

* ttcms048  group_HIGHPRIO

* pcms060   group_HIGHPRIO

* cmssgm    group_HIGHPRIO

* plhcb024  group_HIGHPRIO

* tatls016  group_HIGHPRIO

 

 

/etc/condor/maps/vo_map

# Mapping data for VO group assignment

* alice  group_ALICE

* atlas  group_ATLAS

* cms    group_CMS

* lhcb   group_LHCB

* dteam  group_DTEAM_OPS

* ops    group_DTEAM_OPS

* /.*/   group_NONLHC

 

 

Many thanks,

 

Thomas Birkett

Senior Systems Administrator

Scientific Computing Department  

Science and Technology Facilities Council (STFC)

Rutherford Appleton Laboratory, Chilton, Didcot 
OX11 0QX

 

signature_609518872

 

 


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/


-- 
Todd Tannenbaum <tannenba@xxxxxxxxxxx>  University of Wisconsin-Madison
Center for High Throughput Computing    Department of Computer Sciences
Calendar: https://tinyurl.com/yd55mtgd  1210 W. Dayton St. Rm #4257
Phone: (608) 263-7132                   Madison, WI 53706-1685