Skip to content

Commit

Permalink
feat(HTCondorCE): add option to submit with SSL
Browse files Browse the repository at this point in the history
set UseSSLSubmission = True to a computing element and provide the local userkey and usercert files in coordination with participating Sites
as they have to configure DN of the submitting user
  • Loading branch information
ILCDIRAC authored and andresailer committed May 30, 2024
1 parent baf7bb5 commit 1a23263
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/DIRAC/Resources/Computing/HTCondorCEComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
then one does not need to run condor daemons on the submit machine.
If True requires the condor grid middleware (condor_submit, condor_history, condor_q, condor_rm)
UseSSLSubmission:
If 'True', use SSL via a DN configured at the given computing element to submit jobs.
This is a bridge feature until everyone is capable to use Tokens to submit to computing elements.
WorkingDirectory:
Location to store the pilot and condor log files locally. It should exist on the server and be accessible (both
readable and writeable). Also temporary files like condor submit files are kept here. This option is only read
Expand Down Expand Up @@ -104,6 +108,7 @@ def __init__(self, ceUniqueID):
gConfig.getValue("Resources/Computing/HTCondorCE/WorkingDirectory", DEFAULT_WORKINGDIRECTORY),
)
self.useLocalSchedd = True
self.useSSLSubmission = False
self.remoteScheddOptions = ""
self.tokenFile = None

Expand Down Expand Up @@ -217,6 +222,11 @@ def _reset(self):
"" if self.useLocalSchedd else f"-pool {self.ceName}:{self.port} -name {self.ceName} "
)

self.useSSLSubmission = self.ceParameters.get("UseSSLSubmission", self.useSSLSubmission)
if isinstance(self.useSSLSubmission, str):
if self.useSSLSubmission == "True":
self.useSSLSubmission = True

self.log.debug("Using local schedd:", self.useLocalSchedd)
self.log.debug("Remote scheduler option:", self.remoteScheddOptions)
return S_OK()
Expand All @@ -239,6 +249,19 @@ def _executeCondorCommand(self, cmd, keepTokenFile=False):
htcEnv = {
"_CONDOR_SEC_CLIENT_AUTHENTICATION_METHODS": "GSI",
}

if self.useSSLSubmission:
htcEnv = {
"_condor_SEC_CLIENT_AUTHENTICATION_METHODS": "SSL",
"_condor_AUTH_SSL_CLIENT_KEYFILE": "/home/dirac/.globus/userkey.pem",
"_condor_AUTH_SSL_CLIENT_CERTFILE": "/home/dirac/.globus/usercert.pem",
"_condor_AUTH_SSL_CLIENT_CADIR": "/opt/dirac/etc/grid-security/certificates/",
"_condor_AUTH_SSL_SERVER_CADIR": "/opt/dirac/etc/grid-security/certificates/",
"_condor_AUTH_SSL_USE_CLIENT_PROXY_ENV_VAR": "false",
"_condor_AUTH_SSL_SERVER_CAFILE": "",
"_condor_AUTH_SSL_CLIENT_CAFILE": "",
}

# If a token is present, then we use it (overriding htcEnv)
if self.token:
# Create a new token file if we do not keep it across several calls
Expand Down

0 comments on commit 1a23263

Please sign in to comment.