Hi All, in the configuration for the k8s executor,...
# nostupidquestions
a
Hi All, in the configuration for the k8s executor, could please someone point out how to specify things like “runtimeClass” and “nvidia.com/gpu” limits? Here’s for reference how the yaml with those settings looks like for a basic pod. Thanks!
apiVersion: v1
kind: Pod
metadata:
name: nvidia-smi
namespace: nf-core
spec:
runtimeClassName: nvidia
containers:
- name: nvidia-smi
image: nvidia/cuda:12.6.3-devel-ubuntu24.04
imagePullPolicy: IfNotPresent
command: ["/usr/bin/nvidia-smi"]
resources:
limits:
nvidia.com/gpu: 2
Unfortunately I couldn’t find anything on the subject, neither in the documentation nor in the source code, where the pod related configuration seems to be limited to a few settings only: https://github.com/nextflow-io/nextflow/blob/6c0813765cbeb6ca54fcd1d9d2364b3e06ef472b/plugins/nf-k8s/src/main/nextflow/k8s/model/PodOptions.groovy
n
Hi, @Alessandro Pilotti! This looks like a general question and not something specific to an nf-core workflow. Please re-post your question on the Nextflow Community Forum - https://community.seqera.io 🎉
t
There is an #infrastructure-kubernetes channel over in the Nextflow Slack. 🤞
p
The
runtimeClassName
I don't think is possible to set from nextflow, is it needed for things to be picked up already? (I had some vague memory of it being possible to put arbitary spec additions in a map somehow but I don't see any such now.) As for the resource limits, that should be possible to get by specifying
accelerator
.
a
Thanks everyone! Going to bring this up in the k8s channel in the Nextflow slack as suggested
👍 1
Quick update, I sent a PR to the Nextflow repo to include the “runtimeClassName” setting as a pod option, which just merged upstream: https://github.com/nextflow-io/nextflow/pull/6633. Here’s a working minimal config example for usage of Nextflow with NVIDIA GPUs on a K8s cluster that requires to set the runtimeClassName:
Copy code
process {
    executor = 'k8s'

    accelerator {
        limit = 2
        type = "nvidia.com/gpu"
    }

    pod = [ runtimeClassName: 'nvidia' ]
}
🙏 1