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

dockertools: disable MemorySwap on Linux #59404

Merged
merged 1 commit into from Feb 27, 2018

Conversation

Projects
None yet
8 participants
@ohmystack
Contributor

ohmystack commented Feb 6, 2018

In this commit, set MemorySwap the same with Memory to prevent using swap on Linux.

What this PR does / why we need it:

In #39731, @pires tried to disable swap on Linux by setting MemorySwap to 0.
However, according to Docker's docs, setting MemorySwap to 0 is treated as unset, and its default behavior is to set to twice the size of Memory, which can still cause the container to use the swap.

Which issue(s) this PR fixes :

This issue was mentioned in this comment: #7294 (comment)

Special notes for your reviewer:

  1. For the case on Windows, we can still use the 0 because Windows does not support MemorySwap.
  2. There is another place using the DefaultMemorySwap() is for sandbox.
    Maybe setting the sandbox's MemorySwap to 0 is fine. I didn't change that.

Release note:

dockertools: disable memory swap on Linux.
@dixudx

This comment has been minimized.

Member

dixudx commented Feb 6, 2018

@dixudx

This comment has been minimized.

Member

dixudx commented Feb 6, 2018

There is another place using the DefaultMemorySwap() is for sandbox.
Maybe setting the sandbox's MemorySwap to 0 is fine. I didn't change that.

MemorySwap is of no use if Memory is not set. Actually we could remove this for sandbox.

/ok-to-test

@ohmystack

This comment has been minimized.

Contributor

ohmystack commented Feb 12, 2018

/retest

@thrawn997

This comment has been minimized.

thrawn997 commented Feb 14, 2018

Anything I can do to help with this one?

@ohmystack

This comment has been minimized.

Contributor

ohmystack commented Feb 14, 2018

@pires All tests have passed. Would you mind to review this PR?

@pires

pires approved these changes Feb 15, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 15, 2018

@ohmystack

This comment has been minimized.

Contributor

ohmystack commented Feb 16, 2018

/retest

@ohmystack

This comment has been minimized.

Contributor

ohmystack commented Feb 16, 2018

pinging @Random-Liu @dchen1107 @vishh for approval

@ohmystack

This comment has been minimized.

Contributor

ohmystack commented Feb 17, 2018

/retest

@ohmystack

This comment has been minimized.

Contributor

ohmystack commented Feb 18, 2018

/test all

dockertools: disable MemorySwap on Linux
According to docker docs, setting MemorySwap equals to Memory can
prevent docker containers from using any swap, instead of setting
MemorySwap to zero.

@k8s-merge-robot k8s-merge-robot removed the lgtm label Feb 18, 2018

@ohmystack

This comment has been minimized.

Contributor

ohmystack commented Feb 18, 2018

@pires Could you /lgtm again, please? I've just rebased to latest master to fix a test (not caused by my code) and didn't do any other changes.

Ping kubelet OWNERs to approve this. Thanks.
@Random-Liu @dchen1107 @derekwaynecarr @tallclair @vishh @yujuhong

@thrawn997

This comment has been minimized.

thrawn997 commented Feb 26, 2018

Re-ping @pires @vishh

@pires

This comment has been minimized.

Member

pires commented Feb 26, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 26, 2018

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Feb 26, 2018

@ohmystack: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kubeadm-gce-canary ee952cd link /test pull-kubernetes-e2e-kubeadm-gce-canary

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.

@yujuhong

This comment has been minimized.

Contributor

yujuhong commented Feb 26, 2018

/approve

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Feb 26, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ohmystack, pires, yujuhong

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

@fejta-bot

This comment has been minimized.

fejta-bot commented Feb 27, 2018

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Feb 27, 2018

Automatic merge from submit-queue (batch tested with PRs 50724, 59025, 59710, 59404, 59958). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-merge-robot k8s-merge-robot merged commit 89e433f into kubernetes:master Feb 27, 2018

13 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation ohmystack authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-unit Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
@thrawn997

This comment has been minimized.

thrawn997 commented Feb 27, 2018

Is it possible to get this merged into a 1.9 release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment