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

Add template for performance testing with custom Kubernetes version #5342

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jont828
Copy link
Contributor

@Jont828 Jont828 commented Dec 17, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:Add template for performance testing with custom Kubernetes version.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • cherry-pick candidate

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 17, 2024
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 17, 2024
@Jont828 Jont828 force-pushed the entrypoint-custom-builds branch 2 times, most recently from f60ccc6 to 007ef8e Compare December 17, 2024 02:25
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 17, 2024
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.43%. Comparing base (00dfab1) to head (77cfeb6).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5342   +/-   ##
=======================================
  Coverage   52.43%   52.43%           
=======================================
  Files         272      272           
  Lines       29401    29401           
=======================================
  Hits        15417    15417           
  Misses      13178    13178           
  Partials      806      806           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jont828
Copy link
Contributor Author

Jont828 commented Dec 17, 2024

/test ls

@k8s-ci-robot
Copy link
Contributor

@Jont828: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-azure-apiversion-upgrade
  • /test pull-cluster-api-provider-azure-build
  • /test pull-cluster-api-provider-azure-ci-entrypoint
  • /test pull-cluster-api-provider-azure-e2e
  • /test pull-cluster-api-provider-azure-e2e-aks
  • /test pull-cluster-api-provider-azure-test
  • /test pull-cluster-api-provider-azure-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-azure-apidiff
  • /test pull-cluster-api-provider-azure-apiserver-ilb
  • /test pull-cluster-api-provider-azure-capi-e2e
  • /test pull-cluster-api-provider-azure-conformance
  • /test pull-cluster-api-provider-azure-conformance-custom-builds
  • /test pull-cluster-api-provider-azure-conformance-dual-stack-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-conformance-ipv6-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-e2e-optional
  • /test pull-cluster-api-provider-azure-e2e-workload-upgrade
  • /test pull-cluster-api-provider-azure-load-test-custom-builds
  • /test pull-cluster-api-provider-azure-windows-custom-builds
  • /test pull-cluster-api-provider-azure-windows-with-ci-artifacts

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-azure-apidiff
  • pull-cluster-api-provider-azure-build
  • pull-cluster-api-provider-azure-ci-entrypoint
  • pull-cluster-api-provider-azure-conformance
  • pull-cluster-api-provider-azure-conformance-custom-builds
  • pull-cluster-api-provider-azure-conformance-dual-stack-with-ci-artifacts
  • pull-cluster-api-provider-azure-conformance-ipv6-with-ci-artifacts
  • pull-cluster-api-provider-azure-conformance-with-ci-artifacts
  • pull-cluster-api-provider-azure-e2e
  • pull-cluster-api-provider-azure-e2e-aks
  • pull-cluster-api-provider-azure-test
  • pull-cluster-api-provider-azure-verify
  • pull-cluster-api-provider-azure-windows-custom-builds
  • pull-cluster-api-provider-azure-windows-with-ci-artifacts

In response to this:

/test ls

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@Jont828 Jont828 force-pushed the entrypoint-custom-builds branch 2 times, most recently from 5a0efc2 to e05f164 Compare December 17, 2024 02:59
@Jont828
Copy link
Contributor Author

Jont828 commented Dec 17, 2024

/test pull-cluster-api-provider-azure-load-test-custom-builds

2 similar comments
@Jont828
Copy link
Contributor Author

Jont828 commented Dec 17, 2024

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828
Copy link
Contributor Author

Jont828 commented Dec 17, 2024

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828 Jont828 force-pushed the entrypoint-custom-builds branch from dd8b409 to d321deb Compare December 17, 2024 18:04
@Jont828
Copy link
Contributor Author

Jont828 commented Dec 17, 2024

/test pull-cluster-api-provider-azure-load-test-custom-builds

4 similar comments
@Jont828
Copy link
Contributor Author

Jont828 commented Dec 18, 2024

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828
Copy link
Contributor Author

Jont828 commented Dec 18, 2024

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828
Copy link
Contributor Author

Jont828 commented Dec 18, 2024

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828
Copy link
Contributor Author

Jont828 commented Dec 19, 2024

/test pull-cluster-api-provider-azure-load-test-custom-builds

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 3, 2025
@Jont828 Jont828 force-pushed the entrypoint-custom-builds branch from 4e15c40 to 0a0569d Compare January 3, 2025 22:34
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 3, 2025
@Jont828
Copy link
Contributor Author

Jont828 commented Jan 3, 2025

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828
Copy link
Contributor Author

Jont828 commented Jan 3, 2025

/test pull-cluster-api-provider-azure-load-test-custom-builds

2 similar comments
@Jont828
Copy link
Contributor Author

Jont828 commented Jan 6, 2025

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828
Copy link
Contributor Author

Jont828 commented Jan 6, 2025

/test pull-cluster-api-provider-azure-load-test-custom-builds

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jont828. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Jont828
Copy link
Contributor Author

Jont828 commented Jan 7, 2025

/test pull-cluster-api-provider-azure-load-test-custom-builds

1 similar comment
@Jont828
Copy link
Contributor Author

Jont828 commented Jan 8, 2025

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828
Copy link
Contributor Author

Jont828 commented Jan 8, 2025

We finally got a passing perf test run!

@Jont828
Copy link
Contributor Author

Jont828 commented Jan 8, 2025

Running again to verify that it works during busier hours while other PR jobs are running simultaneously.

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828 Jont828 force-pushed the entrypoint-custom-builds branch 2 times, most recently from 7550b03 to 365ccc0 Compare January 9, 2025 18:33
@Jont828
Copy link
Contributor Author

Jont828 commented Jan 9, 2025

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828
Copy link
Contributor Author

Jont828 commented Jan 9, 2025

Bump timeout back to 30m and try again.

/test pull-cluster-api-provider-azure-load-test-custom-builds

@Jont828 Jont828 changed the title [WIP] Add template for performance testing with custom Kubernetes version Add template for performance testing with custom Kubernetes version Jan 10, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 10, 2025
@Jont828 Jont828 force-pushed the entrypoint-custom-builds branch 2 times, most recently from c865b5c to e1c4aef Compare January 10, 2025 01:54
@Jont828 Jont828 force-pushed the entrypoint-custom-builds branch from e1c4aef to 77cfeb6 Compare January 10, 2025 01:55
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 10, 2025
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
1#!/usr/bin/env bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Suggested change
1#!/usr/bin/env bash
#!/usr/bin/env bash

@@ -260,4 +260,4 @@ rm -r combined_contexts.yaml
rm -f tilt-settings-temp.yaml
}

main
main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add back the trailing newline? That seems to be preferred in this codebase.

@@ -377,7 +377,7 @@ create-workload-cluster: $(ENVSUBST) $(KUBECTL) ## Create a workload cluster.
timeout --foreground 1800 bash -c "while ! $(KUBECTL) get secrets -n default | grep $(CLUSTER_NAME)-kubeconfig; do sleep 1; done"
# Get kubeconfig and store it locally.
$(KUBECTL) get secret/$(CLUSTER_NAME)-kubeconfig -n default -o json | jq -r .data.value | base64 --decode > ./kubeconfig
$(KUBECTL) -n default wait --for=condition=Ready --timeout=10m cluster "$(CLUSTER_NAME)"
$(KUBECTL) -n default wait --for=condition=Ready --timeout=30m cluster "$(CLUSTER_NAME)"
Copy link
Contributor

@mboersma mboersma Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth parameterizing this, like --timeout=$(CLUSTER_TIMEOUT), so we can leave the default at 10m? This is a popular Makefile target and this may change the overall duration of e2e test failures, or surprise users who were accustomed to failure after 10 minutes.

# Run the az login command with managed identity
if az login --identity > /dev/null 2>&1; then
echo "Logged in Azure with managed identity"
echo "Use OOT credential provider"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Use OOT credential provider"
echo "Using OOT credential provider"

Maybe? Seems more consistent with other log messages here.

echo "Logged in Azure with managed identity"
echo "Use OOT credential provider"
mkdir -p /var/lib/kubelet/credential-provider
az storage blob download --blob-url "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/azure-acr-credential-provider" -f /var/lib/kubelet/credential-provider/acr-credential-provider --auth-mode login
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe set https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER} to a local env var so we make the az storage blob and curl commands a bit more readable?

osDisk:
diskSizeGB: 128
osType: Linux
sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
userAssignedIdentities:
- providerID: /subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${CI_RG:=capz-ci}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${USER_IDENTITY:=cloud-provider-user-identity}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we not want to include default values here?

@@ -183,12 +282,18 @@ spec:
template:
spec:
identity: UserAssigned
image:
marketplace:
Copy link
Contributor

@mboersma mboersma Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Azure Marketplace images are deprecated and won't be updated. Azure Community Gallery is the new hotness:

image:
  computeGallery:
    gallery: "ClusterAPI-f72ceb4f-5159-4c26-a0fe-2ea738f0d019"
    name: "capi-ubun2-2404"
    version: "latest"

set -o nounset
set -o pipefail
set -o errexit
[[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO=""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same script, same comment: I don't think sudo is used here.

@@ -261,14 +420,20 @@ spec:
windowsServerVersion: ${WINDOWS_SERVER_VERSION:=""}
spec:
identity: UserAssigned
image:
marketplace:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And for Windows images in the Community Gallery:

image:
  computeGallery:
    gallery: "ClusterAPI-f72ceb4f-5159-4c26-a0fe-2ea738f0d019"
    name: "capi-win-2022-containerd"
    version: "latest"

windows-2019 is now deprecated and we won't be publishing it any more: see #5357.

path: C:/oot-cred-provider.ps1
permissions: "0744"
- content: |
Write-Host "Installing Azure CLI"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're using CAPZ reference images built with --var 'debug_tools=true' (our default), then az should already be installed on Windows and Linux nodes.

@mboersma mboersma requested review from jackfrancis and removed request for nojnhuh and marosset January 10, 2025 15:46
@jackfrancis
Copy link
Contributor

/test pull-cluster-api-provider-azure-load-test-custom-builds

@k8s-ci-robot
Copy link
Contributor

@Jont828: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-azure-verify 77cfeb6 link true /test pull-cluster-api-provider-azure-verify
pull-cluster-api-provider-azure-load-test-custom-builds 77cfeb6 link false /test pull-cluster-api-provider-azure-load-test-custom-builds

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants