This commit is contained in:
sanjeevm0 2018-02-14 17:23:01 -08:00
Родитель b12420e506 93547bfe01
Коммит 9cca96f2ef
134 изменённых файлов: 306 добавлений и 485 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -12,3 +12,7 @@
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/ .glide/
# output folders of binaries
_output

17
Makefile Normal file
Просмотреть файл

@ -0,0 +1,17 @@
BUILD_DIR ?= _output
.PHONY: all
all: clean kube-scheduler crishim
.PHONY: kube-scheduler
kube-scheduler:
go build -o ${BUILD_DIR}/kube-scheduler ./kube-scheduler/cmd/scheduler.go
.PHONY: crishim
crishim:
go build -o ${BUILD_DIR}/crishim ./crishim/cmd/crishim.go
.PHONY: clean
clean:
rm -rf ${BUILD_DIR}/*

Просмотреть файл

@ -1,51 +0,0 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kube-scheduler",
gc_linkopts = [
"-linkmode",
"external",
"-extldflags",
"-static",
],
importpath = "k8s.io/kubernetes/plugin/cmd/kube-scheduler",
library = ":go_default_library",
x_defs = version_x_defs(),
)
go_library(
name = "go_default_library",
srcs = ["scheduler.go"],
importpath = "k8s.io/kubernetes/plugin/cmd/kube-scheduler",
deps = [
"//pkg/client/metrics/prometheus:go_default_library",
"//pkg/version/prometheus:go_default_library",
"//plugin/cmd/kube-scheduler/app:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library",
"//vendor/k8s.io/apiserver/pkg/util/logs:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//plugin/cmd/kube-scheduler/app:all-srcs",
],
tags = ["automanaged"],
)

Просмотреть файл

@ -1,4 +0,0 @@
approvers:
- sig-scheduling-maintainers
reviewers:
- sig-scheduling

Просмотреть файл

@ -1,66 +0,0 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["server.go"],
importpath = "k8s.io/kubernetes/plugin/cmd/kube-scheduler/app",
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/componentconfig:go_default_library",
"//pkg/apis/componentconfig/v1alpha1:go_default_library",
"//pkg/client/leaderelectionconfig:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/features:go_default_library",
"//pkg/kubectl/cmd/util:go_default_library",
"//pkg/master/ports:go_default_library",
"//pkg/util/configz:go_default_library",
"//pkg/version:go_default_library",
"//pkg/version/verflag:go_default_library",
"//plugin/pkg/scheduler:go_default_library",
"//plugin/pkg/scheduler/algorithmprovider:go_default_library",
"//plugin/pkg/scheduler/api:go_default_library",
"//plugin/pkg/scheduler/api/latest:go_default_library",
"//plugin/pkg/scheduler/factory:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
"//vendor/github.com/spf13/cobra:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//vendor/k8s.io/apiserver/pkg/server/healthz:go_default_library",
"//vendor/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//vendor/k8s.io/client-go/informers:go_default_library",
"//vendor/k8s.io/client-go/informers/core/v1:go_default_library",
"//vendor/k8s.io/client-go/informers/storage/v1:go_default_library",
"//vendor/k8s.io/client-go/kubernetes:go_default_library",
"//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/tools/clientcmd:go_default_library",
"//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library",
"//vendor/k8s.io/client-go/tools/leaderelection:go_default_library",
"//vendor/k8s.io/client-go/tools/leaderelection/resourcelock:go_default_library",
"//vendor/k8s.io/client-go/tools/record:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)

83
crishim/cmd/crishim.go Normal file
Просмотреть файл

@ -0,0 +1,83 @@
package main
import (
"fmt"
"os"
"github.com/spf13/pflag"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/apiserver/pkg/util/flag"
"k8s.io/apiserver/pkg/util/logs"
kubeletapp "k8s.io/kubernetes/cmd/kubelet/app"
"k8s.io/kubernetes/cmd/kubelet/app/options"
"k8s.io/kubernetes/pkg/version/verflag"
"github.com/Microsoft/KubeGPU/crishim/pkg/kubegpucri"
)
// ====================
// Main
func die(err error) {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
func main() {
// construct KubeletFlags object and register command line flags mapping
kubeletFlags := options.NewKubeletFlags()
kubeletFlags.AddFlags(pflag.CommandLine)
// construct KubeletConfiguration object and register command line flags mapping
defaultConfig, err := options.NewKubeletConfiguration()
if err != nil {
die(err)
}
options.AddKubeletConfigFlags(pflag.CommandLine, defaultConfig)
// parse the command line flags into the respective objects
flag.InitFlags()
// initialize logging and defer flush
logs.InitLogs()
defer logs.FlushLogs()
// short-circuit on verflag
verflag.PrintAndExitIfRequested()
// TODO(mtaufen): won't need this this once dynamic config is GA
// set feature gates so we can check if dynamic config is enabled
if err := utilfeature.DefaultFeatureGate.SetFromMap(defaultConfig.FeatureGates); err != nil {
die(err)
}
// validate the initial KubeletFlags, to make sure the dynamic-config-related flags aren't used unless the feature gate is on
if err := options.ValidateKubeletFlags(kubeletFlags); err != nil {
die(err)
}
// bootstrap the kubelet config controller, app.BootstrapKubeletConfigController will check
// feature gates and only turn on relevant parts of the controller
kubeletConfig, _, err := kubeletapp.BootstrapKubeletConfigController(
defaultConfig, kubeletFlags.InitConfigDir, kubeletFlags.DynamicConfigDir)
if err != nil {
die(err)
}
// construct a KubeletServer from kubeletFlags and kubeletConfig
kubeletServer := &options.KubeletServer{
KubeletFlags: *kubeletFlags,
KubeletConfiguration: *kubeletConfig,
}
done := make(chan bool)
// start the device manager
da, err := kubegpucri.StartDeviceManager(kubeletServer, done)
if err != nil {
die(err)
}
// run the gpushim
if err := kubegpucri.DockerGPUInit(kubeletFlags, kubeletConfig, da.KubeClient, da.DevMgr); err != nil {
die(err)
}
<-done // wait forever
done <- true
}

Просмотреть файл

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/Microsoft/KubeGPU/device" "github.com/Microsoft/KubeGPU/gpuextension/device"
"github.com/Microsoft/KubeGPU/kubeinterface" "github.com/Microsoft/KubeGPU/kubeinterface"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"

Просмотреть файл

@ -1,26 +1,21 @@
package main package kubegpucri
import ( import (
"fmt" "fmt"
"net" "net"
"net/http" "net/http"
"os"
"regexp" "regexp"
"strconv" "strconv"
"github.com/Microsoft/KubeGPU/device" "github.com/Microsoft/KubeGPU/gpuextension/device"
"github.com/Microsoft/KubeGPU/kubeinterface" "github.com/Microsoft/KubeGPU/kubeinterface"
"github.com/Microsoft/KubeGPU/cri/kubeadvertise" "github.com/Microsoft/KubeGPU/crishim/pkg/kubeadvertise"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
"github.com/golang/glog" "github.com/golang/glog"
"github.com/spf13/pflag"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilnet "k8s.io/apimachinery/pkg/util/net" utilnet "k8s.io/apimachinery/pkg/util/net"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/apiserver/pkg/util/flag"
"k8s.io/apiserver/pkg/util/logs"
clientset "k8s.io/client-go/kubernetes" clientset "k8s.io/client-go/kubernetes"
kubeletapp "k8s.io/kubernetes/cmd/kubelet/app" kubeletapp "k8s.io/kubernetes/cmd/kubelet/app"
"k8s.io/kubernetes/cmd/kubelet/app/options" "k8s.io/kubernetes/cmd/kubelet/app/options"
@ -32,7 +27,6 @@ import (
"k8s.io/kubernetes/pkg/kubelet/server/streaming" "k8s.io/kubernetes/pkg/kubelet/server/streaming"
kubelettypes "k8s.io/kubernetes/pkg/kubelet/types" kubelettypes "k8s.io/kubernetes/pkg/kubelet/types"
nodeutil "k8s.io/kubernetes/pkg/util/node" nodeutil "k8s.io/kubernetes/pkg/util/node"
"k8s.io/kubernetes/pkg/version/verflag"
) )
// implementation of runtime service -- have to implement entire docker service // implementation of runtime service -- have to implement entire docker service
@ -59,7 +53,7 @@ func (d *dockerGPUService) modifyContainerConfig(pod *types.PodInfo, cont *types
isNvidiaDevice = true isNvidiaDevice = true
numRequestedGPU++ numRequestedGPU++
} }
if !isNvidiaDevice || 0==numAllocateFrom { if !isNvidiaDevice || 0 == numAllocateFrom {
newDevices = append(newDevices, oldDevice) newDevices = append(newDevices, oldDevice)
} }
} }
@ -243,69 +237,3 @@ func DockerGPUInit(f *options.KubeletFlags, c *kubeletconfig.KubeletConfiguratio
return s.ListenAndServe() return s.ListenAndServe()
} }
} }
// ====================
// Main
func die(err error) {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
func main() {
// construct KubeletFlags object and register command line flags mapping
kubeletFlags := options.NewKubeletFlags()
kubeletFlags.AddFlags(pflag.CommandLine)
// construct KubeletConfiguration object and register command line flags mapping
defaultConfig, err := options.NewKubeletConfiguration()
if err != nil {
die(err)
}
options.AddKubeletConfigFlags(pflag.CommandLine, defaultConfig)
// parse the command line flags into the respective objects
flag.InitFlags()
// initialize logging and defer flush
logs.InitLogs()
defer logs.FlushLogs()
// short-circuit on verflag
verflag.PrintAndExitIfRequested()
// TODO(mtaufen): won't need this this once dynamic config is GA
// set feature gates so we can check if dynamic config is enabled
if err := utilfeature.DefaultFeatureGate.SetFromMap(defaultConfig.FeatureGates); err != nil {
die(err)
}
// validate the initial KubeletFlags, to make sure the dynamic-config-related flags aren't used unless the feature gate is on
if err := options.ValidateKubeletFlags(kubeletFlags); err != nil {
die(err)
}
// bootstrap the kubelet config controller, app.BootstrapKubeletConfigController will check
// feature gates and only turn on relevant parts of the controller
kubeletConfig, _, err := kubeletapp.BootstrapKubeletConfigController(
defaultConfig, kubeletFlags.InitConfigDir, kubeletFlags.DynamicConfigDir)
if err != nil {
die(err)
}
// construct a KubeletServer from kubeletFlags and kubeletConfig
kubeletServer := &options.KubeletServer{
KubeletFlags: *kubeletFlags,
KubeletConfiguration: *kubeletConfig,
}
done := make(chan bool)
// start the device manager
da, err := StartDeviceManager(kubeletServer, done)
if err != nil {
die(err)
}
// run the gpushim
if err := DockerGPUInit(kubeletFlags, kubeletConfig, da.KubeClient, da.DevMgr); err != nil {
die(err)
}
<-done // wait forever
done <- true
}

Просмотреть файл

@ -3,7 +3,7 @@ package device
import ( import (
"reflect" "reflect"
"github.com/Microsoft/KubeGPU/gpu/nvidia" "github.com/Microsoft/KubeGPU/gpuextension/gpu/nvidia"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -3,7 +3,7 @@ package device
import ( import (
"reflect" "reflect"
"github.com/Microsoft/KubeGPU/gpu/nvidia" "github.com/Microsoft/KubeGPU/gpuextension/gpu/nvidia"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -14,7 +14,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/Microsoft/KubeGPU/grpalloc" "github.com/Microsoft/KubeGPU/gpuextension/grpalloc"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
"github.com/Microsoft/KubeGPU/utils" "github.com/Microsoft/KubeGPU/utils"
"github.com/golang/glog" "github.com/golang/glog"

Просмотреть файл

@ -4,7 +4,7 @@ import (
"regexp" "regexp"
"strconv" "strconv"
"github.com/Microsoft/KubeGPU/grpalloc/resource" "github.com/Microsoft/KubeGPU/gpuextension/grpalloc/resource"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -6,7 +6,7 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/Microsoft/KubeGPU/grpalloc/resource" "github.com/Microsoft/KubeGPU/gpuextension/grpalloc/resource"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
"github.com/golang/glog" "github.com/golang/glog"

Просмотреть файл

@ -3,8 +3,8 @@ package nvidia
import ( import (
"fmt" "fmt"
"github.com/Microsoft/KubeGPU/gpu" "github.com/Microsoft/KubeGPU/gpuextension/gpu"
"github.com/Microsoft/KubeGPU/grpalloc" "github.com/Microsoft/KubeGPU/gpuextension/grpalloc"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

Просмотреть файл

@ -3,8 +3,8 @@ package grpalloc
import ( import (
"regexp" "regexp"
"github.com/Microsoft/KubeGPU/grpalloc/resource" "github.com/Microsoft/KubeGPU/gpuextension/grpalloc/resource"
"github.com/Microsoft/KubeGPU/grpalloc/scorer" "github.com/Microsoft/KubeGPU/gpuextension/grpalloc/scorer"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
"github.com/Microsoft/KubeGPU/utils" "github.com/Microsoft/KubeGPU/utils"
"github.com/golang/glog" "github.com/golang/glog"

Просмотреть файл

@ -3,7 +3,7 @@ package scorer
import ( import (
"math" "math"
resourcefn "github.com/Microsoft/KubeGPU/grpalloc/resource" resourcefn "github.com/Microsoft/KubeGPU/gpuextension/grpalloc/resource"
"github.com/Microsoft/KubeGPU/types" "github.com/Microsoft/KubeGPU/types"
) )

Просмотреть файл

Просмотреть файл

@ -1 +1 @@
find . -name '*.go' -exec sed -i 's?k8s.io/kubernetes/plugin/cmd/kube-scheduler?github.com/KubeGPU/cmd/kube-scheduler?g' {} + find . -name '*.go' -exec sed -i 's?k8s.io/kubernetes/plugin/cmd/kube-scheduler?github.com/KubeGPU/kube-scheduler/cmd?g' {} +

Просмотреть файл

@ -1 +1 @@
find . -name '*.go' -exec sed -i 's?k8s.io/kubernetes/plugin/pkg/scheduler?github.com/KubeGPU/scheduler?g' {} + find . -name '*.go' -exec sed -i 's?k8s.io/kubernetes/plugin/pkg/scheduler?github.com/KubeGPU/kube-scheduler/pkg?g' {} +

3
kube-scheduler/Makefile Normal file
Просмотреть файл

@ -0,0 +1,3 @@
.PHONY: kube-scheduler
kube-scheduler:
go build -o ../_output/kube-scheduler ./cmd/scheduler.go

Просмотреть файл

@ -30,6 +30,10 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithmprovider"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
latestschedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api/latest"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
@ -60,12 +64,8 @@ import (
"k8s.io/kubernetes/pkg/util/configz" "k8s.io/kubernetes/pkg/util/configz"
"k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/version"
"k8s.io/kubernetes/pkg/version/verflag" "k8s.io/kubernetes/pkg/version/verflag"
"github.com/Microsoft/KubeGPU/scheduler"
"github.com/Microsoft/KubeGPU/scheduler/algorithmprovider"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
latestschedulerapi "github.com/Microsoft/KubeGPU/scheduler/api/latest"
"github.com/Microsoft/KubeGPU/scheduler/factory" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/factory"
"github.com/golang/glog" "github.com/golang/glog"
"github.com/spf13/cobra" "github.com/spf13/cobra"

Просмотреть файл

@ -22,11 +22,11 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
"github.com/Microsoft/KubeGPU/kube-scheduler/cmd/app"
utilflag "k8s.io/apiserver/pkg/util/flag" utilflag "k8s.io/apiserver/pkg/util/flag"
"k8s.io/apiserver/pkg/util/logs" "k8s.io/apiserver/pkg/util/logs"
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
_ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration _ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration
"github.com/Microsoft/KubeGPU/cmd/kube-scheduler/app"
) )
func main() { func main() {

Просмотреть файл

Просмотреть файл

@ -16,5 +16,4 @@ limitations under the License.
// Package scheduler contains a generic Scheduler interface and several // Package scheduler contains a generic Scheduler interface and several
// implementations. // implementations.
package algorithm // import "github.com/Microsoft/KubeGPU/scheduler/algorithm" package algorithm // import "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"

Просмотреть файл

@ -1,9 +1,9 @@
package predicates package predicates
import ( import (
"github.com/Microsoft/KubeGPU/device" "github.com/Microsoft/KubeGPU/gpuextension/device"
"github.com/Microsoft/KubeGPU/scheduler/algorithm" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
) )

Просмотреть файл

@ -20,11 +20,11 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
schedutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/util"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
schedutil "github.com/Microsoft/KubeGPU/scheduler/util"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -23,6 +23,10 @@ import (
"strconv" "strconv"
"sync" "sync"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
priorityutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/priorities/util"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
schedutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/util"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1" storagev1 "k8s.io/api/storage/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors" apierrors "k8s.io/apimachinery/pkg/api/errors"
@ -39,13 +43,9 @@ import (
"k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/features"
kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis" kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis"
volumeutil "k8s.io/kubernetes/pkg/volume/util" volumeutil "k8s.io/kubernetes/pkg/volume/util"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
priorityutil "github.com/Microsoft/KubeGPU/scheduler/algorithm/priorities/util"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
schedutil "github.com/Microsoft/KubeGPU/scheduler/util"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/volumebinder"
"github.com/golang/glog" "github.com/golang/glog"
"github.com/Microsoft/KubeGPU/scheduler/volumebinder"
) )
const ( const (

Просмотреть файл

@ -21,16 +21,16 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
schedulertesting "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/testing"
schedutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/util"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilfeature "k8s.io/apiserver/pkg/util/feature" utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
v1helper "k8s.io/kubernetes/pkg/api/v1/helper" v1helper "k8s.io/kubernetes/pkg/api/v1/helper"
kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis" kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
schedulertesting "github.com/Microsoft/KubeGPU/scheduler/testing"
schedutil "github.com/Microsoft/KubeGPU/scheduler/util"
) )
type FakeNodeInfo v1.Node type FakeNodeInfo v1.Node

Просмотреть файл

@ -21,12 +21,12 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
schedutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/util"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
schedutil "github.com/Microsoft/KubeGPU/scheduler/util"
) )
// FindLabelsInSet gets as many key/value pairs as possible out of a label set. // FindLabelsInSet gets as many key/value pairs as possible out of a label set.

Просмотреть файл

@ -20,10 +20,10 @@ import (
"fmt" "fmt"
"math" "math"
priorityutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/priorities/util"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
priorityutil "github.com/Microsoft/KubeGPU/scheduler/algorithm/priorities/util"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -20,11 +20,11 @@ import (
"reflect" "reflect"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func TestBalancedResourceAllocation(t *testing.T) { func TestBalancedResourceAllocation(t *testing.T) {

Просмотреть файл

@ -19,9 +19,9 @@ package priorities
import ( import (
"fmt" "fmt"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
// ImageLocalityPriorityMap is a priority function that favors nodes that already have requested pod container's images. // ImageLocalityPriorityMap is a priority function that favors nodes that already have requested pod container's images.

Просмотреть файл

@ -21,10 +21,10 @@ import (
"sort" "sort"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func TestImageLocalityPriority(t *testing.T) { func TestImageLocalityPriority(t *testing.T) {

Просмотреть файл

@ -20,16 +20,16 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/predicates"
priorityutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/priorities/util"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors" apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/util/workqueue" "k8s.io/client-go/util/workqueue"
kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis" kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
"github.com/Microsoft/KubeGPU/scheduler/algorithm/predicates"
priorityutil "github.com/Microsoft/KubeGPU/scheduler/algorithm/priorities/util"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -21,12 +21,12 @@ import (
"reflect" "reflect"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
schedulertesting "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilfeature "k8s.io/apiserver/pkg/util/feature" utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
schedulertesting "github.com/Microsoft/KubeGPU/scheduler/testing"
) )
type FakeNodeListInfo []*v1.Node type FakeNodeListInfo []*v1.Node

Просмотреть файл

@ -19,9 +19,9 @@ package priorities
import ( import (
"fmt" "fmt"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -20,11 +20,11 @@ import (
"reflect" "reflect"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func TestLeastRequested(t *testing.T) { func TestLeastRequested(t *testing.T) {

Просмотреть файл

@ -17,11 +17,11 @@ limitations under the License.
package priorities package priorities
import ( import (
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
type PriorityMetadataFactory struct { type PriorityMetadataFactory struct {

Просмотреть файл

@ -20,11 +20,11 @@ import (
"reflect" "reflect"
"testing" "testing"
priorityutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/priorities/util"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
priorityutil "github.com/Microsoft/KubeGPU/scheduler/algorithm/priorities/util"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func TestPriorityMetadata(t *testing.T) { func TestPriorityMetadata(t *testing.T) {

Просмотреть файл

@ -19,9 +19,9 @@ package priorities
import ( import (
"fmt" "fmt"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -20,11 +20,11 @@ import (
"reflect" "reflect"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func TestMostRequested(t *testing.T) { func TestMostRequested(t *testing.T) {

Просмотреть файл

@ -19,11 +19,11 @@ package priorities
import ( import (
"fmt" "fmt"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
// CalculateNodeAffinityPriority prioritizes nodes according to node affinity scheduling preferences // CalculateNodeAffinityPriority prioritizes nodes according to node affinity scheduling preferences

Просмотреть файл

@ -20,11 +20,11 @@ import (
"reflect" "reflect"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilfeature "k8s.io/apiserver/pkg/util/feature" utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func TestNodeAffinityPriority(t *testing.T) { func TestNodeAffinityPriority(t *testing.T) {

Просмотреть файл

@ -19,11 +19,11 @@ package priorities
import ( import (
"fmt" "fmt"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
type NodeLabelPrioritizer struct { type NodeLabelPrioritizer struct {

Просмотреть файл

@ -21,10 +21,10 @@ import (
"sort" "sort"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func TestNewNodeLabelPriority(t *testing.T) { func TestNewNodeLabelPriority(t *testing.T) {

Просмотреть файл

@ -19,11 +19,11 @@ package priorities
import ( import (
"fmt" "fmt"
priorityutil "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/priorities/util"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
priorityutil "github.com/Microsoft/KubeGPU/scheduler/algorithm/priorities/util"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func CalculateNodePreferAvoidPodsPriorityMap(pod *v1.Pod, meta interface{}, nodeInfo *schedulercache.NodeInfo) (schedulerapi.HostPriority, error) { func CalculateNodePreferAvoidPodsPriorityMap(pod *v1.Pod, meta interface{}, nodeInfo *schedulercache.NodeInfo) (schedulerapi.HostPriority, error) {

Просмотреть файл

@ -21,10 +21,10 @@ import (
"sort" "sort"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func TestNodePreferAvoidPriority(t *testing.T) { func TestNodePreferAvoidPriority(t *testing.T) {

Просмотреть файл

@ -17,10 +17,10 @@ limitations under the License.
package priorities package priorities
import ( import (
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
// NormalizeReduce generates a PriorityReduceFunction that can normalize the result // NormalizeReduce generates a PriorityReduceFunction that can normalize the result

Просмотреть файл

@ -19,10 +19,10 @@ package priorities
import ( import (
"fmt" "fmt"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -19,12 +19,12 @@ package priorities
import ( import (
"fmt" "fmt"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
utilnode "k8s.io/kubernetes/pkg/util/node" utilnode "k8s.io/kubernetes/pkg/util/node"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
"github.com/golang/glog" "github.com/golang/glog"
) )

Просмотреть файл

@ -21,14 +21,14 @@ import (
"sort" "sort"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
schedulertesting "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
apps "k8s.io/kubernetes/pkg/apis/apps/v1beta1" apps "k8s.io/kubernetes/pkg/apis/apps/v1beta1"
extensions "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" extensions "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis" kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
schedulertesting "github.com/Microsoft/KubeGPU/scheduler/testing"
) )
func controllerRef(kind, name, uid string) []metav1.OwnerReference { func controllerRef(kind, name, uid string) []metav1.OwnerReference {

Просмотреть файл

@ -19,10 +19,10 @@ package priorities
import ( import (
"fmt" "fmt"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
// CountIntolerableTaintsPreferNoSchedule gives the count of intolerable taints of a pod with effect PreferNoSchedule // CountIntolerableTaintsPreferNoSchedule gives the count of intolerable taints of a pod with effect PreferNoSchedule

Просмотреть файл

@ -20,10 +20,10 @@ import (
"reflect" "reflect"
"testing" "testing"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func nodeWithTaints(nodeName string, taints []v1.Taint) *v1.Node { func nodeWithTaints(nodeName string, taints []v1.Taint) *v1.Node {

Просмотреть файл

@ -17,12 +17,12 @@ limitations under the License.
package priorities package priorities
import ( import (
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
func makeNode(node string, milliCPU, memory int64) *v1.Node { func makeNode(node string, milliCPU, memory int64) *v1.Node {

Просмотреть файл

@ -17,9 +17,9 @@ limitations under the License.
package algorithm package algorithm
import ( import (
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
// SchedulerExtender is an interface for external processes to influence scheduling // SchedulerExtender is an interface for external processes to influence scheduling

Просмотреть файл

@ -17,12 +17,12 @@ limitations under the License.
package algorithm package algorithm
import ( import (
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
apps "k8s.io/api/apps/v1beta1" apps "k8s.io/api/apps/v1beta1"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1" extensions "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
// FitPredicate is a function that indicates if a pod fits into an existing node. // FitPredicate is a function that indicates if a pod fits into an existing node.

Просмотреть файл

@ -19,9 +19,9 @@ package algorithm
import ( import (
"testing" "testing"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
// EmptyMetadataProducer should returns a no-op MetadataProducer type. // EmptyMetadataProducer should returns a no-op MetadataProducer type.

Просмотреть файл

@ -23,6 +23,9 @@ import (
"net/http/httptest" "net/http/httptest"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
latestschedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api/latest"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/factory"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
@ -31,9 +34,6 @@ import (
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset" "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions" informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
latestschedulerapi "github.com/Microsoft/KubeGPU/scheduler/api/latest"
"github.com/Microsoft/KubeGPU/scheduler/factory"
) )
func TestCompatibility_v1_Scheduler(t *testing.T) { func TestCompatibility_v1_Scheduler(t *testing.T) {

Просмотреть файл

@ -20,12 +20,12 @@ import (
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
utilfeature "k8s.io/apiserver/pkg/util/feature" utilfeature "k8s.io/apiserver/pkg/util/feature"
"github.com/Microsoft/KubeGPU/device" "github.com/Microsoft/KubeGPU/gpuextension/device"
"github.com/Microsoft/KubeGPU/scheduler/algorithm" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
"github.com/Microsoft/KubeGPU/scheduler/algorithm/predicates" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/predicates"
"github.com/Microsoft/KubeGPU/scheduler/algorithm/priorities" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/priorities"
"github.com/Microsoft/KubeGPU/scheduler/core" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/core"
"github.com/Microsoft/KubeGPU/scheduler/factory" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/factory"
"k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/features"
"github.com/golang/glog" "github.com/golang/glog"

Просмотреть файл

@ -17,7 +17,7 @@ limitations under the License.
package algorithmprovider package algorithmprovider
import ( import (
"github.com/Microsoft/KubeGPU/scheduler/algorithmprovider/defaults" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithmprovider/defaults"
) )
// ApplyFeatureGates applies algorithm by feature gates. // ApplyFeatureGates applies algorithm by feature gates.

Просмотреть файл

@ -19,7 +19,7 @@ package algorithmprovider
import ( import (
"testing" "testing"
"github.com/Microsoft/KubeGPU/scheduler/factory" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/factory"
) )
var ( var (

Просмотреть файл

Просмотреть файл

@ -17,4 +17,4 @@ limitations under the License.
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// Package api contains scheduler plugin API objects. // Package api contains scheduler plugin API objects.
package api // import "github.com/Microsoft/KubeGPU/scheduler/api" package api // import "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"

Просмотреть файл

Просмотреть файл

@ -17,12 +17,12 @@ limitations under the License.
package latest package latest
import ( import (
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
_ "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/apimachinery/pkg/runtime/serializer/json"
"k8s.io/apimachinery/pkg/runtime/serializer/versioning" "k8s.io/apimachinery/pkg/runtime/serializer/versioning"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
_ "github.com/Microsoft/KubeGPU/scheduler/api/v1"
) )
// Version is the string that represents the current external default version. // Version is the string that represents the current external default version.

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -17,4 +17,4 @@ limitations under the License.
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// Package v1 contains scheduler plugin API objects. // Package v1 contains scheduler plugin API objects.
package v1 // import "github.com/Microsoft/KubeGPU/scheduler/api/v1" package v1 // import "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api/v1"

Просмотреть файл

@ -17,9 +17,9 @@ limitations under the License.
package v1 package v1
import ( import (
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
) )
// SchemeGroupVersion is group version used to register these objects // SchemeGroupVersion is group version used to register these objects

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -19,8 +19,8 @@ package validation
import ( import (
"fmt" "fmt"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
utilerrors "k8s.io/apimachinery/pkg/util/errors" utilerrors "k8s.io/apimachinery/pkg/util/errors"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
) )
// ValidatePolicy checks for errors in the Config // ValidatePolicy checks for errors in the Config

Просмотреть файл

@ -19,7 +19,7 @@ package validation
import ( import (
"testing" "testing"
"github.com/Microsoft/KubeGPU/scheduler/api" "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
) )
func TestValidatePriorityWithNoWeight(t *testing.T) { func TestValidatePriorityWithNoWeight(t *testing.T) {

Просмотреть файл

Просмотреть файл

@ -20,10 +20,10 @@ import (
"hash/fnv" "hash/fnv"
"sync" "sync"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
hashutil "k8s.io/kubernetes/pkg/util/hash" hashutil "k8s.io/kubernetes/pkg/util/hash"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
"github.com/golang/glog" "github.com/golang/glog"
"github.com/golang/groupcache/lru" "github.com/golang/groupcache/lru"

Просмотреть файл

@ -20,11 +20,11 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm/predicates"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
"github.com/Microsoft/KubeGPU/scheduler/algorithm/predicates"
) )
func TestUpdateCachedPredicateItem(t *testing.T) { func TestUpdateCachedPredicateItem(t *testing.T) {

Просмотреть файл

@ -24,12 +24,12 @@ import (
"strings" "strings"
"time" "time"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/kube-scheduler/pkg/api"
"github.com/Microsoft/KubeGPU/kube-scheduler/pkg/schedulercache"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
utilnet "k8s.io/apimachinery/pkg/util/net" utilnet "k8s.io/apimachinery/pkg/util/net"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
"github.com/Microsoft/KubeGPU/scheduler/algorithm"
schedulerapi "github.com/Microsoft/KubeGPU/scheduler/api"
"github.com/Microsoft/KubeGPU/scheduler/schedulercache"
) )
const ( const (

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше