From 8337f8e77fa9cf22dcd105c0382d20211e8bec67 Mon Sep 17 00:00:00 2001 From: wusamzong Date: Fri, 10 Nov 2023 14:34:46 +0800 Subject: [PATCH 1/3] [YUNIKORN-2037] Testing the performance of Throughput --- deployments/kwok-perf-test/kwok-setup.sh | 76 +++++++++++ .../kwok-perf-test/throughput/deploy-tool.sh | 121 ++++++++++++++++++ 2 files changed, 197 insertions(+) create mode 100755 deployments/kwok-perf-test/kwok-setup.sh create mode 100755 deployments/kwok-perf-test/throughput/deploy-tool.sh diff --git a/deployments/kwok-perf-test/kwok-setup.sh b/deployments/kwok-perf-test/kwok-setup.sh new file mode 100755 index 000000000..558524b8e --- /dev/null +++ b/deployments/kwok-perf-test/kwok-setup.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if [ $# -eq 0 ]; then + echo "Error: Please provide the number of nodes to create." + echo "Usage: $0 " + exit 1 +fi + +KWOK_REPO=kubernetes-sigs/kwok +KWOK_LATEST_RELEASE=$(curl "https://api.github.com/repos/${KWOK_REPO}/releases/latest" | jq -r '.tag_name') +kubectl apply -f "https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/kwok.yaml" +kubectl apply -f "https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/stage-fast.yaml" + +for (( i=0;i<$1; i++)) +do + kubectl apply -f - <] + +Options: + -d, --delete Delete the specified number of deployments. + -i, --interval Set the interval between deployments in seconds. + +Arguments: + Number of deployments to create or delete (required). + Number of replicas for each deployment (required). +EOF +} + +deploy_deployments() { + for (( i=0; i<$deployment_count; i++ )); do + kubectl apply -f - < Date: Fri, 10 Nov 2023 14:46:09 +0800 Subject: [PATCH 2/3] fix shell check --- deployments/kwok-perf-test/throughput/deploy-tool.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deployments/kwok-perf-test/throughput/deploy-tool.sh b/deployments/kwok-perf-test/throughput/deploy-tool.sh index d2c5a1c75..64bb64fde 100755 --- a/deployments/kwok-perf-test/throughput/deploy-tool.sh +++ b/deployments/kwok-perf-test/throughput/deploy-tool.sh @@ -32,7 +32,7 @@ EOF } deploy_deployments() { - for (( i=0; i<$deployment_count; i++ )); do + for (( i=0; i Date: Mon, 4 Dec 2023 12:19:35 +0800 Subject: [PATCH 3/3] add newline at the end of kwok-setup.sh & remove a separate directory --- deployments/kwok-perf-test/{throughput => }/deploy-tool.sh | 0 deployments/kwok-perf-test/kwok-setup.sh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename deployments/kwok-perf-test/{throughput => }/deploy-tool.sh (100%) diff --git a/deployments/kwok-perf-test/throughput/deploy-tool.sh b/deployments/kwok-perf-test/deploy-tool.sh similarity index 100% rename from deployments/kwok-perf-test/throughput/deploy-tool.sh rename to deployments/kwok-perf-test/deploy-tool.sh diff --git a/deployments/kwok-perf-test/kwok-setup.sh b/deployments/kwok-perf-test/kwok-setup.sh index 558524b8e..6e5288838 100755 --- a/deployments/kwok-perf-test/kwok-setup.sh +++ b/deployments/kwok-perf-test/kwok-setup.sh @@ -73,4 +73,4 @@ do systemUUID: "" phase: Running EOF -done \ No newline at end of file +done