-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propose batch from pre-constructed jobs #1069
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1069 +/- ##
==========================================
+ Coverage 90.8% 90.85% +0.04%
==========================================
Files 50 50
Lines 7029 7063 +34
==========================================
+ Hits 6383 6417 +34
Misses 646 646 |
c3ed532
to
10b1fa0
Compare
api/jobs/batch.py
Outdated
preconstructed_jobs = proposal.get('preconstructed_jobs') | ||
|
||
# If Running a batch from already-constructed jobs | ||
if preconstructed_jobs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break these two branches out into different functions, and call them from here.
api/jobs/queue.py
Outdated
@staticmethod | ||
def enqueue_job(job_map, origin, perm_check_uid=None): | ||
def validate_job(job_map, origin, create_job=False, perm_check_uid=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not change this function signature. Instead, revert changes to this function, then remove job.insert()
to make it consistent with the original documentation. Then check usage of enqueue_job
to see who will need job.insert()
added after calling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notably, this PR is a lot easier to read when using |
054dd24
to
58fc655
Compare
58fc655
to
1bb0e5e
Compare
Fixes #940
Changes
POST /batch/jobs
with a list of jobs,jobs: [{...}, {...}, ...]
, in the payloadbatch.proposal.preconstructed_jobs
in mongoReview Checklist