You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2022/12/11 17:30:19 UTC

[GitHub] [yunikorn-core] lixmgl opened a new pull request, #473: YUNIKORN-1437: Expose queue running app details in REST

lixmgl opened a new pull request, #473:
URL: https://github.com/apache/yunikorn-core/pull/473

   ### What is this PR for?
   A few sentences describing the overall goals of the pull request's commits.
   First time? Check out the contributing guide - http://yunikorn.apache.org/community/how_to_contribute   
   
   
   ### What type of PR is it?
   * [ ] - Bug Fix
   * [ ] - Improvement
   * [ ] - Feature
   * [ ] - Documentation
   * [ ] - Hot Fix
   * [ ] - Refactoring
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/YUNIKORN-1437
   
   ### How should this be tested?
   Tested on local YuniKorn by querying: http://127.0.0.1:9889/ws/v1/partition/default/queues
   
   ### Screenshots (if appropriate)
   <img width="346" alt="Screen Shot 2022-12-11 at 9 15 50 AM" src="https://user-images.githubusercontent.com/7441350/206918988-90e4523c-a426-4fbb-8476-10eb6b278b64.png">
   
   
   ### 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-core] lixmgl commented on a diff in pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
lixmgl commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1046320655


##########
pkg/scheduler/objects/queue.go:
##########
@@ -473,6 +473,9 @@ func (sq *Queue) GetPartitionQueueDAOInfo() dao.PartitionQueueDAOInfo {
 	} else {
 		queueInfo.Parent = sq.QueuePath[:strings.LastIndex(sq.QueuePath, configs.DOT)]
 	}
+	queueInfo.MaxRunningApps = sq.maxRunningApps
+	queueInfo.RunningApps = sq.runningApps
+	queueInfo.AllocatingAcceptedApps = make([]string, len(sq.allocatingAcceptedApps))

Review Comment:
   Thanks for pointing out!
   
   I updated to queueInfo.AllocatingAcceptedApps = make([]string, 0) since we don't know how many elements initially. 
   Also I only **append appID when sq.allocatingAcceptedApps value is true** since we don't care about appID when it's false.
   



-- 
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-core] wilfred-s closed pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
wilfred-s closed pull request #473: YUNIKORN-1437: Expose queue running app details in REST
URL: https://github.com/apache/yunikorn-core/pull/473


-- 
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-core] lixmgl commented on a diff in pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
lixmgl commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1045405722


##########
pkg/scheduler/objects/queue.go:
##########
@@ -473,6 +473,12 @@ func (sq *Queue) GetPartitionQueueDAOInfo() dao.PartitionQueueDAOInfo {
 	} else {
 		queueInfo.Parent = sq.QueuePath[:strings.LastIndex(sq.QueuePath, configs.DOT)]
 	}
+	queueInfo.MaxRunningApps = sq.maxRunningApps
+	queueInfo.RunningApps = sq.runningApps
+	queueInfo.AllocatingAcceptedApps = make(map[string]bool)

Review Comment:
   Good point, updated code & screenshot. 



-- 
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-core] lixmgl commented on a diff in pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
lixmgl commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1046324251


##########
pkg/scheduler/objects/queue_test.go:
##########
@@ -1334,6 +1334,17 @@ func TestGetPartitionQueueDAOInfo(t *testing.T) {
 	root.guaranteedResource = getResource(t)
 	assert.DeepEqual(t, root.GetMaxResource().DAOMap(), root.GetMaxResource().DAOMap())
 	assert.DeepEqual(t, root.GetGuaranteedResource().DAOMap(), root.GetGuaranteedResource().DAOMap())
+
+	// test allocatingAcceptedApps
+	root.allocatingAcceptedApps = getAllocatingAcceptedApps()
+	assert.Assert(t, reflect.DeepEqual(len(root.allocatingAcceptedApps), len(root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps)))

Review Comment:
   Good point. 
   I updated to check root.allocatingAcceptedApps and root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps lengths separately since they might be same. 
   I also checked root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps element value it should be appID1 since it's true, we don't append appID2 since it's false. 



-- 
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-core] wilfred-s commented on a diff in pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
wilfred-s commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1045380897


##########
pkg/scheduler/objects/queue.go:
##########
@@ -473,6 +473,12 @@ func (sq *Queue) GetPartitionQueueDAOInfo() dao.PartitionQueueDAOInfo {
 	} else {
 		queueInfo.Parent = sq.QueuePath[:strings.LastIndex(sq.QueuePath, configs.DOT)]
 	}
+	queueInfo.MaxRunningApps = sq.maxRunningApps
+	queueInfo.RunningApps = sq.runningApps
+	queueInfo.AllocatingAcceptedApps = make(map[string]bool)

Review Comment:
   we can use a simple slice of strings here, we do not need the booleans:
   ```
   queueInfo.AllocatingAcceptedApps = make([]string, len(sq.allocatingAcceptedApps))
   ```



-- 
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-core] wilfred-s commented on a diff in pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
wilfred-s commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1045687200


##########
pkg/scheduler/objects/queue_test.go:
##########
@@ -1334,6 +1334,17 @@ func TestGetPartitionQueueDAOInfo(t *testing.T) {
 	root.guaranteedResource = getResource(t)
 	assert.DeepEqual(t, root.GetMaxResource().DAOMap(), root.GetMaxResource().DAOMap())
 	assert.DeepEqual(t, root.GetGuaranteedResource().DAOMap(), root.GetGuaranteedResource().DAOMap())
+
+	// test allocatingAcceptedApps
+	root.allocatingAcceptedApps = getAllocatingAcceptedApps()
+	assert.Assert(t, reflect.DeepEqual(len(root.allocatingAcceptedApps), len(root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps)))

Review Comment:
   The test is just doing a length comparison, simplify to:
    assert.Equal(t, len(), len(), "missing allocating apps")



##########
pkg/scheduler/objects/queue.go:
##########
@@ -473,6 +473,9 @@ func (sq *Queue) GetPartitionQueueDAOInfo() dao.PartitionQueueDAOInfo {
 	} else {
 		queueInfo.Parent = sq.QueuePath[:strings.LastIndex(sq.QueuePath, configs.DOT)]
 	}
+	queueInfo.MaxRunningApps = sq.maxRunningApps
+	queueInfo.RunningApps = sq.runningApps
+	queueInfo.AllocatingAcceptedApps = make([]string, len(sq.allocatingAcceptedApps))

Review Comment:
   We still need the loop to copy the keys over otherwise we just have an empty slice, this is a cleaner solution copying the keys:
   ```
    	for appID, _ := range sq.allocatingAcceptedApps {
   		queueInfo.AllocatingAcceptedApps = append(queueInfo.AllocatingAcceptedApps, appID)
   	}
   ```



-- 
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-core] lixmgl commented on a diff in pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
lixmgl commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1045405722


##########
pkg/scheduler/objects/queue.go:
##########
@@ -473,6 +473,12 @@ func (sq *Queue) GetPartitionQueueDAOInfo() dao.PartitionQueueDAOInfo {
 	} else {
 		queueInfo.Parent = sq.QueuePath[:strings.LastIndex(sq.QueuePath, configs.DOT)]
 	}
+	queueInfo.MaxRunningApps = sq.maxRunningApps
+	queueInfo.RunningApps = sq.runningApps
+	queueInfo.AllocatingAcceptedApps = make(map[string]bool)

Review Comment:
   Good point, updated!



-- 
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-core] lixmgl commented on pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
lixmgl commented on PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#issuecomment-1345826292

   @wilfred-s @craigcondit Please review this pr, thanks!


-- 
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-core] lixmgl commented on a diff in pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
lixmgl commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1046324251


##########
pkg/scheduler/objects/queue_test.go:
##########
@@ -1334,6 +1334,17 @@ func TestGetPartitionQueueDAOInfo(t *testing.T) {
 	root.guaranteedResource = getResource(t)
 	assert.DeepEqual(t, root.GetMaxResource().DAOMap(), root.GetMaxResource().DAOMap())
 	assert.DeepEqual(t, root.GetGuaranteedResource().DAOMap(), root.GetGuaranteedResource().DAOMap())
+
+	// test allocatingAcceptedApps
+	root.allocatingAcceptedApps = getAllocatingAcceptedApps()
+	assert.Assert(t, reflect.DeepEqual(len(root.allocatingAcceptedApps), len(root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps)))

Review Comment:
   Good point. 
   I updated to check len(root.allocatingAcceptedApps) and len(root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps) separately since they could be different. 
   I also checked root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps element value, in this test it should be appID1 since it's true, we don't append appID2 since it's false. 



##########
pkg/scheduler/objects/queue_test.go:
##########
@@ -1334,6 +1334,17 @@ func TestGetPartitionQueueDAOInfo(t *testing.T) {
 	root.guaranteedResource = getResource(t)
 	assert.DeepEqual(t, root.GetMaxResource().DAOMap(), root.GetMaxResource().DAOMap())
 	assert.DeepEqual(t, root.GetGuaranteedResource().DAOMap(), root.GetGuaranteedResource().DAOMap())
+
+	// test allocatingAcceptedApps
+	root.allocatingAcceptedApps = getAllocatingAcceptedApps()
+	assert.Assert(t, reflect.DeepEqual(len(root.allocatingAcceptedApps), len(root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps)))

Review Comment:
   Good point. 
   I updated to check len(root.allocatingAcceptedApps) and len(root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps) separately since they could be different. 
   I also checked root.GetPartitionQueueDAOInfo().AllocatingAcceptedApps element value, in this test it should be appID1 since it's true, we don't append appID2 to AllocatingAcceptedApps since it's false. 



-- 
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-core] codecov[bot] commented on pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#issuecomment-1345612470

   # [Codecov](https://codecov.io/gh/apache/yunikorn-core/pull/473?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#473](https://codecov.io/gh/apache/yunikorn-core/pull/473?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (81232cc) into [master](https://codecov.io/gh/apache/yunikorn-core/commit/020bbd8544fd29743b2284e473695221de552826?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (020bbd8) will **decrease** coverage by `0.01%`.
   > The diff coverage is `50.00%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #473      +/-   ##
   ==========================================
   - Coverage   72.88%   72.87%   -0.02%     
   ==========================================
     Files          67       67              
     Lines       10057    10063       +6     
   ==========================================
   + Hits         7330     7333       +3     
   - Misses       2482     2484       +2     
   - Partials      245      246       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/yunikorn-core/pull/473?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [pkg/scheduler/objects/queue.go](https://codecov.io/gh/apache/yunikorn-core/pull/473/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3NjaGVkdWxlci9vYmplY3RzL3F1ZXVlLmdv) | `70.18% <50.00%> (-0.14%)` | :arrow_down: |
   
   :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=The+Apache+Software+Foundation)
   


-- 
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-core] lixmgl commented on a diff in pull request #473: YUNIKORN-1437: Expose queue running app details in REST

Posted by GitBox <gi...@apache.org>.
lixmgl commented on code in PR #473:
URL: https://github.com/apache/yunikorn-core/pull/473#discussion_r1046320655


##########
pkg/scheduler/objects/queue.go:
##########
@@ -473,6 +473,9 @@ func (sq *Queue) GetPartitionQueueDAOInfo() dao.PartitionQueueDAOInfo {
 	} else {
 		queueInfo.Parent = sq.QueuePath[:strings.LastIndex(sq.QueuePath, configs.DOT)]
 	}
+	queueInfo.MaxRunningApps = sq.maxRunningApps
+	queueInfo.RunningApps = sq.runningApps
+	queueInfo.AllocatingAcceptedApps = make([]string, len(sq.allocatingAcceptedApps))

Review Comment:
   Thanks for pointing out!
   
   I updated to **queueInfo.AllocatingAcceptedApps = make([]string, 0)** since we don't know how many elements initially. 
   Also I only **append appID when sq.allocatingAcceptedApps value is true** since we don't care about appID when it's false.
   



-- 
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