diff --git a/Makefile b/Makefile index 46bae4b182..fe24b53641 100644 --- a/Makefile +++ b/Makefile @@ -399,18 +399,21 @@ cf-login: ## Login to OSS CF dev environment @${CI_DIR}/autoscaler/scripts/cf-login.sh .PHONY: setup-performance -setup-performance: build-test-app acceptance-tests-config +setup-performance: build-test-app export NODES=1;\ export SUITES="setup_performance";\ export DEPLOYMENT_NAME="autoscaler-performance";\ - ${CI_DIR}/autoscaler/scripts/run-acceptance-tests.sh;\ + make acceptance-tests-config;\ + make --directory='./src/acceptance' run-acceptance-tests .PHONY: run-performance run-performance: export NODES=1;\ export DEPLOYMENT_NAME="autoscaler-performance";\ export SUITES="run_performance";\ - ${CI_DIR}/autoscaler/scripts/run-acceptance-tests.sh;\ + make acceptance-tests-config;\ + make --directory='./src/acceptance' run-acceptance-tests + .PHONY: run-act run-act: diff --git a/ci/autoscaler/scripts/run-acceptance-tests.sh b/ci/autoscaler/scripts/run-acceptance-tests.sh index ad00eeedc1..97edf99eef 100755 --- a/ci/autoscaler/scripts/run-acceptance-tests.sh +++ b/ci/autoscaler/scripts/run-acceptance-tests.sh @@ -16,7 +16,7 @@ then exit 1; fi -if [[ ! -f "${autoscaler_dir}/src/acceptance/acceptance_config.json" ]] +if [[ ! -f "${autoscaler_acceptance_dir}/acceptance_config.json" ]] then echo 'FAILED: Did not find file acceptance_config.json.' exit 1 @@ -40,4 +40,5 @@ if [ "${suites_to_run}" != "" ]; then SKIP_TEARDOWN="${skip_teardown}" CONFIG="${PWD}/acceptance_config.json" DEBUG='true' ./bin/test -race -nodes="${nodes}" -trace $ginkgo_opts ${suites_to_run} else log 'Nothing to run!' + exit 1 fi diff --git a/ci/autoscaler/scripts/vars.source.sh b/ci/autoscaler/scripts/vars.source.sh index 0bba413f69..c4c15b2d04 100644 --- a/ci/autoscaler/scripts/vars.source.sh +++ b/ci/autoscaler/scripts/vars.source.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # NOTE: to turn on debug use DEBUG=true # shellcheck disable=SC2155,SC2034 # @@ -83,6 +83,11 @@ export CI_DIR="$(realpath -e "${CI_DIR}")" debug "CI_DIR: ${CI_DIR}" ci_dir="${CI_DIR}" +AUTOSCALER_ACCEPTANCE_DIR="${AUTOSCALER_ACCEPTANCE_DIR:-${root_dir}/src/acceptance}" +export AUTOSCALER_ACCEPTANCE_DIR="$(realpath -e "${AUTOSCALER_ACCEPTANCE_DIR}" )" +debug "AUTOSCALER_ACCEPTANCE_DIR: ${AUTOSCALER_ACCEPTANCE_DIR}" +autoscaler_acceptance_dir="${AUTOSCALER_ACCEPTANCE_DIR}" + export SERVICE_NAME="${DEPLOYMENT_NAME}" debug "SERVICE_NAME: ${SERVICE_NAME}" service_name="%{SERVICE_NAME" @@ -109,6 +114,9 @@ debug "PERFORMANCE_SETUP_WORKERS: ${PERFORMANCE_SETUP_WORKERS}" export PERFORMANCE_TEARDOWN=${PERFORMANCE_TEARDOWN:-true} debug "PERFORMANCE_TEARDOWN: ${PERFORMANCE_TEARDOWN}" +export PERFORMANCE_UPDATE_EXISTING_ORG_QUOTA=${PERFORMANCE_UPDATE_EXISTING_ORG_QUOTA:-false} +debug "PERFORMANCE_UPDATE_EXISTING_ORG_QUOTA: ${PERFORMANCE_UPDATE_EXISTING_ORG_QUOTA}" + export CPU_UPPER_THRESHOLD=${CPU_UPPER_THRESHOLD:-100} debug "CPU_UPPER_THRESHOLD: ${CPU_UPPER_THRESHOLD}" cpu_upper_threshold=${CPU_UPPER_THRESHOLD} diff --git a/devbox.json b/devbox.json index 878feafeec..c3a572b26c 100644 --- a/devbox.json +++ b/devbox.json @@ -9,7 +9,7 @@ "bundix": "latest", "coreutils": "latest", "delve": "latest", - "fly": "7.10.0", + "fly": "7.12.0", "gh": "latest", "gnumake": "4.4", "gnutar": "latest", diff --git a/devbox.lock b/devbox.lock index 2f7d7da376..f64a452bdd 100644 --- a/devbox.lock +++ b/devbox.lock @@ -505,51 +505,51 @@ } } }, - "fly@7.10.0": { - "last_modified": "2023-10-25T20:49:13Z", - "resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#fly", + "fly@7.12.0": { + "last_modified": "2024-12-23T21:10:33Z", + "resolved": "github:NixOS/nixpkgs/de1864217bfa9b5845f465e771e0ecb48b30e02d#fly", "source": "devbox-search", - "version": "7.10.0", + "version": "7.12.0", "systems": { "aarch64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/8izh5mrp88vpv2p22r5djhg1l3yijcir-fly-7.10.0", + "path": "/nix/store/v42agkj44lkkczrijyrnab5pa7yh2bad-fly-7.12.0", "default": true } ], - "store_path": "/nix/store/8izh5mrp88vpv2p22r5djhg1l3yijcir-fly-7.10.0" + "store_path": "/nix/store/v42agkj44lkkczrijyrnab5pa7yh2bad-fly-7.12.0" }, "aarch64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/bjhdz4zxq77av8rlvg32agpd8aixh7bh-fly-7.10.0", + "path": "/nix/store/bnzbalznggbacy0xbq1ya9qyp6rj7s3r-fly-7.12.0", "default": true } ], - "store_path": "/nix/store/bjhdz4zxq77av8rlvg32agpd8aixh7bh-fly-7.10.0" + "store_path": "/nix/store/bnzbalznggbacy0xbq1ya9qyp6rj7s3r-fly-7.12.0" }, "x86_64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/60jgzhcj2s4rchrmqc479gi46fkydjyc-fly-7.10.0", + "path": "/nix/store/gzigrvd80bpmbj6ncqhpv0jrrrf4ls17-fly-7.12.0", "default": true } ], - "store_path": "/nix/store/60jgzhcj2s4rchrmqc479gi46fkydjyc-fly-7.10.0" + "store_path": "/nix/store/gzigrvd80bpmbj6ncqhpv0jrrrf4ls17-fly-7.12.0" }, "x86_64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/ddyvlw35d8skg4r7gv732g19ch7bwrh0-fly-7.10.0", + "path": "/nix/store/5nw561vp6bbq945lnfajw0l42jdkycjn-fly-7.12.0", "default": true } ], - "store_path": "/nix/store/ddyvlw35d8skg4r7gv732g19ch7bwrh0-fly-7.10.0" + "store_path": "/nix/store/5nw561vp6bbq945lnfajw0l42jdkycjn-fly-7.12.0" } } }, diff --git a/src/acceptance/app/custom_metric_test.go b/src/acceptance/app/custom_metric_test.go index 3b9410e5c1..3d25d42a2f 100644 --- a/src/acceptance/app/custom_metric_test.go +++ b/src/acceptance/app/custom_metric_test.go @@ -125,7 +125,7 @@ var _ = Describe("AutoScaler custom metrics", func() { func sendMetricToAutoscaler(config *config.Config, appToScaleGUID string, metricProducerAppName string, metricThreshold int, mtls bool) func() (int, error) { return func() (int, error) { if mtls { - SendMetricMTLS(config, appToScaleGUID, metricProducerAppName, metricThreshold) + SendMetricMTLS(config, appToScaleGUID, metricProducerAppName, metricThreshold, 0) } else { SendMetric(config, metricProducerAppName, metricThreshold) } diff --git a/src/acceptance/helpers/apps.go b/src/acceptance/helpers/apps.go index f44803cb7e..336bf4bd72 100644 --- a/src/acceptance/helpers/apps.go +++ b/src/acceptance/helpers/apps.go @@ -82,9 +82,13 @@ func SendMetric(cfg *config.Config, appName string, metric int) { cfh.CurlApp(cfg, appName, fmt.Sprintf("/custom-metrics/test_metric/%d", metric), "-f") } -func SendMetricMTLS(cfg *config.Config, appGuid string, appName string, metric int) { +func SendMetricMTLS(cfg *config.Config, appGuid string, appName string, metric int, timeOut time.Duration) string { GinkgoHelper() - cfh.CurlApp(cfg, appName, fmt.Sprintf("/custom-metrics/mtls/test_metric/%d?appToScaleGuid=%s", metric, appGuid), "-f") + if timeOut == 0 { + timeOut = cfh.CURL_TIMEOUT + } + return cfh.CurlAppWithTimeout(cfg, appName, fmt.Sprintf("/custom-metrics/mtls/test_metric/%d?appToScaleGuid=%s", + metric, appGuid), timeOut, "-f") } func StartAppWithErr(appName string, timeout time.Duration) error { diff --git a/src/acceptance/run_performance/run_performance_test.go b/src/acceptance/run_performance/run_performance_test.go index 9167cbb9a4..28d626ad08 100644 --- a/src/acceptance/run_performance/run_performance_test.go +++ b/src/acceptance/run_performance/run_performance_test.go @@ -325,7 +325,7 @@ func scaleOutApp(appName string, appGUID string, scaleOutApps *sync.Map, // Q. why sending post request to autoscaler after every pollTime. // A. It is observed that sometime cf does not pick the cf scale event. Therefore, // sending the metric again(and again) is the way to go at the moment - cmdOutput := helpers.SendMetricWithTimeout(cfg, appName, 550, 5*time.Minute) + cmdOutput := helpers.SendMetricMTLS(cfg, appGUID, appName, 550, 5*time.Minute) GinkgoWriter.Printf("worker %d - scale-out %s with App %s %s\n", workerIndex, cmdOutput, appName, appGUID) instances, err := helpers.RunningInstances(appGUID, 10*time.Minute) @@ -354,7 +354,7 @@ func scaleInApp(appName string, appGUID string, scaleInApps *sync.Map, pendingSc scaledInAppsCount *atomic.Int32, actualAppsToScaleCount int, workerIndex int, wg *sync.WaitGroup) func() { return func() { scaleIn := func() (int, error) { - cmdOutput := helpers.SendMetricWithTimeout(cfg, appName, 100, 5*time.Minute) + cmdOutput := helpers.SendMetricMTLS(cfg, appGUID, appName, 100, 5*time.Minute) GinkgoWriter.Printf("worker %d - scale-in %s with App %s %s\n", workerIndex, cmdOutput, appName, appGUID) instances, err := helpers.RunningInstances(appGUID, 10*time.Minute)