Commit Graph

58 Commits (b8fece50f533bdfbf58b638f73e18a5773c3434c)

Author SHA1 Message Date
choury 36b92b9b29 cpumanager: rollback state if updateContainerCPUSet failed 2018-08-17 18:08:58 +08:00
Lin Yang b7e1f0bf17 kubelet/cm/cpumanager: Fix unused variable "skipIfPermissionsError"
The variable "skipIfPermissionsError" is not needed even when
permission error happened.
2018-08-02 17:24:33 -07:00
Ismo Puustinen 3bb5ca9257 cpumanager: add test for available CPUs in static policy.
Test the cases where the number of CPUs available in the system is
smaller or larger than the number of CPUs known in the state, which
should lead to a panic. This covers both CPU onlining and offlining. The
case where the number of CPUs matches is already covered by the
"non-corrupted state" test.
2018-07-31 10:20:37 +03:00
Ismo Puustinen 4f604eb73c cpumanager: validate topology in static policy.
This patch adds a check for the static policy state validation. The
check fails if the CPU topology obtained from cadvisor doesn't match
with the current topology in the state file.

If the CPU topology has changed in a node, cpu manager static policy
might try to assign non-present cores to containers.

For example in my test case, static policy had the default CPU set of
0-1,4-7. Then kubelet was shut down and CPU 7 was offlined. After
restarting the kubelet, CPU manager tries to assign the non-existent CPU
7 to containers which don't have exclusive allocations assigned to them:

 Error response from daemon: Requested CPUs are not available - requested 0-1,4-7, available: 0-6)

This breaks the exclusivity, since the CPUs from the shared pool don't
get assigned to non-exclusive containers, meaning that they can execute
on the exclusive CPUs.
2018-07-30 08:49:13 +03:00
choury 8e4b62a74b
Remove duplicate check line
There is a same [line](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/cm/cpumanager/policy_static.go#L81).
2018-07-05 11:07:56 +08:00
Kubernetes Submit Queue 991a84758f
Merge pull request #59214 from kdembler/cpumanager-checkpointing
Automatic merge from submit-queue (batch tested with PRs 59214, 65330). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Migrate cpumanager to use checkpointing manager

**What this PR does / why we need it**:
This PR migrates `cpumanager` to use new kubelet level node checkpointing feature (#56040) to decrease code redundancy and improve consistency.

**Which issue(s) this PR fixes**:
Fixes #58339

**Notes**:
At point of submitting PR the most straightforward approach was used - `state_checkpoint` implementation of `State` interface was added. However, with checkpointing implementation there might be no point to keep `State` interface and just use single implementation with checkpoint backend and in case of different backend than filestore needed just supply `cpumanager` with custom `CheckpointManager` implementation.

/kind feature
/sig node
cc @flyingcougar @ConnorDoyle
2018-06-25 18:19:00 -07:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Klaudiusz Dembler a9df2acc4b Typo fix 2018-06-07 12:08:48 +02:00
Klaudiusz Dembler 9384937f2f Update bazel 2018-05-21 17:39:51 +02:00
Klaudiusz Dembler de1063bc7d Add compatibility tests 2018-05-21 14:50:31 +02:00
Klaudiusz Dembler 3d09101b6f Add docstrings 2018-05-21 11:40:04 +02:00
Klaudiusz Dembler aa325ec2d9 Change JSON letter case in tests 2018-05-15 18:43:48 +02:00
Klaudiusz Dembler 7bb047ec75 Rebase and backward compatibility 2018-05-15 18:34:53 +02:00
Klaudiusz Dembler ba8d82c96a
Update error indicating unexistent checkpoint 2018-05-14 09:51:27 +02:00
Klaudiusz Dembler 0b1a73e94b
Make cpuManagerCheckpoint exported 2018-05-14 09:51:27 +02:00
Klaudiusz Dembler cc3fa67bda
Add comments to MockCheckpoint functions and gofmt 2018-05-14 09:51:27 +02:00
Klaudiusz Dembler 0fbd19bc06
Tweaks 2018-05-14 09:51:26 +02:00
Klaudiusz Dembler 3991ed5d2f
Add tests 2018-05-14 09:51:26 +02:00
Klaudiusz Dembler 6bfceed4ab
Migrate cpumanager to use checkpointing manager 2018-05-14 09:45:58 +02:00
choury c1b19fce90 avoid dobule RLock() in cpumanager 2018-04-23 10:33:40 +08:00
Jordan Liggitt b562263427
Avoid data races in unit tests 2018-03-30 17:19:40 -04:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Lee Verberne e10042d22f Increment CRI version from v1alpha1 to v1alpha2
This also incorporates the version string into the package name so
that incompatibile versions will fail to connect.

Arbitrary choices:
- The proto3 package name is runtime.v1alpha2. The proto compiler
  normally translates this to a go package of "runtime_v1alpha2", but
  I renamed it to "v1alpha2" for consistency with existing packages.
- kubelet/apis/cri is used as "internalapi". I left it alone and put the
  public "runtimeapi" in kubelet/apis/cri/runtime.
2018-02-07 09:06:26 +01:00
Kubernetes Submit Queue c817765b0e
Merge pull request #58445 from hanxiaoshuai/typo
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix some typos in comments

**What this PR does / why we need it**:

Fixes # fix some typos in comments
2018-01-30 19:44:44 -08:00
hangaoshuai 005f8c4926 fix some typos in comments 2018-01-18 17:07:51 +08:00
linweibin fa8afc1d39 Remove unused code in UT files in pkg/ 2018-01-15 16:02:35 +08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Di Xu d474b86e05 Propagate error up instead panic 2017-12-18 14:05:06 +08:00
Kubernetes Submit Queue 7908e96539
Merge pull request #56191 from ConnorDoyle/cpu-manager-panic-state-init-error
Automatic merge from submit-queue (batch tested with PRs 54410, 56184, 56199, 56191, 56231). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

CPU Manager panics on state initialization error.

**What this PR does / why we need it**:

- CPU Manager panics on state initialization error.
- Update unit tests accordingly.
- Minor related cleanup in `state_file.go`.

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```

/kind bug
/sig node
/priority important-soon
Blocks #52031
/assign @balajismaniam 
cc @flyingcougar
2017-12-14 05:33:17 -08:00
Szymon Scharmach 552e4d3a9d Cpu manager reconclie loop can restore state 2017-11-27 11:22:21 +01:00
Connor Doyle 4f185e6b7f CPU Manager panics on state initialization error.
- Update unit tests accordingly.
- Minor related cleanup in state_file.go
2017-11-22 10:25:38 -08:00
Connor Doyle c95ee34234 Use file-backed state for all cpumanager policies
- Add unit test to verify policy name mismatch behavior.
2017-11-15 22:38:11 -08:00
Kubernetes Submit Queue e99544d018
Merge pull request #54409 from intelsdi-x/cpu-enable-state-file
Automatic merge from submit-queue (batch tested with PRs 55764, 55683, 55468, 54409, 55546). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Enable file back state in static policy

**What this PR does / why we need it**:
Enables file back `State` in `static policy` and cpu manager + tests.
Upon policy start, state read from file is validated whether it meets the policy assumption. In case of any error, state is cleared.

Previous PR: #54408
Next PR: #54409
2017-11-15 22:16:05 -08:00
Michał Stachowski 809ac834a0 Cpu manager file state tests 2017-11-14 18:26:41 +01:00
Szymon Scharmach 7e7301ffaf Enable file state in static policy 2017-11-14 18:25:58 +01:00
Dr. Stefan Schimanski bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Shawn Hsiao f7a15cb751 set leveled logging (v=4) for 'updating container' message 2017-11-01 16:54:23 -04:00
Michał Stachowski 97e3f7bf86 State file test fixes 2017-10-26 20:03:35 +02:00
Szymon Scharmach 4ee0adc77a Added Cpu Manager file state 2017-10-26 20:03:17 +02:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Szymon Scharmach b86dc9c054 Make CoreID's platform unique 2017-10-10 10:45:44 +02:00
Harry Zhang 282973d87d Elimenate extra CRI call 2017-09-30 16:51:32 +08:00
Balaji Subramaniam e2cb80db4a Added large topology tests for static policy in CPU Manager.
- Added comments for tests cases.
2017-09-06 13:15:22 -07:00
Balaji Subramaniam 5b5958ecec Add tests for the static cpumanager policy. 2017-09-04 07:24:59 -07:00
Connor Doyle d0bcbbb437 Added static cpumanager policy. 2017-09-04 07:24:59 -07:00
Connor Doyle e03a6435bb Added cpu assignment helpers. 2017-09-04 07:24:59 -07:00
Szymon Scharmach 242439c9d7 Add topology helper and tests to cpumanager. 2017-09-04 07:24:59 -07:00
Connor Doyle ec706216e6 Un-revert "CPU manager wiring and `none` policy"
This reverts commit 8d2832021a.
2017-09-04 07:24:59 -07:00