[
https://issues.apache.org/jira/browse/YUNIKORN-2271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17796961#comment-17796961
]
Weiwei Yang commented on YUNIKORN-2271:
---------------------------------------
Simple code to reproduce:
{code}
func TestGPUOnlyResources(t *testing.T) {
containers := make([]v1.Container, 0)
// container 01
c1Resources := make(map[v1.ResourceName]resource.Quantity)
c1Resources[v1.ResourceName("nvidia.com/gpu")] = resource.MustParse("1")
containers = append(containers, v1.Container{
Name: "container-01",
Resources: v1.ResourceRequirements{
Requests: c1Resources,
},
})
pod := &v1.Pod{
TypeMeta: apis.TypeMeta{
Kind: "Pod",
APIVersion: "v1",
},
ObjectMeta: apis.ObjectMeta{
Name: "pod-resource-test-00001",
UID: "UID-00001",
},
Spec: v1.PodSpec{
Containers: containers,
},
}
res := GetPodResource(pod)
fmt.Println(res.String())
}
{code}
> Incorrect handling of GPU only resources
> ----------------------------------------
>
> Key: YUNIKORN-2271
> URL: https://issues.apache.org/jira/browse/YUNIKORN-2271
> Project: Apache YuniKorn
> Issue Type: Bug
> Components: shim - kubernetes
> Reporter: Weiwei Yang
> Priority: Major
>
> https://github.com/apache/yunikorn-k8shim/blob/a118ba6c4d84804e2a407f9d91196ece4690cf09/pkg/common/resource.go#L61-L63
> this code seems to have a bug. When I define resource like this:
> {code}
> request:
> nvidia.com/gpu: 1
> limit:
> nvidia.com/gpu: 1
> {code}
> this is considered as QoS best effort and returned with just
> {code}
> Resources:
> pod:1
> {code}
> but I think this is a valid configuration that a pod only specifies GPU
> resource without memory or CPU.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]