Skip to content

Commit

Permalink
feat: Add CERN kerberos auth with 'location_cern' option (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfeickert authored Apr 6, 2024
1 parent 6b7886c commit 033d478
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"profile_name": "htcondor",
"htcondor_log_dir": "/net/data_lhcb1b/user/jheuel/.condor_jobs"
"htcondor_log_dir": "/net/data_lhcb1b/user/jheuel/.condor_jobs",
"location_cern": false
}
10 changes: 10 additions & 0 deletions {{cookiecutter.profile_name}}/grid-submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
if request_disk is not None:
sub["request_disk"] = str(request_disk)

{%- if cookiecutter.location_cern %}

# Add kerberos credentials
# c.f. https://batchdocs.web.cern.ch/local/pythonapi.html
col = htcondor.Collector()
credd = htcondor.Credd()
credd.add_user_cred(htcondor.CredTypes.Kerberos, None)
sub["MY.SendCredential"] = "True"
{%- endif %}

schedd = htcondor.Schedd()
clusterID = schedd.submit(sub)

Expand Down

0 comments on commit 033d478

Please sign in to comment.