Add per-process array scheduling hints for Google Batch - #7395
Open
fraser-combe wants to merge 1 commit into
Open
Add per-process array scheduling hints for Google Batch#7395fraser-combe wants to merge 1 commit into
fraser-combe wants to merge 1 commit into
Conversation
Add two Google Batch `hints` keys for array tasks: - `scheduling.policy`: `in_order` sets the task group's IN_ORDER scheduling policy (and parallelism=1, which Batch requires), running the array's tasks sequentially by index on a single VM; `as_soon_as_possible` (the default) leaves the policy unset. - `scheduling.parallelism`: caps the number of array tasks that run concurrently, clamped to the array size; ignored under `in_order`. Both apply only to array (TaskArrayRun) tasks and preserve today's behaviour when unset. The `google-batch/`-prefixed form takes precedence over the bare form. Unknown `google-batch/`-prefixed hints are rejected, per the hints ADR. Includes unit tests and docs. Closes nextflow-io#6825 Signed-off-by: Fraser Combe <fraser.combe@tempus.com>
✅ Deploy Preview for nextflow-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #6825
Adds two per-process array task-group scheduling hints for the Google Batch executor, exposed through the
hintsprocess directive (#7034):scheduling.policyandscheduling.parallelism. They let a pipeline control how anarrayprocess's tasks are scheduled on Batch - run sequentially on a single VM, and/or with a concurrency cap - per process, which isn't possible today. The keys follow thescheduling.*namespace convention from the hints-process-directive ADR (20260323-hints-process-directive.md); the ADR catalogsscheduling.provisioningModel(#7343) andscheduling.priority, and these two array-scheduling keys extend that same namespace.What it adds
scheduling.policyhint (aString) on the Google Batch executor, mapping to the BatchTaskGroup.SchedulingPolicy:in_order>IN_ORDER: the array's tasks run sequentially by index on a single VM. Batch requiresparallelism = 1forIN_ORDER, so it is set automatically.as_soon_as_possible> the default; the policy is left unset (today's behaviour).in-orderis accepted asin_order).scheduling.parallelismhint (a positive integer) that caps how many of an array's tasks run concurrently, clamped to the array size. Ignored underin_order(which pins parallelism to 1).TaskArrayRun) tasks. A non-array process that sets them gets a warning and no effect.scheduling.policyvalue, or a non-integer / non-positivescheduling.parallelism, throwsIllegalArgumentException- no silent fallback, so a typo fails fast.google-batch/-prefixed hint key throws, per the ADR (unrecognized prefixed hints are errors); all unknown prefixed keys are reported together in one exception. Bare and foreign-executor keys are left untouched.scheduling.policy) and the executor-prefixed key (google-batch/scheduling.policy); the prefixed form is prioritized. This mirrors the AWS Batch executor's existing hint resolution (get(prefix+key) ?: get(key)).Tests
Unit tests added in nf-google (
GoogleBatchTaskHandlerTest):should apply array scheduling from hints- policy mapping (in_order, thein-orderspelling,as_soon_as_possible), theparallelismcap, clamping to the array size, string and integer values, and thegoogle-batch/-prefixed form.should throw on invalid array scheduling hint- an unknown policy value and a non-integer / zero / negativeparallelismall throw.should accept known and unprefixed google-batch hints-null/empty maps, a known prefixed key, a bare key, and a foreign-executor key are all left untouched (no throw).should reject unknown prefixed google-batch hints- an unrecognizedgoogle-batch/-prefixed key throws, per the ADR's prefixed-error rule.Validation
The unit tests above assert the resulting
TaskGroup(schedulingPolicyandparallelism) for each case. I have not run this against a live Google Batch project yet.Related
scheduling.*namespace (scheduling.policy,scheduling.parallelism)hintsprocess directive (Add hints process directive for executor-specific scheduling hints #7034 / ADR20260323-hints-process-directive.md)scheduling.provisioningModel) targets the same executor, the same handler, and the samescheduling.*namespace, and uses the sameget(prefix+key) ?: get(key)resolution and unknown-google-batch/*-key validation. This PR carries the minimal shared plumbing itself so it stands alone; either can merge first.