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

Modify the e2e local scripts so they can be run on a modern Mac #7456

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

adrianmoisey
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

e2e tests don't run locally on a modern Apple Silicon Mac. Additionally, these scripts seem to be out of date.
This PR is an attempt to start updating the tooling for local dev and testing.
It also removes the registry container, as kind supports loading images directly, without the need for a registry.

I haven't looked at any failed tests yet, but I plan to make more follow up PRs to improve on this area of the VPA in the future.

Which issue(s) this PR fixes:

Related to #7455

Special notes for your reviewer:

Untested on Linux or amd64 machines.
See this PR as an attempt to improve on these tools, and not the final state, I'd like to clean it up more after this PR lands.

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 4, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 4, 2024
Copy link
Member

@omerap12 omerap12 left a comment

Choose a reason for hiding this comment

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

Could we upgrade kind version to version 1.30 or newer?

Deleting KIND cluster 'kind'.
Creating KIND cluster 'kind'
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 ✓ Preparing nodes 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹️ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 

@adrianmoisey
Copy link
Member Author

Could we upgrade kind version to version 1.30 or newer?

I was thinking about that, but decided to leave it. I want to look at other versions that we have in the project, and make another PR to bump them all to something reasonable.

I kind of see this PR as "make it work" and a follow up PR will be "ensure everything is right", if you're fine with that

@omerap12
Copy link
Member

omerap12 commented Nov 4, 2024

Could we upgrade kind version to version 1.30 or newer?

I was thinking about that, but decided to leave it. I want to look at other versions that we have in the project, and make another PR to bump them all to something reasonable.

I kind of see this PR as "make it work" and a follow up PR will be "ensure everything is right", if you're fine with that

sounds good to me.

echo "Creating KIND cluster 'kind' with builtin registry."
${SCRIPT_ROOT}/hack/e2e/kind-with-registry.sh
echo "Creating KIND cluster 'kind'"
kind create cluster --image=kindest/node:v1.26.3
Copy link
Member

Choose a reason for hiding this comment

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

How about setting it up like this for better readability:

KIND_VERSION="kindest/node:v1.26.3"
kind create cluster --image=${KIND_VERSION}

@omerap12
Copy link
Member

omerap12 commented Nov 4, 2024

I tested it manually on my Mac, and it works.
/lgtm

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

/lgtm
/approve
/hold

Does anyone have a chance to run this on linux to verify those also still work?
Otherwise good to go, feel free to unhold once verified.

@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 Nov 6, 2024
@omerap12
Copy link
Member

omerap12 commented Nov 6, 2024

/lgtm /approve /hold

Does anyone have a chance to run this on linux to verify those also still work? Otherwise good to go, feel free to unhold once verified.

I can check this on a new ec2 over the weekend

@adrianmoisey
Copy link
Member Author

I tested it on a fresh Linux VM, and it works.
/unhold

I found a few improvements to make, such as detecting if the necessary commands exist, such as go, kubectl and make.
I'll make a follow up PR for those.

@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 Nov 7, 2024
@adrianmoisey
Copy link
Member Author

@kwiesmueller I don't think the approve you did worked, can you re-approve?

Make the help message slightly more helpful

Also fix up redirects, as per https://www.shellcheck.net/wiki/SC2069
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 7, 2024
@adrianmoisey
Copy link
Member Author

Since the approve label wasn't applied, I made a few small improvements based on the testing on a fresh linux VM.

Copy link
Member

@kwiesmueller kwiesmueller left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
Thanks!

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

@omerap12 omerap12 left a comment

Choose a reason for hiding this comment

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

Just a tiny comment otherwise lgtm from my side

"

for i in $REQUIRED_COMMANDS; do
if ! command -v $i > /dev/null 2>&1
Copy link
Member

Choose a reason for hiding this comment

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

Can we use which instead? I'm not sure all of those commands has -v flag

Copy link
Member Author

Choose a reason for hiding this comment

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

command is a bash builtin, and the -v is being passed to it.
This loop will run like this:
command -v docker for example.

It's a way to test if a command exists, ie:

adrianmoisey@Adrian-Moisey:~$ command -v docker > /dev/null 2>&1
adrianmoisey@Adrian-Moisey:~$ echo $?
0

Or when it doesn't exist:

adrianmoisey@Adrian-Moisey:~$ command -v doesntexist > /dev/null 2>&1
adrianmoisey@Adrian-Moisey:~$ echo $?
1

Copy link
Member

Choose a reason for hiding this comment

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

Great! Thanks for clarifying :)

@adrianmoisey
Copy link
Member Author

Oh, the change to .gitignore requires a different approver.

@MaciekPytel can you take a look please?

/assign maciekpytel

@gjtempleton
Copy link
Member

/approve
Thanks for this!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianmoisey, gjtempleton, kwiesmueller, omerap12

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 Nov 11, 2024
@k8s-ci-robot k8s-ci-robot merged commit adba590 into kubernetes:master Nov 11, 2024
6 of 7 checks passed
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. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants