Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #886 from kubernetes-sigs/master
Browse files Browse the repository at this point in the history
Merge from master to release-0.5 branch
  • Loading branch information
k8s-ci-robot authored Jul 25, 2019
2 parents d8c01d6 + 60060fd commit 010ef71
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 7 deletions.
24 changes: 24 additions & 0 deletions CHANGLOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion deployment/kube-batch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
replicaCount: 1
image:
repository: kubesigs
tag: v0.4.2
tag: v0.5
pullPolicy: IfNotPresent
resources:
limits:
Expand Down
3 changes: 1 addition & 2 deletions doc/usage/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -164,7 +164,6 @@ apiVersion: scheduling.k8s.io/v1beta1
kind: PriorityClass
metadata:
name: high-priority
namespace: batch-ns01
value: 1000
```

Expand Down
20 changes: 18 additions & 2 deletions pkg/scheduler/api/node_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
19 changes: 19 additions & 0 deletions pkg/scheduler/api/node_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion test/kubemark/start-kubemark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 010ef71

Please sign in to comment.