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

Re: [HTCondor-users] update node's master ClassAds through Python bindings?



Hi Iain,

I found it!
I had lazily copied&pasted the attribute rules from the admin to the
owner and did not properly replaced all the occurrences... :-/

With a proper config [1] everything is working as expected [2].

afais, changes via to the bindings' RemoteParam are not immediately
propagated but would need a reconfig, or?

Sorry for the noise,
  Thomas


[1]
MASTER.SETTABLE_ATTRS_ADMINISTRATOR =
$(MASTER.SETTABLE_ATTRS_ADMINISTRATOR), ..., TEST_HOST_ON
MASTER.SETTABLE_ATTRS_OWNER = $(MASTER.SETTABLE_ATTRS_OWNER), ...,
TEST_HOST_ON

[2]
>>> batch0930_master = collector.locate(htcondor.DaemonTypes.Master,
"batch0930.desy.de")
>>> htcondor.RemoteParam(batch0930_master)['TEST_HOST_STATUS'] =
"python_batch0930"

> condor_config_val -name batch0930.desy.de -master TEST_HOST_STATUS
python_batch0930

On 2016-08-15 18:47, Iain Bradford Steers wrote:
> Hi Thomas,
> 
> Is this running on the worker node itself or does it have to be remote?
> 
> If it’s local then the following should be enough:
> 
> import htcondor
> htcondor.param[‘MY_VAR’] = 5
> 
> Or RemoteParam for remote setting.
> 
> However you may be running into a security setting, especially given the remoteparam failure message.
> 
> You need to look at the SETTABLE_ATTRS_* config knobs.
> 
> Cheers, Iain
> 
>> On Aug 15, 2016, at 16:56, Thomas Hartmann <thomas.hartmann@xxxxxxx> wrote:
>>
>> Hi all,
>>
>> I am trying to modify settable ClassAds on a worker node's master
>> through the python bindings. I.e., I would like to do something
>> equivalent to
>>
>>> condor_config_val -name batch0930.desy.de -master -set
>> 'TEST_HOST_STATUS = "preparing"'
>>> condor_reconfig -name batch0930.desy.de
>>
>>
>> So, I first polled the current ClassAds from the collector for this
>> node/master, change the key:value and advertise the updated ad
>>
>>>>> batch0930_master =
>> collector.query(htcondor.AdTypes.Master,'regexp(".*batch0930\\.desy\\.de",
>> Name)')
>> # in the end the idea would be a list of masters to loop over...
>>>>> batch0930_master[0]['TEST_HOST_STATUS']='testing'
>>>>> collector.advertise(batch0930_master[0],command=UPDATE_AD_MASTER)
>>
>> which fails with "NameError: name 'UPDATE_AD_MASTER' is not defined" [1]
>>
>> ---
>>
>> I also tried to follow
>> https://lists.cs.wisc.edu/archive/htcondor-users/2015-November/msg00060.shtml
>> with
>>
>>>>> batch0930_master = collector.locate(htcondor.DaemonTypes.Master,
>> "batch0930.desy.de")
>> # I assume, that the ClassAds objects are the same either queried with
>> locate() or with query() [with the 'right' regexp], or?
>>>>> batch0930_master['TEST_HOST_STATUS']='testing'
>>
>> # apparently setting a new value before polling the remote parameters
>> does not work
>> # so I polled the remote parameters and tried to update the
>> dict/classad with
>>
>>>>> batch0930_params = htcondor.RemoteParam(batch0930_master)
>>>>> batch0930_params['TEST_HOST_STATUS']='testing'
>>
>> but which fails with
>> "RuntimeError: Failed to set remote daemon parameter."
>>
>> So, I would be grateful if somebody can help me out on how to properly
>> update a worker node's master? ;)
>>
>> Cheers and thanks,
>>  Thomas
>>
>> [1]
>> the current documentation is a bit unclear, since the keyword order
>> seems to be different for generic 'UPDATE_AD_GENERIC' compared to startd
>> daemon 'UPDATE_STARTD_AD' as in
>> https://research.cs.wisc.edu/htcondor/manual/latest/6_7Python_Bindings.html
>> anyway, I tried both, 'UPDATE_AD_MASTER' and 'UPDATE_MASTER_AD', but
>> both are failing with the aforementioned name error
>>
>> _______________________________________________
>> 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/
> 
> 
> 
> _______________________________________________
> 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/
> 

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature