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

Re: [HTCondor-users] Command output in system_startd_job_attrs - possible?



On 4/17/2018 12:47 PM, Michael Pelletier wrote:
Due to decades of legacy email cruft, $(Owner)@raytheon.com as the e-mail address doesn’t usually work. With the help of a colleague, I cooked up a little program to query the directory service to get a user’s e-mail based on their username and display it as a “notify_user” line in the submit description like so:

 

Include command : /usr/libexec/condor/get_notify_user $ENV{LOGNAME}

 

It generates:

 

Notify_user = Michael.V.Pelletier@xxxxxxxxxxxx

 

Is there some way to do this in a ClassAd _expression_ in the configuration so that this can be added to the SYSTEM_STARTD_JOB_ATTRS to plug it in to the job automatically for the users? I’ve looked multiple times over the years, but I feel like I might be just missing a trick somehow.


This reminds me a bit how we add default accounting group for our users:

use FEATURE:ScheddUsermapFile(AcctGroupFarmUsers, /etc/condor/map.acctgroups)
AcctGroupFarm =  strcat("group_", userMap("AcctGroupFarmUsers", Owner, undefined), ".user")
JOB_TRANSFORM_NAMES = $(JOB_TRANSFORM_NAMES) SetAccountingGroup
JOB_TRANSFORM_SetAccountingGroup @=end
[
   Requirements = AccountingGroup is undefined || x509UserProxyVOName isnt undefined;
   eval_set_AcctGroup = AcctGroup isnt undefined ? AcctGroup : $(AcctGroupFarm);
   eval_set_AcctGroupUser = AcctGroupUser isnt undefined ? AcctGroupUser : Owner;
   eval_set_AccountingGroup = strcat(AcctGroup isnt undefined ? AcctGroup : $(AcctGroupFarm), ".", AcctGroupUser isnt undefined ? AcctGroupUser : Owner);
]
@end

where /etc/condor/map.acctgroups contains

* atlas001 atlas
* alice001 alice
* user1 atlas
* user2 alice
# ...

(in our real configuration AcctGroupFarm is much more complex _expression_ and take into account e.g. VO)


This could be also achieved with custom (python) function, but I decided it will be easier to maintain HTCondor configuration without any external function.


Petr Vokac