Skip to content

Commit

Permalink
HC-484: OpenSearch support (#31)
Browse files Browse the repository at this point in the history
* removed _type b/c its unused and opensearch removed it

* removed _type b/c its unused and opensearch removed it

* skip worker by looking at the _index

---------

Co-authored-by: dustinlo <[email protected]>
Co-authored-by: Mike Cayanan <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2023
1 parent 7c238d9 commit 6026de5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 24 deletions.
5 changes: 0 additions & 5 deletions docker/hysds-io.json.lw-mozart-reprioritize
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions docker/hysds-io.json.lw-mozart-retry
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions docker/job-spec.json.lw-mozart-reprioritize
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"name": "retry_job_id",
"destination": "context"
},
{
"name": "type",
"destination": "context"
},
{
"name": "retry_count_max",
"destination": "context"
Expand Down
4 changes: 0 additions & 4 deletions docker/job-spec.json.lw-mozart-retry
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"name": "retry_job_id",
"destination": "context"
},
{
"name": "type",
"destination": "context"
},
{
"name": "retry_count_max",
"destination": "context"
Expand Down
15 changes: 9 additions & 6 deletions retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.")

0 comments on commit 6026de5

Please sign in to comment.