Using Kubernetes Jobs Instead of Pods with Nextflow #4170
-
I want to use Nextflow to deploy workflows to a large shared Kubernetes cluster. I'm interested in Nextflow's ability to deploy Jobs instead of Pods. I previously tried Nextflow using Pods to deploy workflows and found it challenging. This is in large part because our cluster environment strongly favors k8s Jobs to ensure proper resource release and cleanup, but also because even when we made an exception for nextflow, we had problems with Nextflow leaving pods around and apparently needed custom scripting to keep the namespace cleaned up. I recently heard that the k8s executor currently supports, or will soon support, k8s Jobs for workflow deployment instead of Pods. I looked for this feature in the docs and change log today but don't see it. I'd like to know if I had misheard that or if it's a feature coming soon or is perhaps undocumented. Further InvestigationI'm looking through the code a little to try to see what's there and I see this line which suggests Jobs might just be a configuration choice? K8sTaskHandler.groovy
this.resourceType = executor.k8sConfig.useJobResource() ? ResourceType.Job : ResourceType.Pod And also: protected boolean useJobResource() { resourceType==ResourceType.Job } This seems to suggest Job's are an option, but I don't see docs on how to set that in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
k8s.computeResourceType = 'Job' |
Beta Was this translation helpful? Give feedback.
docs: https://nextflow.io/docs/latest/config.html#scope-k8s