diff --git a/docker/hysds-io.json.lw-mozart-reprioritize b/docker/hysds-io.json.lw-mozart-reprioritize index 75ac31a..92cb713 100644 --- a/docker/hysds-io.json.lw-mozart-reprioritize +++ b/docker/hysds-io.json.lw-mozart-reprioritize @@ -9,11 +9,6 @@ "type": "text", "from": "dataset_jpath:_source.job.job_info.id" }, - { - "name": "type", - "type": "text", - "from": "dataset_jpath:_type" - }, { "name": "retry_count_max", "type": "text", diff --git a/docker/hysds-io.json.lw-mozart-retry b/docker/hysds-io.json.lw-mozart-retry index 5d624b0..9de9917 100644 --- a/docker/hysds-io.json.lw-mozart-retry +++ b/docker/hysds-io.json.lw-mozart-retry @@ -9,11 +9,6 @@ "type": "text", "from": "dataset_jpath:_source.job.job_info.id" }, - { - "name": "type", - "type": "text", - "from": "dataset_jpath:_type" - }, { "name": "retry_count_max", "type": "text", diff --git a/docker/job-spec.json.lw-mozart-reprioritize b/docker/job-spec.json.lw-mozart-reprioritize index d6ce145..5470125 100644 --- a/docker/job-spec.json.lw-mozart-reprioritize +++ b/docker/job-spec.json.lw-mozart-reprioritize @@ -11,10 +11,6 @@ "name": "retry_job_id", "destination": "context" }, - { - "name": "type", - "destination": "context" - }, { "name": "retry_count_max", "destination": "context" diff --git a/docker/job-spec.json.lw-mozart-retry b/docker/job-spec.json.lw-mozart-retry index b2af219..2616441 100644 --- a/docker/job-spec.json.lw-mozart-retry +++ b/docker/job-spec.json.lw-mozart-retry @@ -11,10 +11,6 @@ "name": "retry_job_id", "destination": "context" }, - { - "name": "type", - "destination": "context" - }, { "name": "retry_count_max", "destination": "context" diff --git a/retry.py b/retry.py index 71969d5..36db5c8 100644 --- a/retry.py +++ b/retry.py @@ -90,6 +90,10 @@ def resubmit_jobs(context): index = doc["_index"] _id = doc["_id"] + if not index.startswith("job"): + print("Cannot retry a worker: %s" % _id) + continue + # don't retry a retry if job_json['type'].startswith('job-lw-mozart-retry'): print("Cannot retry retry job %s. Skipping" % job_id) @@ -165,9 +169,8 @@ def resubmit_jobs(context): if __name__ == "__main__": ctx = read_context() - - input_type = ctx['type'] - if input_type != "worker": - resubmit_jobs(ctx) - else: - print("Cannot retry a worker.") + # input_type = ctx['resource'] + # if input_type == "job": + resubmit_jobs(ctx) + # else: + # print("Cannot retry a task, worker or event.")