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

Use CAAPH to install cloud-provider-azure in tests #4413

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

CecileRobertMichon
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon commented Dec 19, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it: Switch to using https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm to install cloud-provider-azure components in test templates.

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 #3736

Special notes for your reviewer:

  • cherry-pick candidate

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Use CAAPH to install cloud-provider-azure in tests

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 19, 2023
@CecileRobertMichon
Copy link
Contributor Author

Need to run more tests on this after the holidays but opening for a first round of review

cc @Jont828 @lzhecheng

Copy link

codecov bot commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1c7c802) 61.96% compared to head (27ec5ec) 61.96%.
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4413   +/-   ##
=======================================
  Coverage   61.96%   61.96%           
=======================================
  Files         188      188           
  Lines       18768    18768           
=======================================
  Hits        11630    11630           
  Misses       6500     6500           
  Partials      638      638           

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

Copy link
Contributor

@Jont828 Jont828 left a comment

Choose a reason for hiding this comment

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

Looking good so far!

Btw if you decide to set default placeholder for the CI artifact environment variables at the BeforeEach, I added it to azure_test.go, capi_test.go, conformance_test.go, and azure_selfhosted.go. If not, disregard the previous sentence.

export CLOUD_CONFIG=""
export CONFIG_SECRET_NAME="azure-cloud-provider"
export ENABLE_DYNAMIC_RELOADING=true
copy_secret || return 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: What is the return 1 part for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was in the original install_cloud_provider_azure function to allow retrying the operation for transient failures:

# Any retryable operation in this function must return a non-zero exit code on failure so that we can
# retry it using a `until install_cloud_provider_azure; do sleep 5; done` pattern;
# and any statement must be idempotent so that subsequent retry attempts can make forward progress.

Since we're no longer retrying the function (it's part of setup now), I changed it to use until directly (the copy_secret function itself returns 1 on failure).

--set cloudNodeManager.imageName="${CNM_IMAGE_NAME}"
--set-string cloudControllerManager.imageTag="${IMAGE_TAG_CCM}"
--set-string cloudNodeManager.imageTag="${IMAGE_TAG_CNM}")
if [[ -n "${LOAD_CLOUD_CONFIG_FROM_SECRET:-}" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still want to use E2E_ARGS="-kubetest.use-ci-artifacts" as the variable configuring the CI artifacts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should_build_ccm already encompasses E2E_ARGS="-kubetest.use-ci-artifacts" and other cases where we want to use a CI version of CCM in the context of ci-entrypoint.sh

https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/hack/util.sh#L44

imageName: ${CCM_IMAGE_NAME:-""}
imageRepository: ${IMAGE_REGISTRY:-""}
imageTag: ${IMAGE_TAG_CCM:-""}
logVerbosity: ${CCM_LOG_VERBOSITY:-4}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd need to verify this, but I'm not sure that envsubst supports setting default values when the variable isn't set (like in bash/zsh).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

logVerbosity: ${CCM_LOG_VERBOSITY:-4}
replicas: ${CCM_COUNT:-1}
enableDynamicReloading: ${ENABLE_DYNAMIC_RELOADING:-false}
cloudNodeManager:
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's possible to use bash if logic, an alternative would be to move the CI artifacts field behind an if statement and leave it blank if it's false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be possible to use if blocks but I'm not sure we'd gain in simplicity, having both addon versions as separate HelmChartProxies would also allow testing both versions side by side in the future.

@lzhecheng
Copy link
Contributor

So far no comments from my side. Please ping me if there's anything wrong in CI.

@CecileRobertMichon CecileRobertMichon force-pushed the ccm-caaph branch 2 times, most recently from ad6f9d6 to 37fc796 Compare January 3, 2024 17:31
@CecileRobertMichon CecileRobertMichon changed the title [WIP] Use CAAPH to install cloud-provider-azure in tests Use CAAPH to install cloud-provider-azure in tests Jan 3, 2024
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 3, 2024
@CecileRobertMichon
Copy link
Contributor Author

Squashed commits and removed [WIP], this is ready for review!

@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 3, 2024

/assign @Jont828

@CecileRobertMichon
Copy link
Contributor Author

/retest

Copy link
Contributor

@Jont828 Jont828 left a comment

Choose a reason for hiding this comment

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

/lgtm

Glad to see this is at the finish line!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 4, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 4151c263e6d72809ab59c931999dec5c52eac3c2

@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 4, 2024

/test pull-cluster-api-provider-azure-e2e-optional
^ primarily for the in-tree test

@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 4, 2024

@CecileRobertMichon Could you also please fill out the rest of the PR description? Mostly for posterity.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 4, 2024
@k8s-ci-robot k8s-ci-robot requested a review from Jont828 January 4, 2024 15:52
@CecileRobertMichon
Copy link
Contributor Author

/test pull-cluster-api-provider-azure-e2e-optional

@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 9, 2024

/approve
/hold for @CecileRobertMichon's question: #4413 (comment)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 9, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nojnhuh

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 9, 2024
@Jont828
Copy link
Contributor

Jont828 commented Jan 9, 2024

/lgtm

@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 9, 2024

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 9, 2024
@CecileRobertMichon
Copy link
Contributor Author

/retest

apiversion test should be fixed now

@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 9, 2024

/hold for the upgrade test

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 9, 2024
@CecileRobertMichon
Copy link
Contributor Author

the upgrade test failed 🤔

/retest

in case it's a flake, will look into it in parallel...

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 9, 2024
@CecileRobertMichon
Copy link
Contributor Author

Update: it was not a flake. The release name was different than the one we were using previously which caused issues with the upgrade test. Renamed to match the previous naming in the latest commit which should fix it.

Copy link
Contributor

@nojnhuh nojnhuh left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold for squash in addition to the upgrade test

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 9, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9a205db17a3d7f5b53ff6a67cb6696a01070b76b

@Jont828
Copy link
Contributor

Jont828 commented Jan 9, 2024

/lgtm
/hold

@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 10, 2024

/retest

@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 10, 2024

@CecileRobertMichon tests passed, PSAYEC

(please squash at your earliest convenience)

@CecileRobertMichon
Copy link
Contributor Author

/hold cancel

squashed!

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 10, 2024
@nojnhuh
Copy link
Contributor

nojnhuh commented Jan 10, 2024

/lgtm

@k8s-ci-robot
Copy link
Contributor

@CecileRobertMichon: The following test 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-windows-custom-builds 27ec5ec link false /test pull-cluster-api-provider-azure-windows-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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot merged commit 1ce44f1 into kubernetes-sigs:main Jan 10, 2024
25 of 29 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use CAAPH to install Helm charts in e2e tests
5 participants