You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "craigcondit (via GitHub)" <gi...@apache.org> on 2023/06/07 17:03:27 UTC

[GitHub] [yunikorn-k8shim] craigcondit opened a new pull request, #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2

craigcondit opened a new pull request, #610:
URL: https://github.com/apache/yunikorn-k8shim/pull/610

   Now builds against Kubernetes 1.27.2. This adds runtime suport for Kubernetes 1.27 but removes support for Kubernetes 1.21-1.23. Supported versions are now 1.24.x through 1.27.x. Updated e2e test scripts to match.
   
   ### What type of PR is it?
   * [ ] - Bug Fix
   * [x] - Improvement
   * [ ] - Feature
   * [ ] - Documentation
   * [ ] - Hot Fix
   * [ ] - Refactoring
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/YUNIKORN-1699
   
   ### How should this be tested?
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * [ ] - The licenses files need update.
   * [ ] - There is breaking changes for older versions.
   * [ ] - It needs documentation.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-k8shim] craigcondit closed pull request #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2

Posted by "craigcondit (via GitHub)" <gi...@apache.org>.
craigcondit closed pull request #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2
URL: https://github.com/apache/yunikorn-k8shim/pull/610


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-k8shim] codecov[bot] commented on pull request #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #610:
URL: https://github.com/apache/yunikorn-k8shim/pull/610#issuecomment-1581229019

   ## [Codecov](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#610](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (50b7286) into [master](https://app.codecov.io/gh/apache/yunikorn-k8shim/commit/8c4fa3e1ce2f72e55bbf3a4e589fc67af253d639?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (8c4fa3e) will **increase** coverage by `0.12%`.
   > The diff coverage is `59.34%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #610      +/-   ##
   ==========================================
   + Coverage   70.87%   70.99%   +0.12%     
   ==========================================
     Files          47       48       +1     
     Lines        7972     8030      +58     
   ==========================================
   + Hits         5650     5701      +51     
   - Misses       2117     2131      +14     
   + Partials      205      198       -7     
   ```
   
   
   | [Impacted Files](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [pkg/admission/conf/am\_conf.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL2FkbWlzc2lvbi9jb25mL2FtX2NvbmYuZ28=) | `72.91% <0.00%> (ø)` | |
   | [pkg/cache/context.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL2NhY2hlL2NvbnRleHQuZ28=) | `43.19% <0.00%> (-0.67%)` | :arrow_down: |
   | [pkg/plugin/support/framework\_handle.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL3BsdWdpbi9zdXBwb3J0L2ZyYW1ld29ya19oYW5kbGUuZ28=) | `22.03% <0.00%> (ø)` | |
   | [pkg/plugin/support/shared\_lister.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL3BsdWdpbi9zdXBwb3J0L3NoYXJlZF9saXN0ZXIuZ28=) | `77.77% <50.00%> (-22.23%)` | :arrow_down: |
   | [pkg/cache/external/scheduler\_cache.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL2NhY2hlL2V4dGVybmFsL3NjaGVkdWxlcl9jYWNoZS5nbw==) | `66.03% <63.41%> (-0.23%)` | :arrow_down: |
   | [pkg/plugin/predicates/predicate\_manager.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL3BsdWdpbi9wcmVkaWNhdGVzL3ByZWRpY2F0ZV9tYW5hZ2VyLmdv) | `58.57% <71.42%> (+7.14%)` | :arrow_up: |
   | [pkg/plugin/support/storageinfo\_lister.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL3BsdWdpbi9zdXBwb3J0L3N0b3JhZ2VpbmZvX2xpc3Rlci5nbw==) | `71.42% <71.42%> (ø)` | |
   | [pkg/admission/namespace\_cache.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL2FkbWlzc2lvbi9uYW1lc3BhY2VfY2FjaGUuZ28=) | `85.71% <100.00%> (ø)` | |
   | [pkg/admission/priority\_class\_cache.go](https://app.codecov.io/gh/apache/yunikorn-k8shim/pull/610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL2FkbWlzc2lvbi9wcmlvcml0eV9jbGFzc19jYWNoZS5nbw==) | `81.66% <100.00%> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-k8shim] craigcondit commented on a diff in pull request #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2

Posted by "craigcondit (via GitHub)" <gi...@apache.org>.
craigcondit commented on code in PR #610:
URL: https://github.com/apache/yunikorn-k8shim/pull/610#discussion_r1244534030


##########
pkg/cache/external/scheduler_cache.go:
##########
@@ -589,6 +596,55 @@ func (cache *SchedulerCache) nodePodCount() int {
 	return result
 }
 
+// IsPVCUsedByPods determines if a given volume claim is in use by any current pods. This is explicitly for the use
+// of the predicate shared lister and requires that the scheduler cache lock be held while accessing.
+func (cache *SchedulerCache) IsPVCUsedByPods(key string) bool {
+	_, ok := cache.pvcRefCounts[key]
+	return ok
+}
+
+func (cache *SchedulerCache) maxNodeGeneration() int64 {
+	var maxGeneration int64
+	for _, node := range cache.nodesMap {
+		if maxGeneration < node.Generation {
+			maxGeneration = node.Generation
+		}
+	}
+	return maxGeneration
+}
+
+func (cache *SchedulerCache) updatePVCRefCounts() {
+	maxGeneration := cache.maxNodeGeneration()
+	updateAll := false
+	if cache.pvcGeneration == 0 {
+		// clear cache
+		updateAll = true
+		cache.pvcRefCounts = make(map[string]map[string]int)
+	} else if cache.pvcGeneration >= maxGeneration {

Review Comment:
   This was based on the implementation the default scheduler uses. I kept it the same for now to ensure compatibility. We can revisit if this proves to be very expensive.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-k8shim] craigcondit commented on a diff in pull request #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2

Posted by "craigcondit (via GitHub)" <gi...@apache.org>.
craigcondit commented on code in PR #610:
URL: https://github.com/apache/yunikorn-k8shim/pull/610#discussion_r1244534355


##########
scripts/generate-groups.sh:
##########
@@ -61,7 +61,7 @@ shift 4
   # To support running this script from anywhere, we have to first cd into this directory
   # so we can install the tools.
   cd "$(dirname "${0}")"
-  go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
+  go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}@v0.27.1

Review Comment:
   Good catch. Original patch used 1.27.1 versions, but output is identical. I've updated locally, and will do so on commit as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-k8shim] wilfred-s commented on a diff in pull request #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2

Posted by "wilfred-s (via GitHub)" <gi...@apache.org>.
wilfred-s commented on code in PR #610:
URL: https://github.com/apache/yunikorn-k8shim/pull/610#discussion_r1244512484


##########
scripts/generate-groups.sh:
##########
@@ -61,7 +61,7 @@ shift 4
   # To support running this script from anywhere, we have to first cd into this directory
   # so we can install the tools.
   cd "$(dirname "${0}")"
-  go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
+  go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}@v0.27.1

Review Comment:
   nit: Should this be 1.27.2 ? same as the go.mod file can be fixed on commit if easier



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-k8shim] craigcondit commented on pull request #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2

Posted by "craigcondit (via GitHub)" <gi...@apache.org>.
craigcondit commented on PR #610:
URL: https://github.com/apache/yunikorn-k8shim/pull/610#issuecomment-1610160678

   Rebased on master to fix go.mod / go.sum conflicts.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-k8shim] wilfred-s commented on a diff in pull request #610: [YUNIKORN-1699] Build against Kubernetes 1.27.2

Posted by "wilfred-s (via GitHub)" <gi...@apache.org>.
wilfred-s commented on code in PR #610:
URL: https://github.com/apache/yunikorn-k8shim/pull/610#discussion_r1244512110


##########
pkg/cache/external/scheduler_cache.go:
##########
@@ -589,6 +596,55 @@ func (cache *SchedulerCache) nodePodCount() int {
 	return result
 }
 
+// IsPVCUsedByPods determines if a given volume claim is in use by any current pods. This is explicitly for the use
+// of the predicate shared lister and requires that the scheduler cache lock be held while accessing.
+func (cache *SchedulerCache) IsPVCUsedByPods(key string) bool {
+	_, ok := cache.pvcRefCounts[key]
+	return ok
+}
+
+func (cache *SchedulerCache) maxNodeGeneration() int64 {
+	var maxGeneration int64
+	for _, node := range cache.nodesMap {
+		if maxGeneration < node.Generation {
+			maxGeneration = node.Generation
+		}
+	}
+	return maxGeneration
+}
+
+func (cache *SchedulerCache) updatePVCRefCounts() {
+	maxGeneration := cache.maxNodeGeneration()
+	updateAll := false
+	if cache.pvcGeneration == 0 {
+		// clear cache
+		updateAll = true
+		cache.pvcRefCounts = make(map[string]map[string]int)
+	} else if cache.pvcGeneration >= maxGeneration {

Review Comment:
   This is expensive when we have a long list of nodes. Generation for the nodes is a monotonically increasing number and never can go down. We should handle this when the node in the cache is manipulated (new, add or remove pod) they all trigger a generation increment. Use a follow up jira to make this smarter, we have a handle on the node already that has changed and can target this as far as I can tell.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org