From a4c546688fb1cf82bf9019b0778a1501963781aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Dom=C3=ADnguez?= Date: Thu, 23 Nov 2023 14:38:09 +0100 Subject: [PATCH] TPV rule to send jobs to the secondary HTCondor cluster Add a TPV rule that sends a fraction of jobs to the secondary HTCondor cluster. --- files/galaxy/tpv/tool_defaults.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/files/galaxy/tpv/tool_defaults.yml b/files/galaxy/tpv/tool_defaults.yml index e443f8a1d..f18c18611 100644 --- a/files/galaxy/tpv/tool_defaults.yml +++ b/files/galaxy/tpv/tool_defaults.yml @@ -60,6 +60,23 @@ tools: retval fail: | Invalid 'Remote resources id' selected in the config menu under 'User -> Preferences -> Manage Information -> Use distributed compute resources'. Please reselect either 'default' or an appropriate remote resource then click 'Save' and rerun your job. + - id: secondary_cluster + # Send a fraction of jobs to the secondary HTCondor cluster. + if: True + execute: | + from random import SystemRandom + + from tpv.core.entities import Tag, TagSetManager, TagType + + if SystemRandom().random() < 0.05: + pulsar_tag = Tag( + "scheduling", + "condor-secondary", + TagType.REQUIRE, + ) + entity.tpv_tags = entity.tpv_tags.combine( + TagSetManager(tags=[pulsar_tag]) + ) rank: | final_destinations = helpers.weighted_random_sampling(candidate_destinations)