Support pod container (#19706)

* feat(region,scheduler,host): support pod and container

* feat(region,host): container nvidia gpu support

* fix(region,host): function parameters

---------

Co-authored-by: wanyaoqi <d3lx.yq@gmail.com>
This commit is contained in:
Zexi Li
2024-03-12 18:47:44 +08:00
committed by GitHub
co-authored by wanyaoqi
parent cf3d468814
commit 6313ce87a3
114 changed files with 43182 additions and 827 deletions
@@ -19,8 +19,8 @@ import (
"yunion.io/x/log"
computeapi "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/scheduler/algorithm/predicates"
"yunion.io/x/onecloud/pkg/scheduler/api"
"yunion.io/x/onecloud/pkg/scheduler/core"
"yunion.io/x/onecloud/pkg/scheduler/data_manager/schedtag"
)
@@ -56,7 +56,7 @@ func hostHasContainerTag(c core.Candidater) bool {
func hostAllowRunContainer(c core.Candidater) bool {
getter := c.Getter()
hostType := getter.HostType()
if hostType == api.HostTypeKubelet {
if hostType == computeapi.HOST_TYPE_CONTAINER {
return true
}
if hostHasContainerTag(c) {
@@ -73,7 +73,7 @@ func (f *HypervisorPredicate) Execute(ctx context.Context, u *core.Unit, c core.
guestNeedType := u.SchedData().Hypervisor
if guestNeedType != hostType {
if guestNeedType == api.SchedTypeContainer && hostAllowRunContainer(c) {
if guestNeedType == computeapi.HYPERVISOR_POD && hostAllowRunContainer(c) {
return h.GetResult()
}
h.Exclude2(f.Name(), hostType, guestNeedType)