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

Re: [HTCondor-users] Env vars to make htcondor.Schedd() Just Work?



You may have done this already and just not mentioned it, but make sure what you're trying to do works from the command-line before trying to make it work from the bindings. For example:

$ _CONDOR_COLLECTOR_HOST=minicondor:9618 condor_status -schedd -af Name MyAddress

needs to return something that looks kind of like

minicondor <172.10.11.12:9618?addrs=172.10.11.12-9618&alias=minicondor&noUDP&sock=schedd_20758_d703>

Likewise,

$ _CONDOR_COLLECTOR_HOST=minicondor _CONDOR_SCHEDD_NAME=minicondor condor_q

should return something like

-- Schedd: minicondor : <172.10.11.12:9618?... @ 09/19/25 16:35:26
OWNER BATCH_NAME      SUBMITTED   DONE   RUN    IDLE   HOLD  TOTAL JOB_IDS

Total for query: 0 jobs; 0 completed, 0 removed, 0 idle, 0 running, 0 held, 0 suspended Total for ssl: 0 jobs; 0 completed, 0 removed, 0 idle, 0 running, 0 held, 0 suspended

(That is, you successfully talked to the schedd and it said it replied,
in  this example, saying that you didn't have jobs in the queue.)

This still doesn't imply that you'll be able to submit jobs, however:

$ _CONDOR_COLLECTOR_HOST=cm.chtc.wisc.edu _CONDOR_SCHEDD_HOST=ap2001.chtc.wisc.edu condor_submit ./sleep.submit
Submitting job(s)
ERROR: Failed to connect to local queue manager
SECMAN:2010:Received "DENIED" from server for user ssl@ssl_unmappeduser using method SSL.

(Not sure if that error message or the code there is buggy.)

$ $ _CONDOR_COLLECTOR_HOST=minicondor condor_submit -name minicondor ./sleep.submit
Submitting job(s)
ERROR: Failed to connect to queue manager minicondor
SECMAN:2010:Received "DENIED" from server for user ssl@ssl_unmappeduser using method SSL.

In my testing setup, I can't submit to the remote schedd because the only HTCondor authentication I can use is FS, which of course doesn't work remotely. (It tries SSL, because that's in the list, but I don't have a client-side certificate, so the schedd can't tell who I am.)

Given that your 'remote' schedd is a container, bind-mounting /tmp into the countainer might be enough to make FS work.



Once you can submit a job using the command-line tools, you know any problems doing so from Python are specific to the Python API or your usage of it, and not a problem at the HTCondor level.

I still don't understand how to get Collector() to use the CONDOR_HOST or COLLECTOR_HOST env var / config file items though, from the docs it seems like those should work.

As far as I can tell, setting _CONDOR_COLLECTOR_HOST in the environment does work, as long you set it before you import the htcondor2 module. (The `htcondor` module has been replaced by `htcondor2` in the most recent version of HTCondor, and we recommend not writing any code in the old one.) I tested the following:

#!/usr/bin/env python3

import os

os.environ['_CONDOR_COLLECTOR_HOST'] = "minicondor:9618"

import htcondor2

c = htcondor2.Collector()
ads = c.query(htcondor2.AdType.Schedd, projection=['Name', 'MyAddress'])
print(ads)


and got ads; then I removed the os.environ line and did not.


-- ToddM