From 6f3080b75894c66145b3c3244d69725bff7312b7 Mon Sep 17 00:00:00 2001 From: Cassandra Coyle Date: Wed, 11 Sep 2024 14:42:59 -0500 Subject: [PATCH 1/3] enable logging on flaky tests and lower qps for scheduler Signed-off-by: Cassandra Coyle --- .../actor_reminder/actor_reminder_test.go | 4 ++-- .../actor_type_scale/actor_type_scale_test.go | 1 + .../perf/configuration/configuration_test.go | 21 ++++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/perf/actor_reminder/actor_reminder_test.go b/tests/perf/actor_reminder/actor_reminder_test.go index 48732fde131..9f1643baabf 100644 --- a/tests/perf/actor_reminder/actor_reminder_test.go +++ b/tests/perf/actor_reminder/actor_reminder_test.go @@ -50,7 +50,7 @@ const ( // Target for the QPS - Temporary targetQPS float64 = 33 - targetSchedulerQPS float64 = 3000 + targetSchedulerQPS float64 = 2900 // Target for the QPS to trigger reminders. targetTriggerQPS float64 = 1000 @@ -296,7 +296,7 @@ func TestActorReminderSchedulerRegistrationPerformance(t *testing.T) { assert.Equal(t, 0, daprResult.RetCodes.Num400) assert.Equal(t, 0, daprResult.RetCodes.Num500) assert.Equal(t, 0, restarts) - assert.InDelta(t, targetSchedulerQPS, daprResult.ActualQPS, 5) + assert.InDelta(t, targetSchedulerQPS, daprResult.ActualQPS, 10) } type actorReminderRequest struct { diff --git a/tests/perf/actor_type_scale/actor_type_scale_test.go b/tests/perf/actor_type_scale/actor_type_scale_test.go index a49df45c3f3..5e980f39a12 100644 --- a/tests/perf/actor_type_scale/actor_type_scale_test.go +++ b/tests/perf/actor_type_scale/actor_type_scale_test.go @@ -69,6 +69,7 @@ func TestMain(m *testing.M) { AppEnv: map[string]string{ "TEST_APP_ACTOR_TYPE": actorsTypes, }, + DebugLoggingEnabled: true, }, } diff --git a/tests/perf/configuration/configuration_test.go b/tests/perf/configuration/configuration_test.go index 4de98e88f8d..702cb4a150d 100644 --- a/tests/perf/configuration/configuration_test.go +++ b/tests/perf/configuration/configuration_test.go @@ -59,16 +59,17 @@ func TestMain(m *testing.M) { testApps := []kube.AppDescription{ { - AppName: testAppName, - DaprEnabled: true, - ImageName: "perf-configuration", - Replicas: 1, - IngressEnabled: true, - MetricsEnabled: true, - DaprMemoryLimit: "200Mi", - DaprMemoryRequest: "100Mi", - AppMemoryLimit: "200Mi", - AppMemoryRequest: "100Mi", + AppName: testAppName, + DaprEnabled: true, + ImageName: "perf-configuration", + Replicas: 1, + IngressEnabled: true, + MetricsEnabled: true, + DaprMemoryLimit: "200Mi", + DaprMemoryRequest: "100Mi", + AppMemoryLimit: "200Mi", + AppMemoryRequest: "100Mi", + DebugLoggingEnabled: true, }, } From 3dad47a4040134ff5d9a6b549fab7e05127ccc3f Mon Sep 17 00:00:00 2001 From: Cassandra Coyle Date: Thu, 12 Sep 2024 11:24:08 -0500 Subject: [PATCH 2/3] revert the debugging lines added since those passed and infra is failing rn due to master running currently Signed-off-by: Cassandra Coyle --- .../actor_type_scale/actor_type_scale_test.go | 1 - .../perf/configuration/configuration_test.go | 21 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/perf/actor_type_scale/actor_type_scale_test.go b/tests/perf/actor_type_scale/actor_type_scale_test.go index 5e980f39a12..a49df45c3f3 100644 --- a/tests/perf/actor_type_scale/actor_type_scale_test.go +++ b/tests/perf/actor_type_scale/actor_type_scale_test.go @@ -69,7 +69,6 @@ func TestMain(m *testing.M) { AppEnv: map[string]string{ "TEST_APP_ACTOR_TYPE": actorsTypes, }, - DebugLoggingEnabled: true, }, } diff --git a/tests/perf/configuration/configuration_test.go b/tests/perf/configuration/configuration_test.go index 702cb4a150d..4de98e88f8d 100644 --- a/tests/perf/configuration/configuration_test.go +++ b/tests/perf/configuration/configuration_test.go @@ -59,17 +59,16 @@ func TestMain(m *testing.M) { testApps := []kube.AppDescription{ { - AppName: testAppName, - DaprEnabled: true, - ImageName: "perf-configuration", - Replicas: 1, - IngressEnabled: true, - MetricsEnabled: true, - DaprMemoryLimit: "200Mi", - DaprMemoryRequest: "100Mi", - AppMemoryLimit: "200Mi", - AppMemoryRequest: "100Mi", - DebugLoggingEnabled: true, + AppName: testAppName, + DaprEnabled: true, + ImageName: "perf-configuration", + Replicas: 1, + IngressEnabled: true, + MetricsEnabled: true, + DaprMemoryLimit: "200Mi", + DaprMemoryRequest: "100Mi", + AppMemoryLimit: "200Mi", + AppMemoryRequest: "100Mi", }, } From b26a1951c482b6754d7486c0a1ec0b9999eb99a0 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Mon, 23 Sep 2024 01:47:46 +0100 Subject: [PATCH 3/3] Automatically update the dapr version in long haul tests on new releases (#8075) * Updates longhaul tests when a new release is created Signed-off-by: Elena Kolevska * fix getting version Signed-off-by: Elena Kolevska * gh Signed-off-by: Elena Kolevska * Checks if the version is newer before updating longhauls Signed-off-by: Elena Kolevska * Changes wording Signed-off-by: Elena Kolevska * Update .github/workflows/dapr.yml Co-authored-by: Mike Nguyen Signed-off-by: Elena Kolevska * cleans up script Signed-off-by: Elena Kolevska * Env variable name change for clarity Signed-off-by: Elena Kolevska * extracts longhaul test repo name in a var, for easier testing Signed-off-by: Elena Kolevska * Update .github/workflows/dapr.yml Co-authored-by: Mike Nguyen Signed-off-by: Elena Kolevska --------- Signed-off-by: Elena Kolevska Signed-off-by: Elena Kolevska Co-authored-by: Mike Nguyen Co-authored-by: Cassie Coyle --- .github/scripts/compare_versions.py | 55 +++++++++++++++++++++++++++++ .github/workflows/dapr.yml | 54 ++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 .github/scripts/compare_versions.py diff --git a/.github/scripts/compare_versions.py b/.github/scripts/compare_versions.py new file mode 100644 index 00000000000..a1bdd9c6a81 --- /dev/null +++ b/.github/scripts/compare_versions.py @@ -0,0 +1,55 @@ +# +# Copyright 2024 The Dapr Authors +# Licensed 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. +# + +# This script parses release version from Git tag and set the parsed version to +# environment variable, REL_VERSION. If the tag is the final version, it sets +# LATEST_RELEASE to true to add 'latest' tag to docker image. + +import os +import sys +from packaging.version import Version, InvalidVersion + +# compare_versions returns True if the comparison is successful. +# It returns False if the versions are invalid. +# The result of the comparison is written to the VERSION_UPDATE_REQUIRED GitHub environment variable. +def compare_versions(new_version, existing_version) -> bool: + try: + new_ver = Version(new_version) + existing_ver = Version(existing_version) + except InvalidVersion: + print("Invalid version format") + return False + + update_required = new_ver > existing_ver + status_message = "New version is greater than existing version." if update_required else "New version is not greater. Skipping update." + print(status_message) + + # Write the update requirement status to GITHUB_ENV + github_env_path = os.getenv("GITHUB_ENV") + if github_env_path: + with open(github_env_path, "a") as github_env: + github_env.write(f"VERSION_UPDATE_REQUIRED={str(update_required).lower()}\n") + + return True + +if len(sys.argv) != 3: + print("Usage: compare_versions.py ") + sys.exit(1) + +new_version = sys.argv[1] +existing_version = sys.argv[2] + +if compare_versions(new_version, existing_version): + sys.exit(0) +else: + sys.exit(1) diff --git a/.github/workflows/dapr.yml b/.github/workflows/dapr.yml index 31937acaf05..f8fe29d5156 100644 --- a/.github/workflows/dapr.yml +++ b/.github/workflows/dapr.yml @@ -690,3 +690,57 @@ jobs: echo "::error::There is no change for ${daprVersion} Helm chart. Did you forget to update the chart version before tagging?" exit -1 fi + + update-longhauls: + name: Update the dapr version in long haul tests + needs: helmpublish + runs-on: ubuntu-latest + if: startswith(github.ref, 'refs/tags/v') && github.repository_owner == 'dapr' + env: + LONG_HAUL_REPO: test-infra + steps: + - name: Get Token + id: get_workflow_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.APPLICATION_ID }} + private-key: ${{ secrets.APPLICATION_PRIVATE_KEY }} + repositories: ${{ env.LONG_HAUL_REPO }} + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + path: dapr + - name: Checkout the longhaul tests repo + uses: actions/checkout@v4 + with: + repository: dapr/${{ env.LONG_HAUL_REPO }} + token: ${{ steps.get_workflow_token.outputs.token }} + path: ${{ env.LONG_HAUL_REPO }} + - name: Install Python Dependencies + run: | + pip install packaging + - name: Parse release version and set REL_VERSION and LATEST_RELEASE + run: python dapr/.github/scripts/get_release_version.py ${{ github.event_name }} + + - name: Compare versions and determine if update of long haul tests is required + id: compare_versions + run: | + EXISTING_VERSION=$(cat "${{ env.LONG_HAUL_REPO }}/config/dapr_runtime.version") + echo "Existing version in long haul tests: $EXISTING_VERSION" + echo "New version: ${{ env.REL_VERSION }}" + python dapr/.github/scripts/compare_versions.py "${{ env.REL_VERSION }}" "$EXISTING_VERSION" + + - name: Update dapr runtime version in the long haul tests repo + if: env.VERSION_UPDATE_REQUIRED == 'true' + run: | + echo "${REL_VERSION}" > ${{ env.LONG_HAUL_REPO }}/config/dapr_runtime.version + + - name: Commit and Push Changes to repoB + if: env.VERSION_UPDATE_REQUIRED == 'true' + run: | + cd ${{ env.LONG_HAUL_REPO }} + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + git add config/dapr_runtime.version + git commit -m "Updates dapr runtime version to ${REL_VERSION}" + git push \ No newline at end of file