Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): add performance tools #546

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f1dac6e
chore(test): add tool for get avg statistic from vd and vm
nevermarine Dec 2, 2024
214bcea
add vmDiskType to performance chart
nevermarine Dec 2, 2024
ac17def
chore: save to log file stats of vd and vms
universal-itengineer Dec 2, 2024
f7d600b
chore: fix yaml formatting
universal-itengineer Dec 2, 2024
c36d79d
chore: add option for vi-pvc
universal-itengineer Dec 3, 2024
fec0220
fix vm tracking
nevermarine Dec 3, 2024
141a06c
add evicter
nevermarine Dec 3, 2024
d4a579d
chore: fix vi template
universal-itengineer Dec 3, 2024
d5aa8b5
add start message to log
nevermarine Dec 3, 2024
20254c2
chore: template vi back to type vi
universal-itengineer Dec 3, 2024
633ab4b
chore: comment unnecessary packages in cloud init
universal-itengineer Dec 4, 2024
37f9856
chore: statistics Taskfile add variable for choose namespace
universal-itengineer Dec 4, 2024
86aa21b
chore: temporary rename file node-exporter-service, dont need service…
universal-itengineer Dec 4, 2024
66ddcb8
chore: disable tracking for deletion resourses
universal-itengineer Dec 4, 2024
5c97ea3
chore: common job
universal-itengineer Dec 4, 2024
cf34fdb
chore: add ns to name of log and csv files
universal-itengineer Dec 4, 2024
daf9fb6
chore: fix report vm
universal-itengineer Dec 5, 2024
a1a8037
chore: fix format data for csv files for make grafs in google sheets
universal-itengineer Dec 5, 2024
b5b00fb
chore: fix virtualization dashboard, add to several visualisations mi…
universal-itengineer Dec 9, 2024
baaae86
chore: add runPolicy to helm values; note for PhasesTransitions
universal-itengineer Dec 11, 2024
dbbc6ff
chore: fix taskfile for evicter, add funs for stop vm duration
universal-itengineer Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/performance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# performance helm chart
## values.yaml
- `vmDiskType`:
- `vi`: creates VMs with VirtualImage in `blockDeviceRefs`
- `vd`: creates VMs with corresponding `VirtualDisk`
- `viType`:
- `pvc`: create vi with persistentVolumeClaim type
42 changes: 22 additions & 20 deletions tests/performance/bootstrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,29 @@ function apply() {
function destroy() {
echo "Delete resources: ${RESOURCES}"

echo "$(date +"%Y-%m-%d %H:%M:%S") - Deleting release [${RELEASE_NAME}]"
helm uninstall "${RELEASE_NAME}" -n "${NAMESPACE}"

case "${RESOURCES}" in
"all")
kubectl wait -n "${NAMESPACE}" --for=delete vm -l vm="${RESOURCES_PREFIX}"
kubectl wait -n "${NAMESPACE}" --for=delete vd -l vm="${RESOURCES_PREFIX}"
kubectl wait -n "${NAMESPACE}" --for=delete vi -l vm="${RESOURCES_PREFIX}"
;;
"disks")
kubectl wait -n "${NAMESPACE}" --for=delete vd -l vm="${RESOURCES_PREFIX}"
kubectl wait -n "${NAMESPACE}" --for=delete vi -l vm="${RESOURCES_PREFIX}"
;;
"vms")
kubectl wait -n "${NAMESPACE}" --for=delete vm -l vm="${RESOURCES_PREFIX}"
;;
*)
echo "ERROR: Invalid argument"
usage
exit 1
;;
esac
echo "$(date +"%Y-%m-%d %H:%M:%S") - Release [${RELEASE_NAME}] was deleted"

# case "${RESOURCES}" in
# "all")
# kubectl wait -n "${NAMESPACE}" --for=delete vm -l vm="${RESOURCES_PREFIX}"
# kubectl wait -n "${NAMESPACE}" --for=delete vd -l vm="${RESOURCES_PREFIX}"
# kubectl wait -n "${NAMESPACE}" --for=delete vi -l vm="${RESOURCES_PREFIX}"
# ;;
# "disks")
# kubectl wait -n "${NAMESPACE}" --for=delete vd -l vm="${RESOURCES_PREFIX}"
# kubectl wait -n "${NAMESPACE}" --for=delete vi -l vm="${RESOURCES_PREFIX}"
# ;;
# "vms")
# kubectl wait -n "${NAMESPACE}" --for=delete vm -l vm="${RESOURCES_PREFIX}"
# ;;
# *)
# echo "ERROR: Invalid argument"
# usage
# exit 1
# ;;
# esac
}

if [ "$#" -eq 0 ] || [ "${1}" == "--help" ] ; then
Expand Down
20 changes: 20 additions & 0 deletions tests/performance/statistic/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3"

silent: true

vars:
NS: '{{ .NS | default "perf" }}'

tasks:
run:vd:
desc: "Run collect stat from vds"
cmds:
- go run cmd/stat/main.go -vd=true -ns={{.NS}}
run:vm:
desc: "Run collect stat from vms"
cmds:
- go run cmd/stat/main.go -vm=true -ns={{.NS}}
run:all:
desc: "Run collect stat from vds and vms"
cmds:
- go run cmd/stat/main.go -ns={{.NS}}
29 changes: 29 additions & 0 deletions tests/performance/statistic/cmd/stat/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"flag"

"statistic/internal/helpers"
"statistic/internal/vd"
"statistic/internal/vm"
)

func main() {
client := helpers.CreateKubeConfig()

namespace := flag.String("ns", "perf", "The namespace to look for the VMs or VDs, default 'perf'")
getVD := flag.Bool("vd", false, "Get VDs, default false")
getVM := flag.Bool("vm", false, "Get VMs, default false")
flag.Parse()

ns := *namespace

if *getVM {
vm.Get(client, ns)
} else if *getVD {
vd.Get(client, ns)
} else {
vm.Get(client, ns)
vd.Get(client, ns)
}
}
59 changes: 59 additions & 0 deletions tests/performance/statistic/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module statistic

go 1.22.7

require (
github.com/deckhouse/virtualization/api v0.0.0-20241127090731-4442a4cc1f93
k8s.io/apimachinery v0.31.3
k8s.io/client-go v0.31.3
)

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift/api v0.0.0-20230503133300-8bbcb7ca7183 // indirect
github.com/openshift/custom-resource-status v1.1.2 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.31.3 // indirect
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
kubevirt.io/api v1.0.0 // indirect
kubevirt.io/containerized-data-importer-api v1.57.0-alpha1 // indirect
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading
Loading