From 8767f42370e99594a231d64baa877777ca6b0d06 Mon Sep 17 00:00:00 2001 From: TommyLike Date: Mon, 18 Mar 2019 14:50:46 +0800 Subject: [PATCH 1/2] Fix default queue not existing error --- hack/run-e2e.sh | 4 +++- test/e2e/util.go | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hack/run-e2e.sh b/hack/run-e2e.sh index a952c90798..48a06f828a 100755 --- a/hack/run-e2e.sh +++ b/hack/run-e2e.sh @@ -26,7 +26,9 @@ kubectl create -f hack/e2e-admission-config.yaml nohup ${VK_BIN}/vk-controllers --kubeconfig ${HOME}/.kube/config --master=${MASTER} --logtostderr --v ${LOG_LEVEL} > controller.log 2>&1 & # start scheduler -nohup ${VK_BIN}/vk-scheduler --kubeconfig ${HOME}/.kube/config --scheduler-conf=example/kube-batch-conf.yaml --master=${MASTER} --logtostderr --v ${LOG_LEVEL} > scheduler.log 2>&1 & +# NOTE(tommylikehu): Now we set default batch queue to 'test', it's SHOULD be updated once it's come to +# a conclusion how to handle the queue either in kube batch or volcano. +nohup ${VK_BIN}/vk-scheduler --kubeconfig ${HOME}/.kube/config --scheduler-conf=example/kube-batch-conf.yaml --master=${MASTER} --default-queue test --logtostderr --v ${LOG_LEVEL} > scheduler.log 2>&1 & # start admission-controller nohup ${VK_BIN}/vk-admission --tls-cert-file=${CERT_PATH}/apiserver.crt --tls-private-key-file=${CERT_PATH}/apiserver.key --kubeconfig ${HOME}/.kube/config --port ${HOSTPORT} --logtostderr --v ${LOG_LEVEL} > admission.log 2>&1 & diff --git a/test/e2e/util.go b/test/e2e/util.go index 61d7123b73..d9d6f4ec66 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -21,7 +21,6 @@ import ( "fmt" "os" "path/filepath" - "strconv" "strings" "time" @@ -105,7 +104,7 @@ type context struct { } func initTestContext() *context { - enableNamespaceAsQueue, _ := strconv.ParseBool(os.Getenv("ENABLE_NAMESPACES_AS_QUEUE")) + //enableNamespaceAsQueue, _ := strconv.ParseBool(os.Getenv("ENABLE_NAMESPACES_AS_QUEUE")) cxt := &context{ namespace: "test", queues: []string{"q1", "q2"}, @@ -130,7 +129,9 @@ func initTestContext() *context { Expect(err).NotTo(HaveOccurred(), "k8s cluster is required to have one ready worker node at least.") - cxt.enableNamespaceAsQueue = enableNamespaceAsQueue + //NOTE(tommylikehu):NamespaceAsQueue feature was removed from kube-batch, + //we will eventually remove this logic in test as well. + cxt.enableNamespaceAsQueue = false _, err = cxt.kubeclient.CoreV1().Namespaces().Create(&v1.Namespace{ ObjectMeta: metav1.ObjectMeta{ From 49eca26e5f05bf2f6d2e374e301d8e58349d095e Mon Sep 17 00:00:00 2001 From: TommyLike Date: Mon, 18 Mar 2019 15:32:32 +0800 Subject: [PATCH 2/2] Usine default queue --- hack/run-e2e.sh | 9 ++++---- .../volcano/templates/default-queue.yaml | 6 +++++ test/e2e/util.go | 22 ------------------- 3 files changed, 11 insertions(+), 26 deletions(-) create mode 100644 installer/chart/volcano/templates/default-queue.yaml diff --git a/hack/run-e2e.sh b/hack/run-e2e.sh index 48a06f828a..b0ade87292 100755 --- a/hack/run-e2e.sh +++ b/hack/run-e2e.sh @@ -20,15 +20,16 @@ sed -i "s|{{CA_BUNDLE}}|$CA_BUNDLE|g" hack/e2e-admission-config.yaml sed -i "s|{{host}}|${HOST}|g" hack/e2e-admission-config.yaml sed -i "s|{{hostPort}}|${HOSTPORT}|g" hack/e2e-admission-config.yaml -kubectl create -f hack/e2e-admission-config.yaml +kubectl apply -f hack/e2e-admission-config.yaml + +# Create default queue for tests +kubectl apply -f installer/chart/volcano/templates/default-queue.yaml # start controller nohup ${VK_BIN}/vk-controllers --kubeconfig ${HOME}/.kube/config --master=${MASTER} --logtostderr --v ${LOG_LEVEL} > controller.log 2>&1 & # start scheduler -# NOTE(tommylikehu): Now we set default batch queue to 'test', it's SHOULD be updated once it's come to -# a conclusion how to handle the queue either in kube batch or volcano. -nohup ${VK_BIN}/vk-scheduler --kubeconfig ${HOME}/.kube/config --scheduler-conf=example/kube-batch-conf.yaml --master=${MASTER} --default-queue test --logtostderr --v ${LOG_LEVEL} > scheduler.log 2>&1 & +nohup ${VK_BIN}/vk-scheduler --kubeconfig ${HOME}/.kube/config --scheduler-conf=example/kube-batch-conf.yaml --master=${MASTER} --logtostderr --v ${LOG_LEVEL} > scheduler.log 2>&1 & # start admission-controller nohup ${VK_BIN}/vk-admission --tls-cert-file=${CERT_PATH}/apiserver.crt --tls-private-key-file=${CERT_PATH}/apiserver.key --kubeconfig ${HOME}/.kube/config --port ${HOSTPORT} --logtostderr --v ${LOG_LEVEL} > admission.log 2>&1 & diff --git a/installer/chart/volcano/templates/default-queue.yaml b/installer/chart/volcano/templates/default-queue.yaml new file mode 100644 index 0000000000..3aa233f5db --- /dev/null +++ b/installer/chart/volcano/templates/default-queue.yaml @@ -0,0 +1,6 @@ +apiVersion: scheduling.incubator.k8s.io/v1alpha1 +kind: Queue +metadata: + name: default +spec: + weight: 1 diff --git a/test/e2e/util.go b/test/e2e/util.go index d9d6f4ec66..4ac3595efe 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -104,7 +104,6 @@ type context struct { } func initTestContext() *context { - //enableNamespaceAsQueue, _ := strconv.ParseBool(os.Getenv("ENABLE_NAMESPACES_AS_QUEUE")) cxt := &context{ namespace: "test", queues: []string{"q1", "q2"}, @@ -253,19 +252,6 @@ func createQueues(cxt *context) { Expect(err).NotTo(HaveOccurred()) } - - if !cxt.enableNamespaceAsQueue { - _, err := cxt.kbclient.SchedulingV1alpha1().Queues().Create(&kbv1.Queue{ - ObjectMeta: metav1.ObjectMeta{ - Name: cxt.namespace, - }, - Spec: kbv1.QueueSpec{ - Weight: 1, - }, - }) - - Expect(err).NotTo(HaveOccurred()) - } } func deleteQueues(cxt *context) { @@ -286,14 +272,6 @@ func deleteQueues(cxt *context) { Expect(err).NotTo(HaveOccurred()) } - - if !cxt.enableNamespaceAsQueue { - err := cxt.kbclient.SchedulingV1alpha1().Queues().Delete(cxt.namespace, &metav1.DeleteOptions{ - PropagationPolicy: &foreground, - }) - - Expect(err).NotTo(HaveOccurred()) - } } type taskSpec struct {