diff --git a/CHANGLOG.md b/CHANGLOG.md index 66ab610d7..fc5695db1 100644 --- a/CHANGLOG.md +++ b/CHANGLOG.md @@ -1,3 +1,27 @@ +## v0.5 + +**Closed issues:** + +- master and worker start in order in a job [\#872](https://github.com/kubernetes-sigs/kube-batch/issues/872) +- use kubernetes default schedule policies [\#864](https://github.com/kubernetes-sigs/kube-batch/issues/864) +- v0.4 runtime panic [\#861](https://github.com/kubernetes-sigs/kube-batch/issues/861) +- Helm install fails [\#857](https://github.com/kubernetes-sigs/kube-batch/issues/857) +- "NewResource/Convert2K8sResource" behavior mismatch [\#851](https://github.com/kubernetes-sigs/kube-batch/issues/851) +- Phase of podgroup status looks incorrect [\#846](https://github.com/kubernetes-sigs/kube-batch/issues/846) +- Update API GroupName [\#815](https://github.com/kubernetes-sigs/kube-batch/issues/815) +- Migrate nodeorder and predicates plugins [\#814](https://github.com/kubernetes-sigs/kube-batch/issues/814) +- Add Configuration for predicate plugin to enable/disable predicates algorithm [\#802](https://github.com/kubernetes-sigs/kube-batch/issues/802) +- Consider support multi-containers pod error code handling [\#776](https://github.com/kubernetes-sigs/kube-batch/issues/776) +- Deserved attr is not correctly calculated in proportion plugin [\#729](https://github.com/kubernetes-sigs/kube-batch/issues/729) +- Keep backward compatibility for priority class [\#724](https://github.com/kubernetes-sigs/kube-batch/issues/724) +- Change return value of NodeOrderFn from int to float [\#708](https://github.com/kubernetes-sigs/kube-batch/issues/708) +- Add type Argument with some common parse function [\#704](https://github.com/kubernetes-sigs/kube-batch/issues/704) +- Replace NodeOrder with BestNode [\#699](https://github.com/kubernetes-sigs/kube-batch/issues/699) +- Support set default value to the configuration [\#695](https://github.com/kubernetes-sigs/kube-batch/issues/695) +- Add resource predicates for tasks [\#694](https://github.com/kubernetes-sigs/kube-batch/issues/694) +- Pass conformance test [\#589](https://github.com/kubernetes-sigs/kube-batch/issues/589) +- big PodGroup blocks scheduling issue [\#514](https://github.com/kubernetes-sigs/kube-batch/issues/514) + ## v0.4.2 ### Notes: diff --git a/Makefile b/Makefile index 0a0c3761f..dca5f968d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BIN_DIR=_output/bin -RELEASE_VER=v0.4.2 +RELEASE_VER=v0.5 REPO_PATH=github.com/kubernetes-sigs/kube-batch GitSHA=`git rev-parse HEAD` Date=`date "+%Y-%m-%d %H:%M:%S"` diff --git a/deployment/kube-batch/values.yaml b/deployment/kube-batch/values.yaml index e254e0936..c7aae018c 100644 --- a/deployment/kube-batch/values.yaml +++ b/deployment/kube-batch/values.yaml @@ -4,7 +4,7 @@ replicaCount: 1 image: repository: kubesigs - tag: v0.4.2 + tag: v0.5 pullPolicy: IfNotPresent resources: limits: diff --git a/doc/usage/tutorial.md b/doc/usage/tutorial.md index 8e8f1ba6c..6268e3783 100644 --- a/doc/usage/tutorial.md +++ b/doc/usage/tutorial.md @@ -14,7 +14,7 @@ To run `kube-batch`, a Kubernetes cluster must start up. Here is a document on [ ```bash # mkdir -p $GOPATH/src/github.com/kubernetes-sigs/ # cd $GOPATH/src/github.com/kubernetes-sigs/ -# git clone http://github.com/kubernetes-sigs/kube-batch -b v0.4.2 +# git clone http://github.com/kubernetes-sigs/kube-batch -b v0.5 ``` ### Deploy kube-batch by Helm @@ -164,7 +164,6 @@ apiVersion: scheduling.k8s.io/v1beta1 kind: PriorityClass metadata: name: high-priority - namespace: batch-ns01 value: 1000 ``` diff --git a/pkg/scheduler/api/node_info.go b/pkg/scheduler/api/node_info.go index d6e99f825..cb1acdd60 100644 --- a/pkg/scheduler/api/node_info.go +++ b/pkg/scheduler/api/node_info.go @@ -158,6 +158,18 @@ func (ni *NodeInfo) SetNode(node *v1.Node) { } } +func (ni *NodeInfo) allocateIdleResource(ti *TaskInfo) error { + if ti.Resreq.LessEqual(ni.Idle) { + ni.Idle.Sub(ti.Resreq) + return nil + } + ni.State = NodeState{ + Phase: NotReady, + Reason: "OutOfSync", + } + return fmt.Errorf("Selected node NotReady") +} + // AddTask is used to add a task in nodeInfo object func (ni *NodeInfo) AddTask(task *TaskInfo) error { key := PodKey(task.Pod) @@ -173,12 +185,16 @@ func (ni *NodeInfo) AddTask(task *TaskInfo) error { if ni.Node != nil { switch ti.Status { case Releasing: + if err := ni.allocateIdleResource(ti); err != nil { + return err + } ni.Releasing.Add(ti.Resreq) - ni.Idle.Sub(ti.Resreq) case Pipelined: ni.Releasing.Sub(ti.Resreq) default: - ni.Idle.Sub(ti.Resreq) + if err := ni.allocateIdleResource(ti); err != nil { + return err + } } ni.Used.Add(ti.Resreq) diff --git a/pkg/scheduler/api/node_info_test.go b/pkg/scheduler/api/node_info_test.go index ae08d4520..4ccbfb998 100644 --- a/pkg/scheduler/api/node_info_test.go +++ b/pkg/scheduler/api/node_info_test.go @@ -37,6 +37,9 @@ func TestNodeInfo_AddPod(t *testing.T) { case01Node := buildNode("n1", buildResourceList("8000m", "10G")) case01Pod1 := buildPod("c1", "p1", "n1", v1.PodRunning, buildResourceList("1000m", "1G"), []metav1.OwnerReference{}, make(map[string]string)) case01Pod2 := buildPod("c1", "p2", "n1", v1.PodRunning, buildResourceList("2000m", "2G"), []metav1.OwnerReference{}, make(map[string]string)) + // case2 + case02Node := buildNode("n2", buildResourceList("2000m", "1G")) + case02Pod1 := buildPod("c2", "p1", "n2", v1.PodUnknown, buildResourceList("1000m", "2G"), []metav1.OwnerReference{}, make(map[string]string)) tests := []struct { name string @@ -63,6 +66,22 @@ func TestNodeInfo_AddPod(t *testing.T) { }, }, }, + { + name: "add 1 unknown pod", + node: case02Node, + pods: []*v1.Pod{case02Pod1}, + expected: &NodeInfo{ + Name: "n2", + Node: case02Node, + Idle: buildResource("2000m", "1G"), + Used: EmptyResource(), + Releasing: EmptyResource(), + Allocatable: buildResource("2000m", "1G"), + Capability: buildResource("2000m", "1G"), + State: NodeState{Phase: NotReady, Reason: "OutOfSync"}, + Tasks: map[TaskID]*TaskInfo{}, + }, + }, } for i, test := range tests { diff --git a/test/kubemark/start-kubemark.sh b/test/kubemark/start-kubemark.sh index 67a25b49e..e7238b2a5 100755 --- a/test/kubemark/start-kubemark.sh +++ b/test/kubemark/start-kubemark.sh @@ -9,7 +9,7 @@ CRD_DIRECTORY="${VK_ROOT}/deployment/kube-batch/templates" QUEUE_DIR="${VK_ROOT}/config/queue" #Release version for kube batch -RELEASE_VER=v0.4.2 +RELEASE_VER=v0.5 #Ensure external cluster exists and kubectl binary works kubectl get nodes