Skip to content
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

Assign kubernetes node labels to rules #1278

Closed
cademirch opened this issue Nov 24, 2021 · 3 comments
Closed

Assign kubernetes node labels to rules #1278

cademirch opened this issue Nov 24, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@cademirch
Copy link
Contributor

cademirch commented Nov 24, 2021

Is your feature request related to a problem? Please describe.
It appears that when using the Kubernetes executor, the resource specification of machine_type is not respected. This is not nice when you want rules to use certain compute instances.

For example, in GKE I have node-pool-A with high-cpu machines for BWA-mem, and node-pool-B with smaller machines for GATK HaplotypeCaller. Because the BWA-mem rule requests more CPUs than the node-pool-B can provide, Kubernetes scales up node-pool-A and puts the pod there. However, when running the GATK rule, which requests only one CPU, Kubernetes can place the pod in either node-pool, which leads to an inefficient allocation of resources.

Describe the solution you'd like
Snakemake respect the machine_type resource specification.

Describe alternatives you've considered
It seems that the Kubernetes Python API does not have a direct way to specify a machine type when creating a pod (that I could find). However, using a nodeSelector, one could apply a node label to a node pool, and that node label could be used when creating a pod so that it will end up on the corresponding node.

Additional context
Add any other context or screenshots about the feature request here.

The solution I propose is to add a check for a resource called node_label somewhere here, and if it exists pass it to the V1PodSpec call.

I'm going to try and implement this solution this weekend, but would appreciate any feedback.

@cademirch cademirch added the enhancement New feature or request label Nov 24, 2021
@cademirch cademirch changed the title Assign kubernetes node labels to rules, Assign kubernetes node labels to rules Nov 24, 2021
@draeath
Copy link
Contributor

draeath commented Jan 29, 2022

I would also be interested in support for defining nodeSelectors.

For example, my k8s cluster is a mixed ARM64 and AMD64 cluster with autoscaling. I need snakemake to be able to tell kubernetes to require beta.kubernetes.io/arch: amd64

@cademirch
Copy link
Contributor Author

cademirch commented Jan 29, 2022

I would also be interested in support for defining nodeSelectors.

For example, my k8s cluster is a mixed ARM64 and AMD64 cluster with autoscaling. I need snakemake to be able to tell kubernetes to require beta.kubernetes.io/arch: amd64

#1291 Adds support for machine_type using the "node.kubernetes.io/instance-type" selector. I think it should be simple to add support for a resource node_selector to allow user specifed nodeSelectors.

@cademirch
Copy link
Contributor Author

Closed with #1291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants