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

Setup new node image with swap enabled #22453

Closed
wants to merge 1 commit into from

Conversation

ike-ma
Copy link
Contributor

@ike-ma ike-ma commented Jun 7, 2021

What type of PR is this?

/sig node
/priority important-soon

What this PR does / why we need it:

This PR
[x] Build images with swap for Ubuntu
[x] Add jobs to test-infra that use the images and enable the swap kubelet option for node e2e suite

Which issue(s) this PR fixes:

Context: kubernetes/enhancements#2400

Special notes for your reviewer:

  • The wiring PR and swap specific test is to be implemented in k/k as suggested by Elana (@ehashman), the feature gate is not yet wired
  • This PR has been manually tested with the following command (without feature gate for swap), and works as expected
kubetest
  --up \
  --down \
  --test \
  --provider=gce \
  --deployment=node \
  --gcp-project="${PROJECT}" \
  --gcp-zone="${ZONE}" \
  "--node-args=--image-config-file="${IMAGE_CONFIG_OUT} \
  '--node-test-args=--feature-gates=DynamicKubeletConfig=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=false"' \
  --node-tests=true \
  '--test_args=--nodes=1 --focus="\[NodeAlphaFeature:NodeMemorySwap\]" --skip="\[Flaky\]"' \
  '--timeout=300m'

@k8s-ci-robot k8s-ci-robot added the sig/node Categorizes an issue or PR as relevant to SIG Node. label Jun 7, 2021
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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 added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 7, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @ike-ma!

It looks like this is your first PR to kubernetes/test-infra 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/test-infra has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 7, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @ike-ma. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added area/config Issues or PRs related to code in /config area/jobs sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 7, 2021
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 7, 2021
@ehashman
Copy link
Member

ehashman commented Jun 7, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 7, 2021
Comment on lines 392 to 393
- name: ci-kubernetes-node-kubelet-node-swap
interval: 4h
Copy link
Member

Choose a reason for hiding this comment

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

We don't need a periodic test until the code merges (since we won't be able to enable the feature flag yet), but I'm fine with enabling this with the kubelet flag + swap enabled for now. It should be a no-op.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack. I'll just remove this section for now then. Will add back when code is merged.

- --node-test-args=--feature-gates=DynamicKubeletConfig=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=false"
- --node-tests=true
- --provider=gce
- --test_args=--nodes=1 --focus="\[NodeAlphaFeature:NodeMemorySwap\]"
Copy link
Member

Choose a reason for hiding this comment

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

I've been avoiding using new NodeAlphaFeature tags where possible.

I think the focus of this test should be to run the full node e2e suite with swap on, per https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md#test-plan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated to --focus="\[NodeConformance\]|\[NodeFeature:.+\]" --skip="\[Flaky\]|\[Slow\]|\[Serial\]" similar to cgroup tests

- --gcp-project=k8s-jkns-pr-node-e2e
- --gcp-zone=us-west1-b
- --node-args=--image-config-file=/workspace/test-infra/jobs/e2e_node/image-config-swap.yaml
- --node-test-args=--feature-gates=DynamicKubeletConfig=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=false"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- --node-test-args=--feature-gates=DynamicKubeletConfig=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=false"
- --node-test-args=--feature-gates=NodeSwapEnabled=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=false"

I'm not sure if we want the DynamicKubeletConfig flag on as we're deprecating it. We will definitely need NodeSwapEnabled for this to be able to test changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated as suggested

- --node-test-args=--feature-gates=DynamicKubeletConfig=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=false"
- --node-tests=true
- --provider=gce
- --test_args=--nodes=1 --focus="\[NodeAlphaFeature:NodeMemorySwap\]"
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above re: focus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated to --focus="\[NodeConformance\]|\[NodeFeature:.+\]" --skip="\[Flaky\]|\[Slow\]|\[Serial\]" similar to cgroup tests

# `gcloud compute --project <to-project> disks create <image name> --image=https://www.googleapis.com/compute/v1/projects/<from-project>/global/images/<image-name>`
# `gcloud compute --project <to-project> images create <image-name> --source-disk=<image-name>`
images:
ubuntu: #With1GSwap
Copy link
Member

Choose a reason for hiding this comment

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

Per the spec, we want to test two distros. Ubuntu is a great start, can we also do something RHEL-based?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Added fedora image with 1G swap and swap accounting enabled.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 15, 2021
Copy link
Contributor Author

@ike-ma ike-ma left a comment

Choose a reason for hiding this comment

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

Addressed previous comments, and added fedora support

- --gcp-project=k8s-jkns-pr-node-e2e
- --gcp-zone=us-west1-b
- --node-args=--image-config-file=/workspace/test-infra/jobs/e2e_node/image-config-swap.yaml
- --node-test-args=--feature-gates=DynamicKubeletConfig=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=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.

Updated as suggested

- --node-test-args=--feature-gates=DynamicKubeletConfig=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=false"
- --node-tests=true
- --provider=gce
- --test_args=--nodes=1 --focus="\[NodeAlphaFeature:NodeMemorySwap\]"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated to --focus="\[NodeConformance\]|\[NodeFeature:.+\]" --skip="\[Flaky\]|\[Slow\]|\[Serial\]" similar to cgroup tests

- --node-test-args=--feature-gates=DynamicKubeletConfig=true --kubelet-flags="--cgroups-per-qos=true --cgroup-root=/ --fail-swap-on=false"
- --node-tests=true
- --provider=gce
- --test_args=--nodes=1 --focus="\[NodeAlphaFeature:NodeMemorySwap\]"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated to --focus="\[NodeConformance\]|\[NodeFeature:.+\]" --skip="\[Flaky\]|\[Slow\]|\[Serial\]" similar to cgroup tests

# `gcloud compute --project <to-project> disks create <image name> --image=https://www.googleapis.com/compute/v1/projects/<from-project>/global/images/<image-name>`
# `gcloud compute --project <to-project> images create <image-name> --source-disk=<image-name>`
images:
ubuntu: #With1GSwap
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Added fedora image with 1G swap and swap accounting enabled.

Comment on lines 392 to 393
- name: ci-kubernetes-node-kubelet-node-swap
interval: 4h
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack. I'll just remove this section for now then. Will add back when code is merged.

@ike-ma
Copy link
Contributor Author

ike-ma commented Jun 15, 2021

Fedora tests:

Tested with kubetest (without FeatureGate for EnableNodeSwap)

ARTIFACTS="${TMPDIR}" JENKINS_GCE_SSH_PRIVATE_KEY_FILE="${SSH_KEY}" KUBE_SSH_USER=core \
/usr/local/google/home/ikema/go-k8s-oss/bin/kubetest \
  --up \
  --down \
  --test \
  --provider=gce \
  --deployment=node \
  --gcp-project="${PROJECT}" \
  --gcp-zone="${ZONE}" \
  '--node-test-args=--feature-gates=DynamicKubeletConfig=true,LocalStorageCapacityIsolation=true --container-runtime=remote --container-runtime-endpoint=unix:///var/run/crio/crio.sock --container-runtime-process-name=/usr/local/bin/crio --container-runtime-pid-file= --kubelet-flags="--fail-swap-on=false --cgroup-driver=systemd --cgroups-per-qos=true --cgroup-root=/ --runtime-cgroups=/system.slice/crio.service --kubelet-cgroups=/system.slice/kubelet.service --non-masquerade-cidr=0.0.0.0/0" --extra-log="{\"name\": \"crio.log\", \"journalctl\": [\"-u\", \"crio\"]}"' \
  "--node-args=--image-config-file="${IMAGE_CONFIG_OUT} \
  --node-tests=true \
  '--test_args=--nodes=1 --focus="\[NodeAlphaFeature:NodeMemorySwap\]" --skip="\[Flaky\]"' \
  '--timeout=300m' 2>&1 | tee -i "${TMPDIR}/build-log.txt"

Logged into the provisioned node and manually verified

[Pass] 1G swap added

[core@localhost ~]$ free -h
               total        used        free      shared  buff/cache   available
Mem:           7.3Gi       950Mi       335Mi       522Mi       6.0Gi       5.6Gi
Swap:          1.0Gi       0.0Ki       1.0Gi

[Pass] Let container consumer more memory than requested, container will fail as expected when no swap allowed

[core@localhost ~]$ sudo docker run --memory 50m --memory-swap 50m --rm progrium/stress --vm 1 --vm-bytes 100m --timeout 1s
stress: FAIL: [1] (416) <-- worker 7 got signal 9
stress: WARN: [1] (418) now reaping child worker processes
stress: FAIL: [1] (422) kill error: No such process
stress: FAIL: [1] (452) failed run completed in 1s
stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
stress: dbug: [1] using backoff sleep of 3000us
stress: dbug: [1] setting timeout to 1s
stress: dbug: [1] --> hogvm worker 1 [7] forked

[Pass] Let container consumer more memory than requested, container will succeed as expected when using unlimited swap (-1)

[core@localhost ~]$ sudo docker run --memory 50m --memory-swap -1 --rm progrium/stress --vm 1 --vm-bytes 100m --timeout 1s
stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
stress: dbug: [1] using backoff sleep of 3000us
stress: dbug: [1] setting timeout to 1s
stress: dbug: [1] --> hogvm worker 1 [7] forked
stress: dbug: [1] <-- worker 7 signalled normally
stress: info: [1] successful run completed in 1s

Copy link
Member

@ehashman ehashman left a comment

Choose a reason for hiding this comment

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

I suggest that we add the manual tests you've written above to the e2e suite to be selected as part of Feature:NodeSwap work.

/skip
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 16, 2021
* Support Ubuntu and Fedora
* Tested with docker command on node
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 16, 2021
@k8s-ci-robot
Copy link
Contributor

@ike-ma: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-test-infra-gubernator 9180f79 link /test pull-test-infra-gubernator

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.

@ehashman
Copy link
Member

/skip

@sjenning
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ike-ma, sjenning

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 Jun 17, 2021
@BenTheElder
Copy link
Member

in general if you don't see an error that makes sense: expand the full log. from the end of the log:

Gubernator configuration file is out of sync!
39a40
>   - pull-kubernetes-node-swap-fedora
Run `gubernator/update_config.sh`

the log highlighting is iffy, and can point you towards spurious errors that are not the real problem.

Copy link
Member

@ehashman ehashman left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 17, 2021
@ehashman
Copy link
Member

/close

@k8s-ci-robot
Copy link
Contributor

@ehashman: Closed this PR.

In response to this:

/close

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.

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/config Issues or PRs related to code in /config area/jobs 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants