Commit Graph

143 Commits

Author SHA1 Message Date
Davanum Srinivas
497e9c1971
Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-15 10:34:02 -05:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Francesco Romani
6dcec345df smtalign: cm: factor out admission response
Introduce a new `admission` subpackage to factor out the responsability
to create `PodAdmitResult` objects. This enables resource manager
to report specific errors in Allocate() and to bubble up them
in the relevant fields of the `PodAdmitResult`.

To demonstrate the approach we refactor TopologyAffinityError as a
proper error.

Co-authored-by: Kevin Klues <kklues@nvidia.com>
Co-authored-by: Swati Sehgal <swsehgal@redhat.com>
Signed-off-by: Francesco Romani <fromani@redhat.com>
2021-07-08 23:15:37 +02:00
kikimo
8b3162d67b clean code 2021-06-02 01:17:04 +08:00
kikimo
20c02357ca Add hint to fake topology manager. 2021-05-22 15:29:08 +08:00
aheng-ch
ff7b94fa5a fix removing pods from podTopologyHints mapping 2021-05-10 19:44:15 +08:00
Amim Knabben
95db61e37b Structured log for topologymanager 2021-03-11 20:50:14 -05:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
choury
fe089a2d12 make podTopologyHints protected by lock
It crashed kubelet by "concurrent map read and map write"
2021-01-26 10:36:05 +08:00
Krzysztof Wiatrzyk
b7714918db Run ./update-all.sh
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:55 +01:00
Krzysztof Wiatrzyk
656a08afdf Move scope specific tests from topologymanager under particular scopes
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:55 +01:00
Krzysztof Wiatrzyk
c786c9a533 Move common tests from topologymanager under scope
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:55 +01:00
Krzysztof Wiatrzyk
f5c0fe4ef6 Update topologymanager tests after adding scopes
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:55 +01:00
Krzysztof Wiatrzyk
6db58b2e92 Update logging to use a format util
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:55 +01:00
Krzysztof Wiatrzyk
b2be584e5b Implement topology manager scopes
* Add topologyScopeName parameter to NewManager().
* Add scope interface and structure that implement common logic
* Add pod scope & container scopes
* Add pod lifecycle functions

Co-authored-by: sw.han <sw.han@samsung.com>

Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:54 +01:00
sw.han
f5997fe537 Add GetPodTopologyHints() interface to Topology/CPU/Device Manager
Signed-off-by: Krzysztof Wiatrzyk <k.wiatrzyk@samsung.com>
2020-11-12 12:25:54 +01:00
draveness
60d3f99b1f style: update comments in topology manager 2020-10-23 18:20:50 +08:00
auxten
a9c1acc044 Fix staticchecks ST1005,S1002,S1008,S1039 in pkg/kubelet 2020-09-07 10:53:43 +08:00
Alexey Perevalov
a047e8aa1b move to cadvisor.MachineInfo
This patch removes GetNUMANodeInfo, cadvisor.MachineInfo will be used
instead of it. GetNUMANodeInfo was introduced due to difference of meaning of
MachineInfo.Topology. On the arm it was NUMA nodes, but on the x86 it
represents sockets (since reading from /proc/cpuinfo). Now it unified
and MachineInfo.Topology represents NUMA node.

Signed-off-by: Alexey Perevalov <alexey.perevalov@huawei.com>
2020-07-24 09:29:41 -04:00
Kevin Klues
9f5f401d60 Add AnySet() to topologymanager bitmask API 2020-07-20 11:41:13 +00:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Wenfeng-GAO
1aebbee7da simplify code in topologymanager 2020-03-28 00:04:51 +08:00
Kubernetes Prow Robot
cd0057c16a
Merge pull request #88876 from nolancon/none-policy-fix
Topology Manager none policy bug fix
2020-03-05 21:40:33 -08:00
Kubernetes Prow Robot
48541a0b16
Merge pull request #87650 from nolancon/beta-feature-gate
Update TopologyManager Feature Gate
2020-03-05 20:03:04 -08:00
nolancon
0551d408ac Bug fix for TM none policy 2020-03-05 14:25:48 +00:00
nolancon
e8538d9b76 Add mutex to Topology Manager Add/RemoveContainer
This was exposed as a potential bug during e2e test debugging of this
PR.
2020-03-02 04:07:21 +00:00
Kevin Klues
9e4ee5ecc3 Add Allocate() call to TopologyManager's HintProvider interface
Having this interface allows us to perform a tight loop of:

    for each container {
        containerHints = {}
        for each provider {
	    containerHints[provider] = provider.GatherHints(container)
        }

        containerHints.MergeAndPublish()

        for each provider {
	    provider.Allocate(container)
        }
    }

With this in place we can now be sure that the hints gathered in one
iteration of the loop always consider the allocations made in the
previous.
2020-02-10 03:27:47 +00:00
Kevin Klues
d5addb4090 Cleanup logging and creation logic of TopologyManager in prep for beta 2020-02-03 17:13:29 +00:00
Kevin Klues
bc686ea27b Update TopologyManager.GetTopologyHints() to take pointers
Previously, this function was taking full Pod and Container objects
unnecessarily. This commit updates this so that they will take pointers
instead.
2020-02-03 17:13:28 +00:00
Kevin Klues
adaa58b6cb Update TopologyManager.Policy.Merge() to return a simple bool
Previously, the verious Merge() policies of the TopologyManager all
eturned their own lifecycle.PodAdmitResult result. However, for
consistency in any failed admits, this is better handled in the
top-level Topology manager, with each policy only returning a boolean
about whether or not they would like to admit the pod or not. This
commit changes the semantics to match this logic.
2020-02-03 17:13:28 +00:00
Kevin Klues
95a3ac447f Fix bug in TopologManager RemoveContainer()
Previously, we unconditionally removed *all* topology hints from a pod
whenever just one container was being removed. This commit makes it so
we only remove the hints for the single container being removed, and
then conditionally remove the pod from the podTopologyHints[podUID] when
no containers left in it.
2020-02-03 17:13:14 +00:00
nolancon
4d76b1c8de Add mergeFilteredHints:
- Move remaining logic from mergeProvidersHints to generic top level
mergeFilteredHints function.
- Add numaNodes as parameter in order to make generic.
- Move single NUMA node specific check to single-numa-node Merge
function.
2020-01-22 09:07:41 +00:00
nolancon
fc300e0e7d Move filterSingleNumaHints call to top level Merge 2020-01-22 08:39:22 +00:00
nolancon
45660fd3a2 Add filterProvidersHints function:
- Move initial 'filtering' functionality to generic function
filterProvidersHints level policy.go.
- Call new function from top level Merge function.
- Rename some variables/parameters to reflect changes.
2020-01-22 08:35:28 +00:00
nolancon
df9b2595f3 Update filterHints to filterSingleNumaHints:
- Change function name
- Remove policy parameter (unnecessary)
- Update unit test to reflect change
2020-01-22 07:15:00 +00:00
Kubernetes Prow Robot
50f9ea7999
Merge pull request #85798 from nolancon/merge-policy-rebase
Updated - topologymanager: Add Merge method to Policy
2020-01-17 05:14:56 -08:00
Kevin Klues
708278098a Update bitmask printing to print in groups of 2 instead of all 64 bits 2020-01-16 17:28:52 +01:00
Kevin Klues
7069b1d6e8 Update TopologyManager single-numa-node logic to handle "don't cares"
The logic has been updated to match the logic of the best-effort policy
except in two places:

1) The hint filtering frunction has been updated to allow "don't care"
hints encoded with a `nil` affinity mask, to pass through the filter in
addition to hints that have just a single NUMA bit set.

2) After calculating the `bestHint` we transform "don't care" affinities
encoded as having all NUMA bits set in their affinity masks into "don't
care" affinities encoded as `nil`.
2020-01-16 08:50:35 +00:00
Kevin Klues
2905ffffa7 Rename TopologyManager test TestPolicyBestEffortMerge for consistency 2020-01-16 08:50:21 +00:00
Kevin Klues
94489c137c Cleanup use of defaultAffinity in mergePermutation of TopologyManager 2020-01-16 08:50:12 +00:00
nolancon
5e23517ebf Use reflect.DeepEqual check in policy_test.go 2020-01-16 08:13:07 +00:00
nolancon
92eb7cd601 Update "Single NUMA hint generation" expected affinity to nil 2020-01-16 08:13:07 +00:00
nolancon
8b3f6e61a2 Move test case "Two providers, 1 with 2 hints, 1 with single
non-preferred hint matching" into specific policy tests
2020-01-16 08:13:07 +00:00
nolancon
681c42bfc2 Move test case "Two providers, 1 hint each, same mask, 1 preferred, 1
not 2/2" into specific policy tests
2020-01-16 08:13:07 +00:00
nolancon
a38a2562b2 Move test case "Two providers, 1 hint each, same mask, 1 preferred, 1
not 1/2" into specific policy test.
2020-01-16 08:13:07 +00:00
nolancon
f639da7637 Move test case "Two providers, 1 hint each, no common mask" into
specific policy tests.
2020-01-16 08:13:07 +00:00
nolancon
401a2bb285 Move test case "Single TopologyHint with Preferred as false and
NUMANodeAffinity as nil" into specific policy tests.
2020-01-16 08:13:06 +00:00
nolancon
6460ef6392 Move test case "Single TopologyHint with Preferred as true and
NUMANodeAffinity as nil" into specific policy tests.
2020-01-16 08:13:06 +00:00
nolancon
baeff9ec5d Move test case "HintProvider returns empty non-nil map[string][]TopologyHint from
provider" into specific policy tests.
2020-01-16 08:13:06 +00:00