Permalink
Browse files

Add job resubmission

needs an answer for galaxyproject/galaxy#7118
  • Loading branch information...
erasche committed Dec 14, 2018
1 parent d6004e8 commit 6eade5b0c1c3133393df540ff7fff1ad0093a72a
Showing with 34 additions and 6 deletions.
  1. +18 −1 files/galaxy/dynamic_rules/sorting_hat.py
  2. +15 −4 group_vars/galaxy.yml
  3. +1 −1 templates/galaxy/config/job_conf.xml.j2
@@ -269,7 +269,7 @@ def _gateway(tool_id, user_roles, user_id, user_email, memory_scale=1.0):
return env, params, runner, tool_spec


def gateway(tool_id, user, memory_scale=1.0):
def gateway(tool_id, user, memory_scale=1.0, next_dest=None):
# And run it.
if user:
user_roles = [role.name for role in user.all_roles() if not role.deleted]
@@ -285,10 +285,27 @@ def gateway(tool_id, user, memory_scale=1.0):
except Exception as e:
return JobMappingException(str(e))

resubmit = []
if next_dest:
resubmit = [{
'condition': 'any_failure and attempt <= 3',
'destination': next_dest
}]

name = name_it(spec)
return JobDestination(
id=name,
runner=runner,
params=params,
env=env,
resubmit=resubmit,
)

def gateway_1x(tool_id, user):
return gateway(tool_id, user, memory_scale=1, next_dest='gateway_1_5x')

def gateway_1_5x(tool_id, user):
return gateway(tool_id, user, memory_scale=1.5, next_dest='gateway_2x')

def gateway_2x(tool_id, user):
return gateway(tool_id, user, memory_scale=2)
@@ -437,20 +437,31 @@ galaxy_jobconf:
amqp_consumer_timeout: 2.0
amqp_publish_retry: True
amqp_publish_retry_max_retries: 60
default_destination: gateway_1x
destinations:
- id: local
runner: local
- id: condor
runner: condor
params:
tmp_dir: "True"
#- id: drmaa
#runner: drmaa
- id: gateway
# Gateways
- id: gateway_1x
runner: dynamic
params:
type: python
function: gateway_1x
- id: gateway_1_5x
runner: dynamic
params:
type: python
function: gateway_1_5x
- id: gateway_2x
runner: dynamic
params:
type: python
function: gateway
function: gateway_2x
# Pulsar MQs
- id: remote_cluster_mq_cz
runner: pulsar_eu_cz
params:
@@ -16,7 +16,7 @@
<handler id="handler_{{ galaxy_instance_codename }}_{{ n }}" tags="handlers"/>
{% endfor %}
</handlers>
<destinations default="gateway">
<destinations default="{{ galaxy_jobconf['default_destination'] }}">
{% for destination in galaxy_jobconf['destinations'] %}
<destination id="{{ destination['id'] }}" runner="{{ destination['runner'] }}">
{% if 'params' in destination %}

0 comments on commit 6eade5b

Please sign in to comment.