-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NSDS-1730: implement accountability re-design (#15)
* Fixed issue when preparing the psuedo_context * Incremented version number * fixed up creation of cls_object * NSDS-913: Implemented accountability in chimera core * NSDS-913: fixed up imports * Added env python * fixed imports? * Added _id to job_type in accountability.py * fixed sciflo issue * added the ability to grab the accountability module path. * Trying to fix up how I grab the accountability class * removed use of logger in sciflo_util.py * Fixed accountability failure implementation * Added an index field that should be set and added 3 more functions that are recommended to be overwritten when implementing a custom Accountability object. * added logging for PostProcess run * NSDS-1730: Added changes in run_sciflo for new __init__ of Accountability object. Added to Accountability's __init__. Updated how we initialize accountability in the PostProcessFunctions __init__. Added to job fields to constants.py * NSDS-1730: updated accountability to be cleaner. * NSDS-1730: removed unused constants * NSDS-1730: added "set_products" function in accountability object * NSDS-1730: removed accountability from unecessary places. * NSDS-1730: fixed reading of context file mistake * NSDS-1730: fixed getcwd issue * NSDS-1730: fixed create_job_entry issue * NSDS-1730: updated how we pass in the work_dir to the accountability object. * NSDS-1730: removed work_dir as a optional param in Accountability * NSDS-1730: removed unecessary pge_config. * NSDS-1730: removed check if a job failed for the old accountability Co-authored-by: Poreh <[email protected]> Co-authored-by: Ben Poreh <[email protected]> Co-authored-by: bporeh <[email protected]>
- Loading branch information
1 parent
bff5cc8
commit 6122eec
Showing
8 changed files
with
43 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
#!/usr/bin/env python | ||
import json | ||
from chimera.commons.constants import ChimeraConstants as chimera_const | ||
|
||
|
||
class Accountability(object): | ||
def __init__(self, context, index=None): | ||
self.input_dataset_type = context.get(chimera_const.INPUT_DATASET_TYPE) + "_id" | ||
self.input_dataset_id = context.get(chimera_const.INPUT_DATASET_ID) | ||
self.step = context.get(chimera_const.STEP) | ||
self.index = index | ||
def __init__(self, context, work_dir): | ||
self.context = context | ||
self.job_json = None | ||
self.job_id = None | ||
self.work_dir = work_dir | ||
if work_dir is not None: | ||
with open("{}/_job.json".format(work_dir), "r") as f: | ||
self.job_json = json.load(f) | ||
|
||
def _search(self, query): | ||
pass | ||
self.job_id = self.job_json.get(chimera_const.JOB_INFO).get(chimera_const.JOB_PAYLOAD).get(chimera_const.PAYLOAD_TASK_ID) | ||
|
||
def _update_doc(self, id, body): | ||
def get_entries(self): | ||
pass | ||
|
||
def get_entries(self): | ||
def create_job_entry(self): | ||
pass | ||
|
||
def set_status(self, status): | ||
pass | ||
def set_products(self, job_results): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters