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

[HTCondor-users] htcondor.send_command for a remote condor



Hi all,

I've been helping develop a system that tracks/issues commands to jobs/machines via the python bindings and I've run into a situation that I don't see covered in the docs.

The system tracks jobs and machines from multiple condor instances and issues simple commands like DaemonsOffPeaceful. The commands work fine if the machines are located on the local condor but I don't see a way to issue a command to a remote condor. Unlike the Schedd and Collector python object the htcondor.send_command() does not require initialization as it uses the "htcondor" directly from the python import.

What I'd like to do is issue a command via send_command to a remote condor instance (not the one running on my local machine).

Typical workflow looks like this:


#initialize a collector object to query for the machine classad i'd like to issue the command to condor_session = htcondor.Collector(condor_host) #condor_host can be the local or the remote host

#query for the classad
condor_classad = condor_session.query(master_type, 'Name=="%s"' % resource.name.split("@")[1])[0] #i've confirmed this is returning the desired classad

#then finally issue the command
result = htcondor.send_command(condor_classad, htcondor.DaemonCommands.DaemonsOffPeaceful)


Which works nicely if the condor_host is the local one but if its a remote host then i get an error:

File "/opt/cloudscheduler/data_collectors/condor/csmachines.py", line 208, in command_poller result = htcondor.send_command(condor_classad, htcondor.DaemonCommands.DaemonsOffPeaceful)
RuntimeError: Failed to start command.


I understand that what this is probably doing is issuing the command to the local condor which has no idea what the classad I'm passing in is. Anyone know of a way around this?


Many Thanks,
-Colson