ADR: service process directive for long-running auxiliary tasks#7147
Open
edmundmiller wants to merge 3 commits into
Open
ADR: service process directive for long-running auxiliary tasks#7147edmundmiller wants to merge 3 commits into
edmundmiller wants to merge 3 commits into
Conversation
Proposes a process-level `service true` directive that marks a process as a long-running auxiliary task whose declared outputs are bound to downstream channels as soon as they appear in the work directory, and which is SIGTERM'd by a TraceObserverV2 once all consumer processes terminate. MVP scope is the local executor only; cluster/cloud variants are out of scope and called out as non-goals. Signed-off-by: Claude <noreply@anthropic.com>
Adds concrete use cases that motivate the directive: - NVIDIA NIM inference server (amortize model load across consumer tasks) - DuckDB `quack` extension (client-server access to an embedded DB) Also expands the Problem Statement bullet list with the GPU-inference and embedded-database-as-server cases. Signed-off-by: Claude <noreply@anthropic.com>
Sketches how `service true` would extend to grid schedulers, Kubernetes, and cloud batch executors, along with cross-cutting follow-ups (colocate strategy, group-local services, readiness probes, multi-instance services, graceful drain). Reclassifies the cluster/cloud non-goals as MVP-only rather than permanent. Signed-off-by: Claude <noreply@anthropic.com>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
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
This ADR documents the design and rationale for introducing a
serviceprocess directive to Nextflow, enabling long-running auxiliary tasks (such as inference servers, embedded databases, or local HTTP fixtures) to expose resources to downstream consumer processes while still running.Overview
The
service truedirective marks a process as a long-running auxiliary task whose declared outputs are emitted to downstream channels as soon as they appear in the task work directory, rather than waiting for task completion. The service is automatically terminated (SIGTERM) once all consumer processes have finished.Key Design Decisions
service truedirective fitting Nextflow's existing directive vocabulary, rather than per-output markerscache falsesince outputs are transient resources (sockets, ports, ramdisks)Implementation Approach
TaskHandler.kill(),TraceObserverV2, andcollectOutputs()machineryServiceLifecycleObserverto track service-consumer relationships and trigger terminationTaskProcessor.startServiceOutputWatcher()for polling-based output detectionservice trueis only used with the local executorUse Cases Addressed
Future Work
The ADR sketches extensibility paths for:
service.colocatedirective, group-local services, readiness probes, multi-instance services, and graceful drainNon-Goals (MVP)
service(...)markershttps://claude.ai/code/session_01CVy7Bt2VZBZ2gXm7d8psVZ