Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Galaxy to be able to access the secondary HTCondor cluster #981

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions files/galaxy/tpv/destinations.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ destinations:
# LOCAL CONDOR DESTINATIONS #
#############################

{# Save condor destinations to replicate them in the secondary cluster. #}
{% set condor %}
condor_docker:
inherits: basic_docker_destination
runner: condor
Expand Down Expand Up @@ -430,3 +432,17 @@ destinations:
GPU_AVAILABLE: 1
params:
requirements: 'GalaxyGroup == "compute_gpu"'
{%- endset %}{{ condor }}

{# Generate secondary cluster destinations. #}
{% for name, destination in (condor | from_yaml).items() %}
{% if destination.runner is defined and destination.runner == "condor" %}
secondary_{{ name }}:
inherits: {{ name }}
runner: condor_secondary
scheduling:
require:
- condor-secondary

{% endif %}
{% endfor %}
5 changes: 5 additions & 0 deletions group_vars/htcondor-secondary-submit-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
nspawn_enable: false
nspawn_start: false

nspawn_ssh: yes

Check warning on line 34 in group_vars/htcondor-secondary-submit-host.yml

View workflow job for this annotation

GitHub Actions / Lint

34:13 [truthy] truthy value should be one of [false, true]
nspawn_ssh_config_path: /etc/ssh/sshd_config
nspawn_ssh_config:
Port: "2222"
Expand Down Expand Up @@ -59,8 +59,13 @@
rsa: "[email protected] AAAAHHNzaC1yc2EtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgQuoZdMdY7Boli6KRlNmUk2zQar66du6kmLR4PkWoHI8AAAADAQABAAABgQDxIgnu5/BIIzV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extXoYldA4Vp29ow33sYF8Mr4p7Jbjyyr4GVP9RAymiZz9cuiiRqjs8qwn/UCOw4A6yaix4k0EYTJa9bpbD3MsCxJbKEdZxxL72kIKf4sGuDrd77hEtRwJFUSqz+XD96TYG+BIomnrk35Oy+oyMGhoIlSM0//cS0pHUW8fpGnRIJJbBjDETwOmaMEF5yynRSeJyWnEBPpjcA+1i7wILSxYxZb5ckGxCABYxNvlIhF8Bvdcyb4eo7B/WeEdzr5C+Pzg== /etc/ssh/ssh_host_rsa_key.pub"
nspawn_ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDV7gfNbNN5O8vH6/tM/iOFXKBP2YKRHXOmdfV8ogvu9BdVV0IPmDzk2EooVpThDE1VMv1hz3811tvBhHRJ6IgNhVIV/61w/+RazQD/AU27X8bX+Hb9EQ/bP4DW+6ySd/z5vdDLzpH5dbiMhzPEDkXVsylUT+hkQnas6cHspDhHmtKQ5MWOgDe3D/IEudTDJQe8hxxaU4TaZUmFzn7eYp9HvuK8qW0yCy4NWOxJJHA+G5wSCyLuKnaKo4AitUIzSKF1AB94oq7b96KONhPxgRptAk4OYIUTdNFbrI5HDaSNzHLnF5FbjQvG+Eu6m5nY5yvJMogE+jiuWeIXCZTCFljg287FUo0ohmbZpd802L6VXun14VumRC+rRgPrvBALo/CsyCsPIoBSTKhVElxKVOcRjmTLNfrUZM0GQxqJhIvah8BV+JTExkipPwkrKTdMAWIXvCoehxV+WMpBWqtEEzAzEoqJpaiec7HfriwsHTGESZWAPYEbFjzbHXQZtqBkbOvtokPMRmTWfWKxaplCMN6ddJeeY6faorD0w/e6lszWES1Q1ieajiPKDy37UvybKKvPTk4o3MzyzYOS4c8HQj+jnGeR5Q3ETuyz4psLyOfuBtIrfOeuxV42rFDmkYM3IrrRR+F9oklFG6Ig8DVfgQEzSG36NkgvpF4OdFvigYqXvw== cloud@vgcn"
nspawn_ssh_host_trust_container: yes

Check warning on line 62 in group_vars/htcondor-secondary-submit-host.yml

View workflow job for this annotation

GitHub Actions / Lint

62:34 [truthy] truthy value should be one of [false, true]

nspawn_condor_systemd_run: "/usr/bin/systemd-run --uid={{ galaxy_user.uid }} --gid={{ galaxy_group.gid }} --pipe --quiet --machine {{ nspawn_name }}"
nspawn_condor_rm_command: "{{ nspawn_condor_systemd_run }} /usr/bin/condor_rm"
nspawn_condor_ssh_to_job_command: "{{ nspawn_condor_systemd_run }} /usr/bin/condor_ssh_to_job"
nspawn_condor_submit_command: "{{ nspawn_condor_systemd_run }} /usr/bin/condor_submit"

ssh_allow_tcp_forwarding: "local"
sshd_custom_options:
- "PermitOpen 127.0.0.1:{{ nspawn_ssh_config.Port }}"
15 changes: 15 additions & 0 deletions htcondor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,21 @@
key: "[127.0.0.1]:{{ nspawn_ssh_config.Port }} {{ nspawn_ssh_host_key.content | b64decode }}"
when: nspawn_ssh_host_trust_container

- name: Allow the Galaxy user to run HTCondor commands in the container.
# Uses /etc/sudoers. Ideally this would be solved using what is requested
# in this issue https://github.com/systemd/systemd/issues/10997, but the
# issue is still open.
community.general.sudoers:
name: htcondor-nspawn
user: "{{ galaxy_user.name }}"
nopassword: true
validation: required
setenv: true
commands:
- "{{ nspawn_condor_rm_command }} *"
- "{{ nspawn_condor_ssh_to_job_command }} *"
- "{{ nspawn_condor_submit_command }} *"

- name: HTCondor cluster.
hosts: htcondor:!sn06.galaxyproject.eu
handlers:
Expand Down
6 changes: 6 additions & 0 deletions templates/galaxy/config/job_conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ galaxy_jobconf:
#workers: 3
- id: condor
load: galaxy.jobs.runners.condor:CondorJobRunner
- id: condor_secondary
load: galaxy.jobs.runners.condor:CondorJobRunner
params:
condor_rm_cmd: "sudo {{ nspawn_condor_rm_command }}"
condor_ssh_to_job_cmd: "sudo {{ nspawn_condor_ssh_to_job_command }}"
condor_submit_cmd: "sudo {{ nspawn_condor_submit_command }}"
- id: local
load: galaxy.jobs.runners.local:LocalJobRunner
- id: pulsar_embedded
Expand Down
14 changes: 14 additions & 0 deletions templates/galaxy/config/job_conf.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,17 @@ limits:
window: {{ limit['window'] }}
{% endif %}
{% endfor %}
{# Replicate destination limits for the secondary HTCondor cluster #}
{% for limit in galaxy_jobconf['limits'] | sort(attribute='type') %}
{% if limit['type'].startswith('destination_') and 'id' in limit
and limit['id'].startswith('condor_') %}
- type: {{ limit['type'] }}
value: {{ limit['value'] }}
id: secondary_{{ limit['id'] }}
{% if 'tag' in limit %}
tag: {{ limit['tag'] }}
{% elif 'window' in limit %}
window: {{ limit['window'] }}
{% endif %}
{% endif %}
{% endfor %}
Loading