benchmark-integration.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. # Copyright 2014 The Kubernetes Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -o errexit
  16. set -o nounset
  17. set -o pipefail
  18. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
  19. BENCHMARK_REGEX=${BENCHMARK_REGEX:-"."}
  20. source "${KUBE_ROOT}/hack/lib/init.sh"
  21. cleanup() {
  22. kube::etcd::cleanup
  23. kube::log::status "Benchmark cleanup complete"
  24. }
  25. ARGS="-bench-pods 3000 -bench-tasks 100 -bench-tasks 10"
  26. runTests() {
  27. kube::etcd::start
  28. kube::log::status "Running benchmarks"
  29. KUBE_GOFLAGS="-tags 'benchmark no-docker' -bench . -benchmem -benchtime 1s -cpu 4" \
  30. KUBE_RACE="-race" \
  31. KUBE_TEST_API_VERSIONS="v1" \
  32. KUBE_TIMEOUT="-timeout 10m" \
  33. KUBE_TEST_ETCD_PREFIXES="registry" \
  34. ETCD_CUSTOM_PREFIX="None" \
  35. KUBE_TEST_ARGS="${ARGS}" \
  36. make test WHAT=test/integration
  37. cleanup
  38. }
  39. # Run cleanup to stop etcd on interrupt or other kill signal.
  40. trap cleanup EXIT
  41. runTests